2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 14:30:37 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-01-18 15:14:00 +00:00
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The contents of this file are subject to the Mozilla 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/MPL/
|
1999-01-18 15:14:00 +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-01-18 15:14:00 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-28 20:14:13 +00:00
|
|
|
* 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
|
2004-04-18 14:30:37 +00:00
|
|
|
* either of 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"),
|
2001-09-28 20:14:13 +00:00
|
|
|
* 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
|
2004-04-18 14:30:37 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-28 20:14:13 +00:00
|
|
|
* 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
|
2004-04-18 14:30:37 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-01-18 15:14:00 +00:00
|
|
|
#ifndef nsListControlFrame_h___
|
|
|
|
#define nsListControlFrame_h___
|
|
|
|
|
2000-03-03 04:28:59 +00:00
|
|
|
#ifdef DEBUG_evaughan
|
|
|
|
//#define DEBUG_rods
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG_rods
|
2001-02-23 01:45:45 +00:00
|
|
|
//#define DO_REFLOW_DEBUG
|
|
|
|
//#define DO_REFLOW_COUNTER
|
2000-03-03 04:28:59 +00:00
|
|
|
//#define DO_UNCONSTRAINED_CHECK
|
|
|
|
//#define DO_PIXELS
|
|
|
|
#endif
|
|
|
|
|
2003-04-08 20:50:57 +00:00
|
|
|
#include "nsGfxScrollFrame.h"
|
1999-01-18 15:14:00 +00:00
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsIListControlFrame.h"
|
1999-08-26 14:54:07 +00:00
|
|
|
#include "nsISelectControlFrame.h"
|
2004-01-09 22:18:26 +00:00
|
|
|
#include "nsIDOMEventListener.h"
|
2000-01-14 09:28:54 +00:00
|
|
|
#include "nsIPresState.h"
|
2000-08-14 14:42:12 +00:00
|
|
|
#include "nsIContent.h"
|
2004-01-09 22:18:26 +00:00
|
|
|
#include "nsAutoPtr.h"
|
1999-01-18 15:14:00 +00:00
|
|
|
|
|
|
|
class nsIDOMHTMLSelectElement;
|
2003-03-14 07:00:53 +00:00
|
|
|
class nsIDOMHTMLOptionsCollection;
|
1999-01-18 15:14:00 +00:00
|
|
|
class nsIDOMHTMLOptionElement;
|
|
|
|
class nsIComboboxControlFrame;
|
1999-06-21 20:41:56 +00:00
|
|
|
class nsIViewManager;
|
2004-07-31 23:15:21 +00:00
|
|
|
class nsPresContext;
|
2000-02-15 15:04:38 +00:00
|
|
|
class nsVoidArray;
|
2000-03-15 15:55:30 +00:00
|
|
|
class nsIScrollableView;
|
1999-01-18 15:14:00 +00:00
|
|
|
|
2001-06-08 02:34:09 +00:00
|
|
|
class nsVoidArray;
|
2004-01-09 22:18:26 +00:00
|
|
|
class nsListEventListener;
|
2000-08-14 14:42:12 +00:00
|
|
|
|
1999-01-18 15:14:00 +00:00
|
|
|
/**
|
1999-05-27 21:17:10 +00:00
|
|
|
* Frame-based listbox.
|
1999-01-18 15:14:00 +00:00
|
|
|
*/
|
1999-05-27 21:17:10 +00:00
|
|
|
|
2004-06-18 02:08:19 +00:00
|
|
|
class nsListControlFrame : public nsHTMLScrollFrame,
|
1999-03-22 21:32:12 +00:00
|
|
|
public nsIFormControlFrame,
|
1999-08-26 14:54:07 +00:00
|
|
|
public nsIListControlFrame,
|
2000-06-15 00:35:46 +00:00
|
|
|
public nsISelectControlFrame
|
1999-01-18 15:14:00 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-12-04 23:49:50 +00:00
|
|
|
friend nsresult NS_NewListControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
|
|
|
// nsISupports
|
1999-08-31 13:22:50 +00:00
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
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
|
|
|
// nsIFrame
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
|
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
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 06:03:41 +00:00
|
|
|
nsEventStatus* aEventStatus);
|
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
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
|
1999-01-18 15:14:00 +00:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
1999-04-12 22:14:31 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aCX,
|
1999-01-18 15:14:00 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Init(nsPresContext* aPresContext,
|
1999-01-18 15:14:00 +00:00
|
|
|
nsIContent* aContent,
|
1999-01-22 15:32:57 +00:00
|
|
|
nsIFrame* aParent,
|
2003-02-22 00:32:13 +00:00
|
|
|
nsStyleContext* aContext,
|
1999-02-25 03:27:57 +00:00
|
|
|
nsIFrame* aPrevInFlow);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD DidReflow(nsPresContext* aPresContext,
|
2001-12-07 14:51:12 +00:00
|
|
|
const nsHTMLReflowState* aReflowState,
|
|
|
|
nsDidReflowStatus aStatus);
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Destroy(nsPresContext *aPresContext);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Paint(nsPresContext* aPresContext,
|
2001-01-27 14:09:34 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
2001-09-19 12:35:19 +00:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer,
|
|
|
|
PRUint32 aFlags = 0);
|
2001-01-27 14:09:34 +00:00
|
|
|
|
2004-07-18 12:02:53 +00:00
|
|
|
virtual nsIFrame* GetContentInsertionFrame();
|
|
|
|
|
2001-03-19 23:20:21 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsLayoutAtoms::scrollFrame
|
|
|
|
*/
|
2003-10-31 20:19:18 +00:00
|
|
|
virtual nsIAtom* GetType() const;
|
2001-03-19 23:20:21 +00:00
|
|
|
|
2001-10-25 01:08:40 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
// nsIFrameDebug
|
2001-11-14 01:33:42 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
2001-10-25 01:08:40 +00:00
|
|
|
#endif
|
|
|
|
|
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
|
|
|
// nsIFormControlFrame
|
2003-10-31 20:19:18 +00:00
|
|
|
NS_IMETHOD_(PRInt32) GetFormControlType() const;
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD GetName(nsAString* aName);
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD SetProperty(nsPresContext* aPresContext, nsIAtom* aName, const nsAString& aValue);
|
2002-03-23 22:26:36 +00:00
|
|
|
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 GetMultiple(PRBool* aResult, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
1999-01-18 15:14:00 +00:00
|
|
|
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD OnContentReset();
|
1999-01-18 15:14:00 +00:00
|
|
|
|
|
|
|
virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
|
2004-07-31 23:15:21 +00:00
|
|
|
virtual void ScrollIntoView(nsPresContext* aPresContext);
|
|
|
|
virtual void MouseClicked(nsPresContext* aPresContext);
|
|
|
|
virtual nscoord GetVerticalInsidePadding(nsPresContext* aPresContext,
|
1999-09-30 11:36:44 +00:00
|
|
|
float aPixToTwip,
|
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
|
|
|
nscoord aInnerHeight) const;
|
2004-07-31 23:15:21 +00:00
|
|
|
virtual nscoord GetHorizontalInsidePadding(nsPresContext* aPresContext,
|
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
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const;
|
|
|
|
|
2004-05-05 02:32:27 +00:00
|
|
|
virtual nsGfxScrollFrameInner::ScrollbarStyles GetScrollbarStyles() const;
|
2003-05-22 01:46:13 +00:00
|
|
|
|
2001-06-30 00:25:09 +00:00
|
|
|
// for accessibility purposes
|
2001-08-17 03:13:07 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-06-30 00:25:09 +00:00
|
|
|
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
2001-08-17 03:13:07 +00:00
|
|
|
#endif
|
2001-06-30 00:25:09 +00:00
|
|
|
|
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
|
|
|
// nsHTMLContainerFrame
|
|
|
|
virtual PRIntn GetSkipSides() const;
|
|
|
|
|
|
|
|
// nsIListControlFrame
|
1999-01-18 15:14:00 +00:00
|
|
|
NS_IMETHOD SetComboboxFrame(nsIFrame* aComboboxFrame);
|
1999-08-26 14:54:07 +00:00
|
|
|
NS_IMETHOD GetSelectedIndex(PRInt32* aIndex);
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD GetOptionText(PRInt32 aIndex, nsAString & aStr);
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD CaptureMouseEvents(nsPresContext* aPresContext, PRBool aGrabMouseEvents);
|
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 GetMaximumSize(nsSize &aSize);
|
|
|
|
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
1999-07-20 22:32:41 +00:00
|
|
|
NS_IMETHOD GetNumberOfOptions(PRInt32* aNumOptions);
|
2004-12-27 15:05:18 +00:00
|
|
|
NS_IMETHOD SyncViewWithFrame();
|
1999-09-08 14:27:38 +00:00
|
|
|
NS_IMETHOD AboutToDropDown();
|
1999-10-01 14:30:33 +00:00
|
|
|
NS_IMETHOD AboutToRollup();
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD UpdateSelection();
|
2000-03-03 04:28:59 +00:00
|
|
|
NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) { mOverrideReflowOpt = aValue; return NS_OK; }
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD GetOptionsContainer(nsPresContext* aPresContext, nsIFrame** aFrame);
|
2002-02-08 18:35:48 +00:00
|
|
|
NS_IMETHOD FireOnChange();
|
2002-02-20 05:59:46 +00:00
|
|
|
NS_IMETHOD ComboboxFinish(PRInt32 aIndex);
|
2000-03-03 04:28:59 +00:00
|
|
|
|
1999-08-26 14:54:07 +00:00
|
|
|
// nsISelectControlFrame
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD AddOption(nsPresContext* aPresContext, PRInt32 index);
|
|
|
|
NS_IMETHOD RemoveOption(nsPresContext* aPresContext, PRInt32 index);
|
1999-09-15 05:31:31 +00:00
|
|
|
NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
|
2002-03-31 10:14:01 +00:00
|
|
|
NS_IMETHOD DoneAddingChildren(PRBool aIsDone);
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD OnOptionSelected(nsPresContext* aPresContext,
|
2001-11-02 07:40:01 +00:00
|
|
|
PRInt32 aIndex,
|
|
|
|
PRBool aSelected);
|
2002-01-25 23:35:44 +00:00
|
|
|
NS_IMETHOD OnOptionTextChanged(nsIDOMHTMLOptionElement* option);
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD GetDummyFrame(nsIFrame** aFrame);
|
|
|
|
NS_IMETHOD SetDummyFrame(nsIFrame* aFrame);
|
1999-08-26 14:54:07 +00:00
|
|
|
|
2004-01-09 22:18:26 +00:00
|
|
|
// mouse event listeners
|
|
|
|
nsresult MouseDown(nsIDOMEvent* aMouseEvent);
|
|
|
|
nsresult MouseUp(nsIDOMEvent* aMouseEvent);
|
1999-08-26 14:54:07 +00:00
|
|
|
|
2004-01-09 22:18:26 +00:00
|
|
|
// mouse motion listeners
|
|
|
|
nsresult MouseMove(nsIDOMEvent* aMouseEvent);
|
|
|
|
nsresult DragMove(nsIDOMEvent* aMouseEvent);
|
1999-08-26 14:54:07 +00:00
|
|
|
|
2004-01-09 22:18:26 +00:00
|
|
|
// key listeners
|
|
|
|
nsresult KeyPress(nsIDOMEvent* aKeyEvent);
|
1999-08-26 14:54:07 +00:00
|
|
|
|
2001-11-02 07:40:01 +00:00
|
|
|
// Static Methods
|
1999-01-18 15:14:00 +00:00
|
|
|
static nsIDOMHTMLSelectElement* GetSelect(nsIContent * aContent);
|
2003-03-14 07:00:53 +00:00
|
|
|
static nsIDOMHTMLOptionsCollection* GetOptions(nsIContent * aContent, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
|
|
|
static nsIDOMHTMLOptionElement* GetOption(nsIDOMHTMLOptionsCollection* aOptions, PRInt32 aIndex);
|
|
|
|
static nsIContent* GetOptionAsContent(nsIDOMHTMLOptionsCollection* aCollection,PRInt32 aIndex);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
2002-11-07 10:25:03 +00:00
|
|
|
static void ComboboxFocusSet();
|
|
|
|
|
2001-11-02 07:40:01 +00:00
|
|
|
// Helper
|
2001-02-23 01:45:45 +00:00
|
|
|
void SetPassId(PRInt16 aId) { mPassId = aId; }
|
|
|
|
|
2002-04-11 00:53:20 +00:00
|
|
|
void PaintFocus(nsIRenderingContext& aRC, nsFramePaintLayer aWhichLayer);
|
|
|
|
|
2002-10-25 02:53:45 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
void FireMenuItemActiveEvent(); // Inform assistive tech what got focused
|
|
|
|
#endif
|
|
|
|
|
1999-06-21 20:41:56 +00:00
|
|
|
protected:
|
1999-11-11 22:13:33 +00:00
|
|
|
|
2003-07-09 06:36:33 +00:00
|
|
|
void DropDownToggleKey(nsIDOMEvent* aKeyEvent);
|
2001-11-02 07:40:01 +00:00
|
|
|
nsresult IsOptionDisabled(PRInt32 anIndex, PRBool &aIsDisabled);
|
1999-11-11 22:13:33 +00:00
|
|
|
nsresult ScrollToFrame(nsIContent * aOptElement);
|
2001-11-02 07:40:01 +00:00
|
|
|
nsresult ScrollToIndex(PRInt32 anIndex);
|
2000-01-11 20:36:37 +00:00
|
|
|
PRBool IsClickingInCombobox(nsIDOMEvent* aMouseEvent);
|
2001-11-02 07:40:01 +00:00
|
|
|
void AdjustIndexForDisabledOpt(PRInt32 aStartIndex, PRInt32 &anNewIndex,
|
2000-08-17 21:38:15 +00:00
|
|
|
PRInt32 aNumOptions, PRInt32 aDoAdjustInc, PRInt32 aDoAdjustIncNext);
|
2004-09-13 02:10:29 +00:00
|
|
|
virtual void ResetList(PRBool aAllowScrolling);
|
2001-06-08 02:34:09 +00:00
|
|
|
|
2003-04-08 20:50:57 +00:00
|
|
|
nsListControlFrame(nsIPresShell* aShell, nsIDocument* aDocument);
|
1999-01-18 15:14:00 +00:00
|
|
|
virtual ~nsListControlFrame();
|
|
|
|
|
2001-11-02 07:40:01 +00:00
|
|
|
// Utility methods
|
1999-07-20 22:32:41 +00:00
|
|
|
nsresult GetSizeAttribute(PRInt32 *aSize);
|
1999-08-26 14:54:07 +00:00
|
|
|
nsIContent* GetOptionFromContent(nsIContent *aContent);
|
2001-11-02 07:40:01 +00:00
|
|
|
nsresult GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent, PRInt32& aCurIndex);
|
1999-08-27 14:42:27 +00:00
|
|
|
nsIContent* GetOptionContent(PRInt32 aIndex);
|
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
|
|
|
PRBool IsContentSelected(nsIContent* aContent);
|
1999-08-27 14:42:27 +00:00
|
|
|
PRBool IsContentSelectedByIndex(PRInt32 aIndex);
|
2002-01-25 20:51:41 +00:00
|
|
|
PRBool IsOptionElement(nsIContent* aContent);
|
|
|
|
PRBool CheckIfAllFramesHere();
|
|
|
|
PRInt32 GetIndexFromContent(nsIContent *aContent);
|
|
|
|
PRBool IsLeftButton(nsIDOMEvent* aMouseEvent);
|
2002-01-25 19:08:03 +00:00
|
|
|
|
2002-01-25 23:35:44 +00:00
|
|
|
// Dropped down stuff
|
|
|
|
void SetComboboxItem(PRInt32 aIndex);
|
2003-05-22 01:46:13 +00:00
|
|
|
PRBool IsInDropDownMode() const;
|
2002-01-25 23:35:44 +00:00
|
|
|
|
|
|
|
// Selection
|
|
|
|
PRBool SetOptionsSelectedFromFrame(PRInt32 aStartIndex,
|
|
|
|
PRInt32 aEndIndex,
|
|
|
|
PRBool aValue,
|
|
|
|
PRBool aClearAll);
|
|
|
|
PRBool ToggleOptionSelectedFromFrame(PRInt32 aIndex);
|
2002-12-20 05:32:27 +00:00
|
|
|
PRBool SingleSelection(PRInt32 aClickedIndex, PRBool aDoToggle);
|
|
|
|
PRBool ExtendedSelection(PRInt32 aStartIndex, PRInt32 aEndIndex,
|
2002-01-25 23:35:44 +00:00
|
|
|
PRBool aClearAll);
|
2002-12-20 05:32:27 +00:00
|
|
|
PRBool PerformSelection(PRInt32 aClickedIndex, PRBool aIsShift,
|
2002-01-25 23:35:44 +00:00
|
|
|
PRBool aIsControl);
|
|
|
|
PRBool HandleListSelection(nsIDOMEvent * aDOMEvent, PRInt32 selectedIndex);
|
2002-12-20 05:32:27 +00:00
|
|
|
void InitSelectionRange(PRInt32 aClickedIndex);
|
2002-01-25 23:35:44 +00:00
|
|
|
|
1999-01-18 15:14:00 +00:00
|
|
|
// Data Members
|
2001-11-02 07:40:01 +00:00
|
|
|
PRInt32 mStartSelectionIndex;
|
|
|
|
PRInt32 mEndSelectionIndex;
|
|
|
|
|
1999-05-27 21:17:10 +00:00
|
|
|
nsIComboboxControlFrame *mComboboxFrame;
|
2004-12-16 06:40:04 +00:00
|
|
|
PRPackedBool mChangesSinceDragStart;
|
|
|
|
PRPackedBool mButtonDown;
|
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
|
|
|
nscoord mMaxWidth;
|
|
|
|
nscoord mMaxHeight;
|
2000-08-03 14:13:58 +00:00
|
|
|
PRInt32 mNumDisplayRows;
|
2000-02-15 15:04:38 +00:00
|
|
|
|
2004-12-16 06:40:04 +00:00
|
|
|
PRBool mIsAllContentHere;
|
2001-03-09 03:21:51 +00:00
|
|
|
PRPackedBool mIsAllFramesHere;
|
|
|
|
PRPackedBool mHasBeenInitialized;
|
2004-08-11 04:49:05 +00:00
|
|
|
PRPackedBool mNeedToReset;
|
2004-09-13 02:10:29 +00:00
|
|
|
PRPackedBool mPostChildrenLoadedReset;
|
2000-03-03 04:28:59 +00:00
|
|
|
|
2001-03-09 03:21:51 +00:00
|
|
|
PRPackedBool mOverrideReflowOpt;
|
1999-11-11 22:13:33 +00:00
|
|
|
|
2004-01-09 22:18:26 +00:00
|
|
|
nsRefPtr<nsListEventListener> mEventListener;
|
2000-08-14 14:42:12 +00:00
|
|
|
|
2001-02-23 01:45:45 +00:00
|
|
|
PRInt16 mPassId;
|
2003-01-09 14:26:32 +00:00
|
|
|
nscoord mCachedDesiredMEW;
|
2001-02-23 01:45:45 +00:00
|
|
|
|
2001-11-02 07:40:01 +00:00
|
|
|
nsIFrame* mDummyFrame;
|
|
|
|
|
2000-01-09 01:41:11 +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;
|
2000-03-03 04:28:59 +00:00
|
|
|
nsSize mCachedUnconstrainedSize;
|
|
|
|
nsSize mCachedAvailableSize;
|
|
|
|
|
2002-04-11 00:53:20 +00:00
|
|
|
static nsListControlFrame * mFocused;
|
|
|
|
|
2000-03-03 04:28:59 +00:00
|
|
|
#ifdef DO_REFLOW_COUNTER
|
|
|
|
PRInt32 mReflowId;
|
|
|
|
#endif
|
2000-01-09 01:41:11 +00:00
|
|
|
|
1999-08-31 13:22:50 +00:00
|
|
|
private:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
|
2002-09-20 02:12:12 +00:00
|
|
|
|
|
|
|
// for incremental typing navigation
|
|
|
|
static nsAString& GetIncrementalString ();
|
2002-11-07 10:25:03 +00:00
|
|
|
static DOMTimeStamp gLastKeyTime;
|
1999-01-18 15:14:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsListControlFrame_h___ */
|
|
|
|
|