Backed out changeset 8366e5cc9f57 (bug 125282) because of four windows unit test...
[mozilla-central.git] / layout / forms / nsIComboboxControlFrame.h
blob13c1daaf0d4fa3fb508ddc62c1c9a4d88a3c15b5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nsIComboboxControlFrame_h___
39 #define nsIComboboxControlFrame_h___
41 #include "nsQueryFrame.h"
42 #include "nsFont.h"
44 class nsPresContext;
45 class nsString;
46 class nsIContent;
47 class nsCSSFrameConstructor;
49 /**
50 * nsIComboboxControlFrame is the common interface for frames of form controls. It
51 * provides a uniform way of creating widgets, resizing, and painting.
52 * @see nsLeafFrame and its base classes for more info
54 class nsIComboboxControlFrame : public nsQueryFrame
56 public:
57 NS_DECLARE_FRAME_ACCESSOR(nsIComboboxControlFrame)
59 /**
60 * Indicates whether the list is dropped down
62 virtual PRBool IsDroppedDown() = 0;
64 /**
65 * Shows or hides the drop down
67 virtual void ShowDropDown(PRBool aDoDropDown) = 0;
69 /**
70 * Gets the Drop Down List
72 virtual nsIFrame* GetDropDown() = 0;
74 /**
75 * Sets the Drop Down List
77 virtual void SetDropDown(nsIFrame* aDropDownFrame) = 0;
79 /**
80 * Tells the combobox to roll up
82 virtual void RollupFromList() = 0;
84 /**
85 * Redisplay the selected text (will do nothing if text has not changed).
86 * This method might destroy this frame or any others that happen to be
87 * around. It might even run script.
89 NS_IMETHOD RedisplaySelectedText() = 0;
91 /**
92 * Method for the listbox to set and get the recent index
94 virtual PRInt32 UpdateRecentIndex(PRInt32 aIndex) = 0;
96 /**
99 virtual void AbsolutelyPositionDropDown() = 0;
102 * Notification that the content has been reset
104 virtual void OnContentReset() = 0;
107 * This returns the index of the item that is currently being displayed
108 * in the display area. It may differ from what the currently Selected index
109 * is in in the dropdown.
111 * Detailed explanation:
112 * When the dropdown is dropped down via a mouse click and the user moves the mouse
113 * up and down without clicking, the currently selected item is being tracking inside
114 * the dropdown, but the combobox is not being updated. When the user selects items
115 * with the arrow keys, the combobox is being updated. So when the user clicks outside
116 * the dropdown and it needs to roll up it has to decide whether to keep the current
117 * selection or not. This method is used to get the current index in the combobox to
118 * compare it to the current index in the dropdown to see if the combox has been updated
119 * and that way it knows whether to "cancel" the current selection residing in the
120 * dropdown. Or whether to leave the selection alone.
122 virtual PRInt32 GetIndexOfDisplayArea() = 0;
125 #endif