layout/forms/nsIComboboxControlFrame.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsIComboboxControlFrame_h___
michael@0 7 #define nsIComboboxControlFrame_h___
michael@0 8
michael@0 9 #include "nsQueryFrame.h"
michael@0 10
michael@0 11 /**
michael@0 12 * nsIComboboxControlFrame is the interface for comboboxes.
michael@0 13 */
michael@0 14 class nsIComboboxControlFrame : public nsQueryFrame
michael@0 15 {
michael@0 16 public:
michael@0 17 NS_DECL_QUERYFRAME_TARGET(nsIComboboxControlFrame)
michael@0 18
michael@0 19 /**
michael@0 20 * Indicates whether the list is dropped down
michael@0 21 */
michael@0 22 virtual bool IsDroppedDown() = 0;
michael@0 23
michael@0 24 /**
michael@0 25 * Shows or hides the drop down
michael@0 26 */
michael@0 27 virtual void ShowDropDown(bool aDoDropDown) = 0;
michael@0 28
michael@0 29 /**
michael@0 30 * Gets the Drop Down List
michael@0 31 */
michael@0 32 virtual nsIFrame* GetDropDown() = 0;
michael@0 33
michael@0 34 /**
michael@0 35 * Sets the Drop Down List
michael@0 36 */
michael@0 37 virtual void SetDropDown(nsIFrame* aDropDownFrame) = 0;
michael@0 38
michael@0 39 /**
michael@0 40 * Tells the combobox to roll up
michael@0 41 */
michael@0 42 virtual void RollupFromList() = 0;
michael@0 43
michael@0 44 /**
michael@0 45 * Redisplay the selected text (will do nothing if text has not changed).
michael@0 46 * This method might destroy this frame or any others that happen to be
michael@0 47 * around. It might even run script.
michael@0 48 */
michael@0 49 NS_IMETHOD RedisplaySelectedText() = 0;
michael@0 50
michael@0 51 /**
michael@0 52 * Method for the listbox to set and get the recent index
michael@0 53 */
michael@0 54 virtual int32_t UpdateRecentIndex(int32_t aIndex) = 0;
michael@0 55
michael@0 56 /**
michael@0 57 * Notification that the content has been reset
michael@0 58 */
michael@0 59 virtual void OnContentReset() = 0;
michael@0 60
michael@0 61 /**
michael@0 62 * This returns the index of the item that is currently being displayed
michael@0 63 * in the display area. It may differ from what the currently Selected index
michael@0 64 * is in in the dropdown.
michael@0 65 *
michael@0 66 * Detailed explanation:
michael@0 67 * When the dropdown is dropped down via a mouse click and the user moves the mouse
michael@0 68 * up and down without clicking, the currently selected item is being tracking inside
michael@0 69 * the dropdown, but the combobox is not being updated. When the user selects items
michael@0 70 * with the arrow keys, the combobox is being updated. So when the user clicks outside
michael@0 71 * the dropdown and it needs to roll up it has to decide whether to keep the current
michael@0 72 * selection or not. This method is used to get the current index in the combobox to
michael@0 73 * compare it to the current index in the dropdown to see if the combox has been updated
michael@0 74 * and that way it knows whether to "cancel" the current selection residing in the
michael@0 75 * dropdown. Or whether to leave the selection alone.
michael@0 76 */
michael@0 77 virtual int32_t GetIndexOfDisplayArea() = 0;
michael@0 78 };
michael@0 79
michael@0 80 #endif
michael@0 81

mercurial