michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __nsIRollupListener_h__ michael@0: #define __nsIRollupListener_h__ michael@0: michael@0: #include "nsTArray.h" michael@0: michael@0: class nsIContent; michael@0: class nsIWidget; michael@0: class nsIntPoint; michael@0: michael@0: class nsIRollupListener { michael@0: public: michael@0: michael@0: /** michael@0: * Notifies the object to rollup, optionally returning the node that michael@0: * was just rolled up. michael@0: * michael@0: * aPoint is the mouse pointer position where the event that triggered the michael@0: * rollup occurred, which may be nullptr. michael@0: * michael@0: * aCount is the number of popups in a chain to close. If this is michael@0: * UINT32_MAX, then all popups are closed. michael@0: * If aLastRolledUp is non-null, it will be set to the last rolled up popup, michael@0: * if this is supported. aLastRolledUp is not addrefed. michael@0: * michael@0: * Returns true if the event that the caller is processing should be consumed. michael@0: */ michael@0: virtual bool Rollup(uint32_t aCount, const nsIntPoint* aPoint, nsIContent** aLastRolledUp) = 0; michael@0: michael@0: /** michael@0: * Asks the RollupListener if it should rollup on mouse wheel events michael@0: */ michael@0: virtual bool ShouldRollupOnMouseWheelEvent() = 0; michael@0: michael@0: /** michael@0: * Asks the RollupListener if it should consume mouse wheel events michael@0: */ michael@0: virtual bool ShouldConsumeOnMouseWheelEvent() = 0; michael@0: michael@0: /** michael@0: * Asks the RollupListener if it should rollup on mouse activate, eg. X-Mouse michael@0: */ michael@0: virtual bool ShouldRollupOnMouseActivate() = 0; michael@0: michael@0: /* michael@0: * Retrieve the widgets for open menus and store them in the array michael@0: * aWidgetChain. The number of menus of the same type should be returned, michael@0: * for example, if a context menu is open, return only the number of menus michael@0: * that are part of the context menu chain. This allows closing up only michael@0: * those menus in different situations. The returned value should be exactly michael@0: * the same number of widgets added to aWidgetChain. michael@0: */ michael@0: virtual uint32_t GetSubmenuWidgetChain(nsTArray *aWidgetChain) = 0; michael@0: michael@0: /** michael@0: * Notify the RollupListener that the widget did a Move or Resize. michael@0: */ michael@0: virtual void NotifyGeometryChange() = 0; michael@0: michael@0: virtual nsIWidget* GetRollupWidget() = 0; michael@0: }; michael@0: michael@0: #endif /* __nsIRollupListener_h__ */