layout/printing/nsPrintPreviewListener.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/printing/nsPrintPreviewListener.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; 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 nsPrintPreviewListener_h__
    1.11 +#define nsPrintPreviewListener_h__
    1.12 +
    1.13 +// Interfaces needed to be included
    1.14 +#include "nsIDOMEventListener.h"
    1.15 +// Helper Classes
    1.16 +#include "nsCOMPtr.h"
    1.17 +#include "mozilla/Attributes.h"
    1.18 +
    1.19 +namespace mozilla {
    1.20 +namespace dom {
    1.21 +class EventTarget;
    1.22 +}
    1.23 +}
    1.24 +
    1.25 +//
    1.26 +// class nsPrintPreviewListener
    1.27 +//
    1.28 +// The class that listens to the chrome events and tells the embedding
    1.29 +// chrome to show context menus, as appropriate. Handles registering itself
    1.30 +// with the DOM with AddChromeListeners() and removing itself with
    1.31 +// RemoveChromeListeners().
    1.32 +//
    1.33 +class nsPrintPreviewListener MOZ_FINAL : public nsIDOMEventListener
    1.34 +
    1.35 +{
    1.36 +public:
    1.37 +  NS_DECL_ISUPPORTS
    1.38 +  NS_DECL_NSIDOMEVENTLISTENER
    1.39 +
    1.40 +  nsPrintPreviewListener(mozilla::dom::EventTarget* aTarget);
    1.41 +  ~nsPrintPreviewListener();
    1.42 +
    1.43 +  // Add/remove the relevant listeners, based on what interfaces
    1.44 +  // the embedding chrome implements.
    1.45 +  nsresult AddListeners();
    1.46 +  nsresult RemoveListeners();
    1.47 +
    1.48 +private:
    1.49 +
    1.50 +  nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;
    1.51 +
    1.52 +}; // class nsPrintPreviewListener
    1.53 +
    1.54 +
    1.55 +
    1.56 +#endif /* nsPrintPreviewListener_h__ */

mercurial