layout/printing/nsPrintPreviewListener.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef nsPrintPreviewListener_h__
     8 #define nsPrintPreviewListener_h__
    10 // Interfaces needed to be included
    11 #include "nsIDOMEventListener.h"
    12 // Helper Classes
    13 #include "nsCOMPtr.h"
    14 #include "mozilla/Attributes.h"
    16 namespace mozilla {
    17 namespace dom {
    18 class EventTarget;
    19 }
    20 }
    22 //
    23 // class nsPrintPreviewListener
    24 //
    25 // The class that listens to the chrome events and tells the embedding
    26 // chrome to show context menus, as appropriate. Handles registering itself
    27 // with the DOM with AddChromeListeners() and removing itself with
    28 // RemoveChromeListeners().
    29 //
    30 class nsPrintPreviewListener MOZ_FINAL : public nsIDOMEventListener
    32 {
    33 public:
    34   NS_DECL_ISUPPORTS
    35   NS_DECL_NSIDOMEVENTLISTENER
    37   nsPrintPreviewListener(mozilla::dom::EventTarget* aTarget);
    38   ~nsPrintPreviewListener();
    40   // Add/remove the relevant listeners, based on what interfaces
    41   // the embedding chrome implements.
    42   nsresult AddListeners();
    43   nsresult RemoveListeners();
    45 private:
    47   nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;
    49 }; // class nsPrintPreviewListener
    53 #endif /* nsPrintPreviewListener_h__ */

mercurial