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-22 15:41:28 +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-22 15:41:28 +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-22 15:41:28 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org 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-22 15:41:28 +00:00
|
|
|
|
|
|
|
#ifndef nsIListControlFrame_h___
|
|
|
|
#define nsIListControlFrame_h___
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsFont.h"
|
2004-07-31 23:15:21 +00:00
|
|
|
class nsPresContext;
|
2001-11-02 07:40:01 +00:00
|
|
|
class nsAString;
|
1999-01-22 15:41:28 +00:00
|
|
|
class nsIContent;
|
|
|
|
|
|
|
|
// IID for the nsIListControlFrame class
|
|
|
|
#define NS_ILISTCONTROLFRAME_IID \
|
2005-12-12 23:53:06 +00:00
|
|
|
{ 0xa28ca6f, 0x6850, 0x11da, \
|
|
|
|
{ 0x95, 0x2c, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } }
|
1999-01-22 15:41:28 +00:00
|
|
|
|
|
|
|
/**
|
1999-04-16 19:28:12 +00:00
|
|
|
* nsIListControlFrame is the interface for frame-based listboxes.
|
1999-01-22 15:41:28 +00:00
|
|
|
*/
|
|
|
|
class nsIListControlFrame : public nsISupports {
|
|
|
|
|
|
|
|
public:
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILISTCONTROLFRAME_IID)
|
1999-01-22 15:41:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the ComboBoxFrame
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
NS_IMETHOD SetComboboxFrame(nsIFrame* aComboboxFrame) = 0;
|
|
|
|
|
|
|
|
/**
|
2001-11-02 07:40:01 +00:00
|
|
|
* Get the display string for an item
|
1999-01-22 15:41:28 +00:00
|
|
|
*/
|
2001-11-02 07:40:01 +00:00
|
|
|
NS_IMETHOD GetOptionText(PRInt32 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetSelectedIndex(PRInt32* aIndex) = 0;
|
|
|
|
|
1999-04-16 19:28:12 +00:00
|
|
|
/**
|
|
|
|
* Initiates mouse capture for the listbox
|
|
|
|
*
|
|
|
|
*/
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD CaptureMouseEvents(nsPresContext* aPresContext, PRBool 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
|
|
|
/**
|
|
|
|
* Returns the maximum width and height of an item in the listbox
|
|
|
|
*/
|
|
|
|
|
|
|
|
NS_IMETHOD GetMaximumSize(nsSize &aSize) = 0;
|
|
|
|
|
1999-07-20 22:32:41 +00:00
|
|
|
/**
|
|
|
|
* Returns the number of options in the listbox
|
|
|
|
*/
|
|
|
|
|
|
|
|
NS_IMETHOD GetNumberOfOptions(PRInt32* aNumOptions) = 0;
|
|
|
|
|
1999-08-31 13:22:45 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2004-12-27 15:05:18 +00:00
|
|
|
NS_IMETHOD SyncViewWithFrame() = 0;
|
1999-04-16 19:28:12 +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
|
|
|
*/
|
|
|
|
NS_IMETHOD AboutToDropDown() = 0;
|
|
|
|
|
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
|
|
|
*/
|
|
|
|
NS_IMETHOD AboutToRollup() = 0;
|
|
|
|
|
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
|
|
|
*/
|
2002-02-08 18:35:48 +00:00
|
|
|
NS_IMETHOD FireOnChange() = 0;
|
2000-02-15 15:57:13 +00:00
|
|
|
|
2000-03-03 04:28:59 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) = 0;
|
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
NS_IMETHOD ComboboxFinish(PRInt32 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
|
|
|
};
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIListControlFrame, NS_ILISTCONTROLFRAME_IID)
|
|
|
|
|
1999-01-22 15:41:28 +00:00
|
|
|
#endif
|
|
|
|
|