Line data Source code
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___
7 :
8 : #include "nsISupports.h"
9 :
10 : class nsIDocument;
11 : namespace mozilla {
12 : class StyleSetHandle;
13 : } // namespace mozilla
14 : class nsIPresShell;
15 : class nsPresContext;
16 : class nsViewManager;
17 :
18 : // {c6f255cf-cadd-4382-b57f-cd2a9874169b}
19 : #define NS_IDOCUMENT_VIEWER_PRINT_IID \
20 : { 0xc6f255cf, 0xcadd, 0x4382, \
21 : { 0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b } }
22 :
23 : /**
24 : * A DocumentViewerPrint is an INTERNAL Interface used for interaction
25 : * between the DocumentViewer and the PrintEngine
26 : */
27 29 : class nsIDocumentViewerPrint : public nsISupports
28 : {
29 : public:
30 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_VIEWER_PRINT_IID)
31 :
32 : virtual void SetIsPrinting(bool aIsPrinting) = 0;
33 : virtual bool GetIsPrinting() = 0;
34 :
35 : virtual void SetIsPrintPreview(bool aIsPrintPreview) = 0;
36 : virtual bool GetIsPrintPreview() = 0;
37 :
38 : // The style set returned by CreateStyleSet is in the middle of an
39 : // update batch so that the caller can add sheets to it if needed.
40 : // Callers should call EndUpdate() on it when ready to use.
41 : virtual mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) = 0;
42 :
43 : virtual void IncrementDestroyRefCount() = 0;
44 :
45 : virtual void ReturnToGalleyPresentation() = 0;
46 :
47 : virtual void OnDonePrinting() = 0;
48 :
49 : /**
50 : * Returns true is InitializeForPrintPreview() has been called.
51 : */
52 : virtual bool IsInitializedForPrintPreview() = 0;
53 :
54 : /**
55 : * Marks this viewer to be used for print preview.
56 : */
57 : virtual void InitializeForPrintPreview() = 0;
58 :
59 : /**
60 : * Replaces the current presentation with print preview presentation.
61 : */
62 : virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager,
63 : nsPresContext* aPresContext,
64 : nsIPresShell* aPresShell) = 0;
65 : };
66 :
67 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint,
68 : NS_IDOCUMENT_VIEWER_PRINT_IID)
69 :
70 : /* Use this macro when declaring classes that implement this interface. */
71 : #define NS_DECL_NSIDOCUMENTVIEWERPRINT \
72 : void SetIsPrinting(bool aIsPrinting) override; \
73 : bool GetIsPrinting() override; \
74 : void SetIsPrintPreview(bool aIsPrintPreview) override; \
75 : bool GetIsPrintPreview() override; \
76 : mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) override; \
77 : void IncrementDestroyRefCount() override; \
78 : void ReturnToGalleyPresentation() override; \
79 : void OnDonePrinting() override; \
80 : bool IsInitializedForPrintPreview() override; \
81 : void InitializeForPrintPreview() override; \
82 : void SetPrintPreviewPresentation(nsViewManager* aViewManager, \
83 : nsPresContext* aPresContext, \
84 : nsIPresShell* aPresShell) override;
85 :
86 : #endif /* nsIDocumentViewerPrint_h___ */
|