Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef __nsIRollupListener_h__ |
michael@0 | 8 | #define __nsIRollupListener_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "nsTArray.h" |
michael@0 | 11 | |
michael@0 | 12 | class nsIContent; |
michael@0 | 13 | class nsIWidget; |
michael@0 | 14 | class nsIntPoint; |
michael@0 | 15 | |
michael@0 | 16 | class nsIRollupListener { |
michael@0 | 17 | public: |
michael@0 | 18 | |
michael@0 | 19 | /** |
michael@0 | 20 | * Notifies the object to rollup, optionally returning the node that |
michael@0 | 21 | * was just rolled up. |
michael@0 | 22 | * |
michael@0 | 23 | * aPoint is the mouse pointer position where the event that triggered the |
michael@0 | 24 | * rollup occurred, which may be nullptr. |
michael@0 | 25 | * |
michael@0 | 26 | * aCount is the number of popups in a chain to close. If this is |
michael@0 | 27 | * UINT32_MAX, then all popups are closed. |
michael@0 | 28 | * If aLastRolledUp is non-null, it will be set to the last rolled up popup, |
michael@0 | 29 | * if this is supported. aLastRolledUp is not addrefed. |
michael@0 | 30 | * |
michael@0 | 31 | * Returns true if the event that the caller is processing should be consumed. |
michael@0 | 32 | */ |
michael@0 | 33 | virtual bool Rollup(uint32_t aCount, const nsIntPoint* aPoint, nsIContent** aLastRolledUp) = 0; |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | * Asks the RollupListener if it should rollup on mouse wheel events |
michael@0 | 37 | */ |
michael@0 | 38 | virtual bool ShouldRollupOnMouseWheelEvent() = 0; |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Asks the RollupListener if it should consume mouse wheel events |
michael@0 | 42 | */ |
michael@0 | 43 | virtual bool ShouldConsumeOnMouseWheelEvent() = 0; |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Asks the RollupListener if it should rollup on mouse activate, eg. X-Mouse |
michael@0 | 47 | */ |
michael@0 | 48 | virtual bool ShouldRollupOnMouseActivate() = 0; |
michael@0 | 49 | |
michael@0 | 50 | /* |
michael@0 | 51 | * Retrieve the widgets for open menus and store them in the array |
michael@0 | 52 | * aWidgetChain. The number of menus of the same type should be returned, |
michael@0 | 53 | * for example, if a context menu is open, return only the number of menus |
michael@0 | 54 | * that are part of the context menu chain. This allows closing up only |
michael@0 | 55 | * those menus in different situations. The returned value should be exactly |
michael@0 | 56 | * the same number of widgets added to aWidgetChain. |
michael@0 | 57 | */ |
michael@0 | 58 | virtual uint32_t GetSubmenuWidgetChain(nsTArray<nsIWidget*> *aWidgetChain) = 0; |
michael@0 | 59 | |
michael@0 | 60 | /** |
michael@0 | 61 | * Notify the RollupListener that the widget did a Move or Resize. |
michael@0 | 62 | */ |
michael@0 | 63 | virtual void NotifyGeometryChange() = 0; |
michael@0 | 64 | |
michael@0 | 65 | virtual nsIWidget* GetRollupWidget() = 0; |
michael@0 | 66 | }; |
michael@0 | 67 | |
michael@0 | 68 | #endif /* __nsIRollupListener_h__ */ |