2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1999-04-21 22:46:15 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
* compliance with the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/NPL/
|
1999-04-21 22:46:15 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1999-04-21 22:46:15 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
#ifndef nsHTMLButtonControlFrame_h___
|
|
|
|
#define nsHTMLButtonControlFrame_h___
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsHTMLContainerFrame.h"
|
|
|
|
#include "nsFormControlHelper.h"
|
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsHTMLParts.h"
|
|
|
|
#include "nsIFormControl.h"
|
|
|
|
|
|
|
|
#include "nsIRenderingContext.h"
|
|
|
|
#include "nsIPresContext.h"
|
|
|
|
#include "nsIPresShell.h"
|
2003-02-22 00:32:13 +00:00
|
|
|
#include "nsStyleContext.h"
|
1999-04-21 22:46:15 +00:00
|
|
|
#include "nsLeafFrame.h"
|
|
|
|
#include "nsCSSRendering.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsHTMLAtoms.h"
|
|
|
|
#include "nsIImage.h"
|
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
#include "nsIWidget.h"
|
|
|
|
#include "nsIComponentManager.h"
|
|
|
|
#include "nsIView.h"
|
|
|
|
#include "nsIViewManager.h"
|
|
|
|
#include "nsViewsCID.h"
|
|
|
|
#include "nsColor.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsButtonFrameRenderer.h"
|
|
|
|
|
|
|
|
class nsHTMLButtonControlFrame : public nsHTMLContainerFrame,
|
|
|
|
public nsIFormControlFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsHTMLButtonControlFrame();
|
1999-11-04 23:16:47 +00:00
|
|
|
~nsHTMLButtonControlFrame();
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
|
2000-05-16 12:44:32 +00:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext *aPresContext);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
|
|
|
|
2001-09-19 12:35:19 +00:00
|
|
|
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
2001-09-19 12:35:19 +00:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer,
|
|
|
|
PRUint32 aFlags = 0);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2002-11-19 03:39:44 +00:00
|
|
|
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
|
|
|
|
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 06:03:41 +00:00
|
|
|
nsEventStatus* aEventStatus);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2000-03-22 02:43:08 +00:00
|
|
|
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
|
|
|
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
2003-02-22 00:32:13 +00:00
|
|
|
nsStyleContext* aContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsIFrame* asPrevInFlow);
|
|
|
|
|
2003-02-22 00:32:13 +00:00
|
|
|
virtual nsStyleContext* GetAdditionalStyleContext(PRInt32 aIndex) const;
|
|
|
|
virtual void SetAdditionalStyleContext(PRInt32 aIndex,
|
|
|
|
nsStyleContext* aStyleContext);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2000-08-02 22:16:12 +00:00
|
|
|
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList);
|
2001-05-17 23:52:32 +00:00
|
|
|
|
2001-08-17 03:13:07 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-05-17 23:52:32 +00:00
|
|
|
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
2001-08-17 03:13:07 +00:00
|
|
|
#endif
|
2001-05-17 23:52:32 +00:00
|
|
|
|
1999-11-01 22:12:45 +00:00
|
|
|
#ifdef DEBUG
|
2001-11-14 01:33:42 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const {
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("ButtonControl"), aResult);
|
1999-04-21 22:46:15 +00:00
|
|
|
}
|
1999-11-01 22:12:45 +00:00
|
|
|
#endif
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
virtual nsresult RequiresWidget(PRBool &aRequiresWidget);
|
|
|
|
|
2002-01-09 19:17:46 +00:00
|
|
|
|
2002-12-18 23:38:09 +00:00
|
|
|
NS_IMETHOD_(PRInt32) GetType() const;
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD GetName(nsAString* aName);
|
|
|
|
NS_IMETHOD GetValue(nsAString* aName);
|
1999-04-21 22:46:15 +00:00
|
|
|
virtual void MouseClicked(nsIPresContext* aPresContext);
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD OnContentReset();
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
void SetFocus(PRBool aOn, PRBool aRepaint);
|
1999-08-21 00:09:24 +00:00
|
|
|
void ScrollIntoView(nsIPresContext* aPresContext);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
2000-01-25 15:25:46 +00:00
|
|
|
const nsFont*& aFont);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
1999-11-24 06:03:41 +00:00
|
|
|
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
1999-09-30 11:30:04 +00:00
|
|
|
float aPixToTwip,
|
1999-04-21 22:46:15 +00:00
|
|
|
nscoord aInnerHeight) const;
|
1999-11-24 06:03:41 +00:00
|
|
|
virtual nscoord GetHorizontalInsidePadding(nsIPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const;
|
|
|
|
|
2002-09-16 06:23:52 +00:00
|
|
|
// nsIFormControlFrame
|
2002-03-23 22:26:36 +00:00
|
|
|
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsAString& aValue);
|
|
|
|
NS_IMETHOD GetProperty(nsIAtom* aName, nsAString& aValue);
|
fixed bugs #6303, #6753, #6756, #6759
Re-wrote nsComboboxFrame.
removed the obsolete nsHTMLAtoms: comboText,comoTextSelected,comTextSelectedFocus,dropDownVisible,
dropdownHidden, dropDownBtnOut, dropDownBtnPressed,
Added nsHTMLAtoms::combobox, nsLayoutAtoms::popupList
Renamed dropDownList to dropDownListPseudo
Added "arrow.gif" as to be used the background-image for the combobox button
ua.css - added rules for select to differentiate between comboboxes and listboxes.
Added style rules to more closely match the XPTOOLKIT XPWidgets look.
removed the following :-moz-combobox-text, -moz-combobox-textselected
nsIFormControlFrame.h - Added SetSuggestedSize method.
nsButtonControlFrame - Implemented SetSuggestedSize.
nsCSSFrameConstructor.cpp - Rewrote ConstructSelectFrame.
nsIWidget.h -Added GetAbsoluteBounds method.
nsWindow.cpp - Implemented GetAbsoluteBounds.
1999-07-14 22:00:24 +00:00
|
|
|
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
protected:
|
1999-09-13 20:40:59 +00:00
|
|
|
virtual PRBool IsReset(PRInt32 type);
|
2001-09-19 13:00:23 +00:00
|
|
|
virtual PRBool IsSubmit(PRInt32 type);
|
2003-02-22 19:48:29 +00:00
|
|
|
void ReflowButtonContents(nsIPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsIFrame* aFirstKid,
|
|
|
|
const nsSize& aAvailSize,
|
|
|
|
nsReflowReason aReason,
|
|
|
|
nsMargin aFocusPadding,
|
|
|
|
nsReflowStatus& aStatus);
|
1999-08-31 13:05:31 +00:00
|
|
|
NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aSuggestedReflowState);
|
1999-04-21 22:46:15 +00:00
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release(void);
|
1999-10-26 04:44:41 +00:00
|
|
|
void GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect);
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
PRIntn GetSkipSides() const;
|
|
|
|
PRBool mInline;
|
|
|
|
nsCursor mPreviousCursor;
|
|
|
|
nsRect mTranslatedRect;
|
|
|
|
PRBool mDidInit;
|
|
|
|
nsButtonFrameRenderer mRenderer;
|
2000-01-08 15:53:48 +00:00
|
|
|
|
|
|
|
//Resize Reflow OpitmizationSize;
|
|
|
|
nsSize mCacheSize;
|
2002-11-12 19:17:51 +00:00
|
|
|
nscoord mCachedAscent;
|
2003-01-09 14:26:32 +00:00
|
|
|
nscoord mCachedMaxElementWidth;
|
1999-04-21 22:46:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|