Backout a74bd5095902, Bug 959405 - Please update the Buri Moz-central, 1.3, 1.2 with...
[gecko.git] / layout / forms / nsIListControlFrame.h
blob46d3db2826ba4e710a59baa802646acb26fe481b
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"
10 #include "nsFont.h"
12 class nsAString;
13 class nsIContent;
15 namespace mozilla {
16 namespace dom {
17 class HTMLOptionElement;
18 } // namespace dom
19 } // namespace mozilla
21 /**
22 * nsIListControlFrame is the interface for frame-based listboxes.
24 class nsIListControlFrame : public nsQueryFrame
26 public:
27 NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame)
29 /**
30 * Sets the ComboBoxFrame
33 virtual void SetComboboxFrame(nsIFrame* aComboboxFrame) = 0;
35 /**
36 * Get the display string for an item
38 virtual void GetOptionText(uint32_t aIndex, nsAString& aStr) = 0;
40 /**
41 * Get the Selected Item's index
44 virtual int32_t GetSelectedIndex() = 0;
46 /**
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;
52 /**
53 * Initiates mouse capture for the listbox
56 virtual void CaptureMouseEvents(bool aGrabMouseEvents) = 0;
58 /**
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;
64 /**
65 * Returns the number of options in the listbox
68 virtual uint32_t GetNumberOfOptions() = 0;
70 /**
71 * Called by combobox when it's about to drop down
73 virtual void AboutToDropDown() = 0;
75 /**
76 * Called by combobox when it's about to roll up
78 virtual void AboutToRollup() = 0;
80 /**
81 * Fire on change (used by combobox)
83 virtual void FireOnChange() = 0;
85 /**
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;
93 /**
94 * Notification that the content has been reset
96 virtual void OnContentReset() = 0;
99 #endif