michael@0: /* -*- Mode: C++; tab-width: 4; 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 nsPrintPreviewListener_h__ michael@0: #define nsPrintPreviewListener_h__ michael@0: michael@0: // Interfaces needed to be included michael@0: #include "nsIDOMEventListener.h" michael@0: // Helper Classes michael@0: #include "nsCOMPtr.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: class EventTarget; michael@0: } michael@0: } michael@0: michael@0: // michael@0: // class nsPrintPreviewListener michael@0: // michael@0: // The class that listens to the chrome events and tells the embedding michael@0: // chrome to show context menus, as appropriate. Handles registering itself michael@0: // with the DOM with AddChromeListeners() and removing itself with michael@0: // RemoveChromeListeners(). michael@0: // michael@0: class nsPrintPreviewListener MOZ_FINAL : public nsIDOMEventListener michael@0: michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIDOMEVENTLISTENER michael@0: michael@0: nsPrintPreviewListener(mozilla::dom::EventTarget* aTarget); michael@0: ~nsPrintPreviewListener(); michael@0: michael@0: // Add/remove the relevant listeners, based on what interfaces michael@0: // the embedding chrome implements. michael@0: nsresult AddListeners(); michael@0: nsresult RemoveListeners(); michael@0: michael@0: private: michael@0: michael@0: nsCOMPtr mEventTarget; michael@0: michael@0: }; // class nsPrintPreviewListener michael@0: michael@0: michael@0: michael@0: #endif /* nsPrintPreviewListener_h__ */