layout/forms/nsIComboboxControlFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/nsIComboboxControlFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,81 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsIComboboxControlFrame_h___
    1.10 +#define nsIComboboxControlFrame_h___
    1.11 +
    1.12 +#include "nsQueryFrame.h"
    1.13 +
    1.14 +/** 
    1.15 +  * nsIComboboxControlFrame is the interface for comboboxes.
    1.16 +  */
    1.17 +class nsIComboboxControlFrame : public nsQueryFrame
    1.18 +{
    1.19 +public:
    1.20 +  NS_DECL_QUERYFRAME_TARGET(nsIComboboxControlFrame)
    1.21 +
    1.22 +  /**
    1.23 +   * Indicates whether the list is dropped down
    1.24 +   */
    1.25 +  virtual bool IsDroppedDown() = 0;
    1.26 +
    1.27 +  /**
    1.28 +   * Shows or hides the drop down
    1.29 +   */
    1.30 +  virtual void ShowDropDown(bool aDoDropDown) = 0;
    1.31 +
    1.32 +  /**
    1.33 +   * Gets the Drop Down List
    1.34 +   */
    1.35 +  virtual nsIFrame* GetDropDown() = 0;
    1.36 +
    1.37 +  /**
    1.38 +   * Sets the Drop Down List
    1.39 +   */
    1.40 +  virtual void SetDropDown(nsIFrame* aDropDownFrame) = 0;
    1.41 +
    1.42 +  /**
    1.43 +   * Tells the combobox to roll up
    1.44 +   */
    1.45 +  virtual void RollupFromList() = 0;
    1.46 +
    1.47 +  /**
    1.48 +   * Redisplay the selected text (will do nothing if text has not changed).
    1.49 +   * This method might destroy this frame or any others that happen to be
    1.50 +   * around.  It might even run script.
    1.51 +   */
    1.52 +  NS_IMETHOD RedisplaySelectedText() = 0;
    1.53 +
    1.54 +  /**
    1.55 +   * Method for the listbox to set and get the recent index
    1.56 +   */
    1.57 +  virtual int32_t UpdateRecentIndex(int32_t aIndex) = 0;
    1.58 +
    1.59 +  /**
    1.60 +   * Notification that the content has been reset
    1.61 +   */
    1.62 +  virtual void OnContentReset() = 0;
    1.63 +  
    1.64 +  /**
    1.65 +   * This returns the index of the item that is currently being displayed
    1.66 +   * in the display area. It may differ from what the currently Selected index
    1.67 +   * is in in the dropdown.
    1.68 +   *
    1.69 +   * Detailed explanation: 
    1.70 +   * When the dropdown is dropped down via a mouse click and the user moves the mouse 
    1.71 +   * up and down without clicking, the currently selected item is being tracking inside 
    1.72 +   * the dropdown, but the combobox is not being updated. When the user selects items
    1.73 +   * with the arrow keys, the combobox is being updated. So when the user clicks outside
    1.74 +   * the dropdown and it needs to roll up it has to decide whether to keep the current 
    1.75 +   * selection or not. This method is used to get the current index in the combobox to
    1.76 +   * compare it to the current index in the dropdown to see if the combox has been updated
    1.77 +   * and that way it knows whether to "cancel" the current selection residing in the 
    1.78 +   * dropdown. Or whether to leave the selection alone.
    1.79 +   */
    1.80 +  virtual int32_t GetIndexOfDisplayArea() = 0;
    1.81 +};
    1.82 +
    1.83 +#endif
    1.84 +

mercurial