layout/base/nsIDocumentViewerPrint.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsIDocumentViewerPrint_h___
     6 #define nsIDocumentViewerPrint_h___
     8 #include "nsISupports.h"
    10 class nsIDocument;
    11 class nsStyleSet;
    12 class nsIPresShell;
    13 class nsPresContext;
    14 class nsIWidget;
    15 class nsViewManager;
    17 // {c6f255cf-cadd-4382-b57f-cd2a9874169b}
    18 #define NS_IDOCUMENT_VIEWER_PRINT_IID \
    19 { 0xc6f255cf, 0xcadd, 0x4382, \
    20   { 0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b } }
    22 /**
    23  * A DocumentViewerPrint is an INTERNAL Interface used for interaction
    24  * between the DocumentViewer and the PrintEngine
    25  */
    26 class nsIDocumentViewerPrint : public nsISupports
    27 {
    28 public:
    29   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_VIEWER_PRINT_IID)
    31   virtual void SetIsPrinting(bool aIsPrinting) = 0;
    32   virtual bool GetIsPrinting() = 0;
    34   virtual void SetIsPrintPreview(bool aIsPrintPreview) = 0;
    35   virtual bool GetIsPrintPreview() = 0;
    37   // The style set returned by CreateStyleSet is in the middle of an
    38   // update batch so that the caller can add sheets to it if needed.
    39   // Callers should call EndUpdate() on it when ready to use.
    40   virtual nsresult CreateStyleSet(nsIDocument* aDocument, nsStyleSet** aStyleSet) = 0;
    42   virtual void IncrementDestroyRefCount() = 0;
    44   virtual void ReturnToGalleyPresentation() = 0;
    46   virtual void OnDonePrinting() = 0;
    48   /**
    49    * Returns true is InitializeForPrintPreview() has been called.
    50    */
    51   virtual bool IsInitializedForPrintPreview() = 0;
    53   /**
    54    * Marks this viewer to be used for print preview.
    55    */
    56   virtual void InitializeForPrintPreview() = 0;
    58   /**
    59    * Replaces the current presentation with print preview presentation.
    60    */
    61   virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager,
    62                                            nsPresContext* aPresContext,
    63                                            nsIPresShell* aPresShell) = 0;
    64 };
    66 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint,
    67                               NS_IDOCUMENT_VIEWER_PRINT_IID)
    69 /* Use this macro when declaring classes that implement this interface. */
    70 #define NS_DECL_NSIDOCUMENTVIEWERPRINT \
    71   virtual void     SetIsPrinting(bool aIsPrinting); \
    72   virtual bool     GetIsPrinting(); \
    73   virtual void     SetIsPrintPreview(bool aIsPrintPreview); \
    74   virtual bool     GetIsPrintPreview(); \
    75   virtual nsresult CreateStyleSet(nsIDocument* aDocument, nsStyleSet** aStyleSet); \
    76   virtual void     IncrementDestroyRefCount(); \
    77   virtual void     ReturnToGalleyPresentation(); \
    78   virtual void     OnDonePrinting(); \
    79   virtual bool     IsInitializedForPrintPreview(); \
    80   virtual void     InitializeForPrintPreview(); \
    81   virtual void     SetPrintPreviewPresentation(nsViewManager* aViewManager, \
    82                                                nsPresContext* aPresContext, \
    83                                                nsIPresShell* aPresShell);
    85 #endif /* nsIDocumentViewerPrint_h___ */

mercurial