Bumping manifests a=b2g-bump
[gecko.git] / layout / base / nsIDocumentViewerPrint.h
blobe99d39198339c35b454183201968d978d4a1978d
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
26 class nsIDocumentViewerPrint : public nsISupports
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.
51 virtual bool IsInitializedForPrintPreview() = 0;
53 /**
54 * Marks this viewer to be used for print preview.
56 virtual void InitializeForPrintPreview() = 0;
58 /**
59 * Replaces the current presentation with print preview presentation.
61 virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager,
62 nsPresContext* aPresContext,
63 nsIPresShell* aPresShell) = 0;
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___ */