1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/nsIDocumentViewerPrint.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,85 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 +#ifndef nsIDocumentViewerPrint_h___ 1.9 +#define nsIDocumentViewerPrint_h___ 1.10 + 1.11 +#include "nsISupports.h" 1.12 + 1.13 +class nsIDocument; 1.14 +class nsStyleSet; 1.15 +class nsIPresShell; 1.16 +class nsPresContext; 1.17 +class nsIWidget; 1.18 +class nsViewManager; 1.19 + 1.20 +// {c6f255cf-cadd-4382-b57f-cd2a9874169b} 1.21 +#define NS_IDOCUMENT_VIEWER_PRINT_IID \ 1.22 +{ 0xc6f255cf, 0xcadd, 0x4382, \ 1.23 + { 0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b } } 1.24 + 1.25 +/** 1.26 + * A DocumentViewerPrint is an INTERNAL Interface used for interaction 1.27 + * between the DocumentViewer and the PrintEngine 1.28 + */ 1.29 +class nsIDocumentViewerPrint : public nsISupports 1.30 +{ 1.31 +public: 1.32 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_VIEWER_PRINT_IID) 1.33 + 1.34 + virtual void SetIsPrinting(bool aIsPrinting) = 0; 1.35 + virtual bool GetIsPrinting() = 0; 1.36 + 1.37 + virtual void SetIsPrintPreview(bool aIsPrintPreview) = 0; 1.38 + virtual bool GetIsPrintPreview() = 0; 1.39 + 1.40 + // The style set returned by CreateStyleSet is in the middle of an 1.41 + // update batch so that the caller can add sheets to it if needed. 1.42 + // Callers should call EndUpdate() on it when ready to use. 1.43 + virtual nsresult CreateStyleSet(nsIDocument* aDocument, nsStyleSet** aStyleSet) = 0; 1.44 + 1.45 + virtual void IncrementDestroyRefCount() = 0; 1.46 + 1.47 + virtual void ReturnToGalleyPresentation() = 0; 1.48 + 1.49 + virtual void OnDonePrinting() = 0; 1.50 + 1.51 + /** 1.52 + * Returns true is InitializeForPrintPreview() has been called. 1.53 + */ 1.54 + virtual bool IsInitializedForPrintPreview() = 0; 1.55 + 1.56 + /** 1.57 + * Marks this viewer to be used for print preview. 1.58 + */ 1.59 + virtual void InitializeForPrintPreview() = 0; 1.60 + 1.61 + /** 1.62 + * Replaces the current presentation with print preview presentation. 1.63 + */ 1.64 + virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager, 1.65 + nsPresContext* aPresContext, 1.66 + nsIPresShell* aPresShell) = 0; 1.67 +}; 1.68 + 1.69 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint, 1.70 + NS_IDOCUMENT_VIEWER_PRINT_IID) 1.71 + 1.72 +/* Use this macro when declaring classes that implement this interface. */ 1.73 +#define NS_DECL_NSIDOCUMENTVIEWERPRINT \ 1.74 + virtual void SetIsPrinting(bool aIsPrinting); \ 1.75 + virtual bool GetIsPrinting(); \ 1.76 + virtual void SetIsPrintPreview(bool aIsPrintPreview); \ 1.77 + virtual bool GetIsPrintPreview(); \ 1.78 + virtual nsresult CreateStyleSet(nsIDocument* aDocument, nsStyleSet** aStyleSet); \ 1.79 + virtual void IncrementDestroyRefCount(); \ 1.80 + virtual void ReturnToGalleyPresentation(); \ 1.81 + virtual void OnDonePrinting(); \ 1.82 + virtual bool IsInitializedForPrintPreview(); \ 1.83 + virtual void InitializeForPrintPreview(); \ 1.84 + virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager, \ 1.85 + nsPresContext* aPresContext, \ 1.86 + nsIPresShell* aPresShell); 1.87 + 1.88 +#endif /* nsIDocumentViewerPrint_h___ */