layout/forms/nsIListControlFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/nsIListControlFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,98 @@
     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 nsIListControlFrame_h___
    1.10 +#define nsIListControlFrame_h___
    1.11 +
    1.12 +#include "nsQueryFrame.h"
    1.13 +
    1.14 +class nsAString;
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace dom {
    1.18 +class HTMLOptionElement;
    1.19 +} // namespace dom
    1.20 +} // namespace mozilla
    1.21 +
    1.22 +/** 
    1.23 +  * nsIListControlFrame is the interface for frame-based listboxes.
    1.24 +  */
    1.25 +class nsIListControlFrame : public nsQueryFrame
    1.26 +{
    1.27 +public:
    1.28 +  NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame)
    1.29 +
    1.30 +  /**
    1.31 +   * Sets the ComboBoxFrame
    1.32 +   *
    1.33 +   */
    1.34 +  virtual void SetComboboxFrame(nsIFrame* aComboboxFrame) = 0;
    1.35 +
    1.36 +  /**
    1.37 +   * Get the display string for an item
    1.38 +   */
    1.39 +  virtual void GetOptionText(uint32_t aIndex, nsAString& aStr) = 0;
    1.40 +
    1.41 +  /**
    1.42 +   * Get the Selected Item's index
    1.43 +   *
    1.44 +   */
    1.45 +  virtual int32_t GetSelectedIndex() = 0;
    1.46 +
    1.47 +  /**
    1.48 +   * Return current option. The current option is the option displaying
    1.49 +   * the focus ring when the listbox is focused.
    1.50 +   */
    1.51 +  virtual mozilla::dom::HTMLOptionElement* GetCurrentOption() = 0;
    1.52 +
    1.53 +  /**
    1.54 +   * Initiates mouse capture for the listbox
    1.55 +   *
    1.56 +   */
    1.57 +  virtual void CaptureMouseEvents(bool aGrabMouseEvents) = 0;
    1.58 +
    1.59 +  /**
    1.60 +   * Returns the height of a single row in the list.  This is the
    1.61 +   * maximum of the heights of all the options/optgroups.
    1.62 +   */
    1.63 +  virtual nscoord GetHeightOfARow() = 0;
    1.64 +
    1.65 +  /**
    1.66 +   * Returns the number of options in the listbox
    1.67 +   */
    1.68 +
    1.69 +  virtual uint32_t GetNumberOfOptions() = 0;
    1.70 +
    1.71 +  /**
    1.72 +   * Called by combobox when it's about to drop down
    1.73 +   */
    1.74 +  virtual void AboutToDropDown() = 0;
    1.75 +
    1.76 +  /**
    1.77 +   * Called by combobox when it's about to roll up
    1.78 +   */
    1.79 +  virtual void AboutToRollup() = 0;
    1.80 +
    1.81 +  /**
    1.82 +   * Fire on change (used by combobox)
    1.83 +   */
    1.84 +  virtual void FireOnChange() = 0;
    1.85 +
    1.86 +  /**
    1.87 +   * Tell the selected list to roll up and ensure that the proper index is
    1.88 +   * selected, possibly firing onChange if the index has changed
    1.89 +   *
    1.90 +   * @param aIndex the index to actually select
    1.91 +   */
    1.92 +  virtual void ComboboxFinish(int32_t aIndex) = 0;
    1.93 +
    1.94 +  /**
    1.95 +   * Notification that the content has been reset
    1.96 +   */
    1.97 +  virtual void OnContentReset() = 0;
    1.98 +};
    1.99 +
   1.100 +#endif
   1.101 +

mercurial