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