1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsIListControlFrame_h___
7 #define nsIListControlFrame_h___
9 #include "nsQueryFrame.h"
17 class HTMLOptionElement
;
19 } // namespace mozilla
22 * nsIListControlFrame is the interface for frame-based listboxes.
24 class nsIListControlFrame
: public nsQueryFrame
27 NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame
)
30 * Sets the ComboBoxFrame
33 virtual void SetComboboxFrame(nsIFrame
* aComboboxFrame
) = 0;
36 * Get the display string for an item
38 virtual void GetOptionText(uint32_t aIndex
, nsAString
& aStr
) = 0;
41 * Get the Selected Item's index
44 virtual int32_t GetSelectedIndex() = 0;
47 * Return current option. The current option is the option displaying
48 * the focus ring when the listbox is focused.
50 virtual mozilla::dom::HTMLOptionElement
* GetCurrentOption() = 0;
53 * Initiates mouse capture for the listbox
56 virtual void CaptureMouseEvents(bool aGrabMouseEvents
) = 0;
59 * Returns the height of a single row in the list. This is the
60 * maximum of the heights of all the options/optgroups.
62 virtual nscoord
GetHeightOfARow() = 0;
65 * Returns the number of options in the listbox
68 virtual uint32_t GetNumberOfOptions() = 0;
71 * Called by combobox when it's about to drop down
73 virtual void AboutToDropDown() = 0;
76 * Called by combobox when it's about to roll up
78 virtual void AboutToRollup() = 0;
81 * Fire on change (used by combobox)
83 virtual void FireOnChange() = 0;
86 * Tell the selected list to roll up and ensure that the proper index is
87 * selected, possibly firing onChange if the index has changed
89 * @param aIndex the index to actually select
91 virtual void ComboboxFinish(int32_t aIndex
) = 0;
94 * Notification that the content has been reset
96 virtual void OnContentReset() = 0;