2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-01-22 15:41:28 +00:00
|
|
|
|
|
|
|
#ifndef nsIListControlFrame_h___
|
|
|
|
#define nsIListControlFrame_h___
|
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
#include "nsQueryFrame.h"
|
1999-01-22 15:41:28 +00:00
|
|
|
#include "nsFont.h"
|
2010-04-10 20:10:12 +00:00
|
|
|
|
2001-11-02 07:40:01 +00:00
|
|
|
class nsAString;
|
1999-01-22 15:41:28 +00:00
|
|
|
class nsIContent;
|
|
|
|
|
|
|
|
/**
|
1999-04-16 19:28:12 +00:00
|
|
|
* nsIListControlFrame is the interface for frame-based listboxes.
|
1999-01-22 15:41:28 +00:00
|
|
|
*/
|
2009-01-12 19:20:59 +00:00
|
|
|
class nsIListControlFrame : public nsQueryFrame
|
|
|
|
{
|
1999-01-22 15:41:28 +00:00
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame)
|
1999-01-22 15:41:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the ComboBoxFrame
|
|
|
|
*
|
|
|
|
*/
|
2006-03-01 01:00:29 +00:00
|
|
|
virtual void SetComboboxFrame(nsIFrame* aComboboxFrame) = 0;
|
1999-01-22 15:41:28 +00:00
|
|
|
|
|
|
|
/**
|
2001-11-02 07:40:01 +00:00
|
|
|
* Get the display string for an item
|
1999-01-22 15:41:28 +00:00
|
|
|
*/
|
2013-08-02 07:07:08 +00:00
|
|
|
virtual void GetOptionText(uint32_t aIndex, nsAString& aStr) = 0;
|
1999-01-22 15:41:28 +00:00
|
|
|
|
1999-08-19 14:26:38 +00:00
|
|
|
/**
|
|
|
|
* Get the Selected Item's index
|
|
|
|
*
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual int32_t GetSelectedIndex() = 0;
|
1999-08-19 14:26:38 +00:00
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
/**
|
|
|
|
* Return current option. The current option is the option displaying
|
|
|
|
* the focus ring when the listbox is focused.
|
|
|
|
*/
|
|
|
|
virtual already_AddRefed<nsIContent> GetCurrentOption() = 0;
|
|
|
|
|
1999-04-16 19:28:12 +00:00
|
|
|
/**
|
|
|
|
* Initiates mouse capture for the listbox
|
|
|
|
*
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual void CaptureMouseEvents(bool aGrabMouseEvents) = 0;
|
1999-04-16 19:28:12 +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
|
|
|
/**
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
* Returns the height of a single row in the list. This is the
|
|
|
|
* maximum of the heights of all the options/optgroups.
|
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
|
|
|
*/
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
virtual nscoord GetHeightOfARow() = 0;
|
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
|
|
|
|
1999-07-20 22:32:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the number of options in the listbox
|
|
|
|
*/
|
|
|
|
|
2012-10-10 05:00:05 +00:00
|
|
|
virtual uint32_t GetNumberOfOptions() = 0;
|
1999-07-20 22:32:41 +00:00
|
|
|
|
1999-09-08 14:27:38 +00:00
|
|
|
/**
|
2002-02-08 18:35:48 +00:00
|
|
|
* Called by combobox when it's about to drop down
|
1999-09-08 14:27:38 +00:00
|
|
|
*/
|
2006-03-01 01:00:29 +00:00
|
|
|
virtual void AboutToDropDown() = 0;
|
1999-09-08 14:27:38 +00:00
|
|
|
|
1999-10-01 14:30:33 +00:00
|
|
|
/**
|
2002-02-08 18:35:48 +00:00
|
|
|
* Called by combobox when it's about to roll up
|
1999-10-01 14:30:33 +00:00
|
|
|
*/
|
2006-03-01 01:00:29 +00:00
|
|
|
virtual void AboutToRollup() = 0;
|
1999-10-01 14:30:33 +00:00
|
|
|
|
1999-10-05 23:43:06 +00:00
|
|
|
/**
|
2002-02-08 18:35:48 +00:00
|
|
|
* Fire on change (used by combobox)
|
1999-10-05 23:43:06 +00:00
|
|
|
*/
|
2006-03-01 01:00:29 +00:00
|
|
|
virtual void FireOnChange() = 0;
|
2000-02-15 15:57:13 +00:00
|
|
|
|
2002-02-20 05:59:46 +00:00
|
|
|
/**
|
|
|
|
* Tell the selected list to roll up and ensure that the proper index is
|
|
|
|
* selected, possibly firing onChange if the index has changed
|
|
|
|
*
|
|
|
|
* @param aIndex the index to actually select
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual void ComboboxFinish(int32_t aIndex) = 0;
|
2005-12-12 23:53:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification that the content has been reset
|
|
|
|
*/
|
|
|
|
virtual void OnContentReset() = 0;
|
1999-01-22 15:41:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|