widget/nsIRollupListener.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIRollupListener.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef __nsIRollupListener_h__
    1.11 +#define __nsIRollupListener_h__
    1.12 +
    1.13 +#include "nsTArray.h"
    1.14 +
    1.15 +class nsIContent;
    1.16 +class nsIWidget;
    1.17 +class nsIntPoint;
    1.18 +
    1.19 +class nsIRollupListener {
    1.20 + public: 
    1.21 +
    1.22 +  /**
    1.23 +   * Notifies the object to rollup, optionally returning the node that
    1.24 +   * was just rolled up.
    1.25 +   *
    1.26 +   * aPoint is the mouse pointer position where the event that triggered the
    1.27 +   * rollup occurred, which may be nullptr.
    1.28 +   *
    1.29 +   * aCount is the number of popups in a chain to close. If this is
    1.30 +   * UINT32_MAX, then all popups are closed.
    1.31 +   * If aLastRolledUp is non-null, it will be set to the last rolled up popup,
    1.32 +   * if this is supported. aLastRolledUp is not addrefed.
    1.33 +   *
    1.34 +   * Returns true if the event that the caller is processing should be consumed.
    1.35 +   */
    1.36 +  virtual bool Rollup(uint32_t aCount, const nsIntPoint* aPoint, nsIContent** aLastRolledUp) = 0;
    1.37 +
    1.38 +  /**
    1.39 +   * Asks the RollupListener if it should rollup on mouse wheel events
    1.40 +   */
    1.41 +  virtual bool ShouldRollupOnMouseWheelEvent() = 0;
    1.42 +
    1.43 +  /**
    1.44 +   * Asks the RollupListener if it should consume mouse wheel events
    1.45 +   */
    1.46 +  virtual bool ShouldConsumeOnMouseWheelEvent() = 0;
    1.47 +
    1.48 +  /**
    1.49 +   * Asks the RollupListener if it should rollup on mouse activate, eg. X-Mouse
    1.50 +   */
    1.51 +  virtual bool ShouldRollupOnMouseActivate() = 0;
    1.52 +
    1.53 +  /*
    1.54 +   * Retrieve the widgets for open menus and store them in the array
    1.55 +   * aWidgetChain. The number of menus of the same type should be returned,
    1.56 +   * for example, if a context menu is open, return only the number of menus
    1.57 +   * that are part of the context menu chain. This allows closing up only
    1.58 +   * those menus in different situations. The returned value should be exactly
    1.59 +   * the same number of widgets added to aWidgetChain.
    1.60 +   */
    1.61 +  virtual uint32_t GetSubmenuWidgetChain(nsTArray<nsIWidget*> *aWidgetChain) = 0;
    1.62 +
    1.63 +  /**
    1.64 +   * Notify the RollupListener that the widget did a Move or Resize.
    1.65 +   */
    1.66 +  virtual void NotifyGeometryChange() = 0;
    1.67 +
    1.68 +  virtual nsIWidget* GetRollupWidget() = 0;
    1.69 +};
    1.70 +
    1.71 +#endif /* __nsIRollupListener_h__ */

mercurial