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"
16 * nsIListControlFrame is the interface for frame-based listboxes.
18 class nsIListControlFrame
: public nsQueryFrame
21 NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame
)
24 * Sets the ComboBoxFrame
27 virtual void SetComboboxFrame(nsIFrame
* aComboboxFrame
) = 0;
30 * Get the display string for an item
32 virtual void GetOptionText(int32_t aIndex
, nsAString
& aStr
) = 0;
35 * Get the Selected Item's index
38 virtual int32_t GetSelectedIndex() = 0;
41 * Return current option. The current option is the option displaying
42 * the focus ring when the listbox is focused.
44 virtual already_AddRefed
<nsIContent
> GetCurrentOption() = 0;
47 * Initiates mouse capture for the listbox
50 virtual void CaptureMouseEvents(bool aGrabMouseEvents
) = 0;
53 * Returns the height of a single row in the list. This is the
54 * maximum of the heights of all the options/optgroups.
56 virtual nscoord
GetHeightOfARow() = 0;
59 * Returns the number of options in the listbox
62 virtual uint32_t GetNumberOfOptions() = 0;
65 * Called by combobox when it's about to drop down
67 virtual void AboutToDropDown() = 0;
70 * Called by combobox when it's about to roll up
72 virtual void AboutToRollup() = 0;
75 * Fire on change (used by combobox)
77 virtual void FireOnChange() = 0;
80 * Tell the selected list to roll up and ensure that the proper index is
81 * selected, possibly firing onChange if the index has changed
83 * @param aIndex the index to actually select
85 virtual void ComboboxFinish(int32_t aIndex
) = 0;
88 * Notification that the content has been reset
90 virtual void OnContentReset() = 0;