michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsIDocumentViewerPrint_h___ michael@0: #define nsIDocumentViewerPrint_h___ michael@0: michael@0: #include "nsISupports.h" michael@0: michael@0: class nsIDocument; michael@0: class nsStyleSet; michael@0: class nsIPresShell; michael@0: class nsPresContext; michael@0: class nsIWidget; michael@0: class nsViewManager; michael@0: michael@0: // {c6f255cf-cadd-4382-b57f-cd2a9874169b} michael@0: #define NS_IDOCUMENT_VIEWER_PRINT_IID \ michael@0: { 0xc6f255cf, 0xcadd, 0x4382, \ michael@0: { 0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b } } michael@0: michael@0: /** michael@0: * A DocumentViewerPrint is an INTERNAL Interface used for interaction michael@0: * between the DocumentViewer and the PrintEngine michael@0: */ michael@0: class nsIDocumentViewerPrint : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_VIEWER_PRINT_IID) michael@0: michael@0: virtual void SetIsPrinting(bool aIsPrinting) = 0; michael@0: virtual bool GetIsPrinting() = 0; michael@0: michael@0: virtual void SetIsPrintPreview(bool aIsPrintPreview) = 0; michael@0: virtual bool GetIsPrintPreview() = 0; michael@0: michael@0: // The style set returned by CreateStyleSet is in the middle of an michael@0: // update batch so that the caller can add sheets to it if needed. michael@0: // Callers should call EndUpdate() on it when ready to use. michael@0: virtual nsresult CreateStyleSet(nsIDocument* aDocument, nsStyleSet** aStyleSet) = 0; michael@0: michael@0: virtual void IncrementDestroyRefCount() = 0; michael@0: michael@0: virtual void ReturnToGalleyPresentation() = 0; michael@0: michael@0: virtual void OnDonePrinting() = 0; michael@0: michael@0: /** michael@0: * Returns true is InitializeForPrintPreview() has been called. michael@0: */ michael@0: virtual bool IsInitializedForPrintPreview() = 0; michael@0: michael@0: /** michael@0: * Marks this viewer to be used for print preview. michael@0: */ michael@0: virtual void InitializeForPrintPreview() = 0; michael@0: michael@0: /** michael@0: * Replaces the current presentation with print preview presentation. michael@0: */ michael@0: virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager, michael@0: nsPresContext* aPresContext, michael@0: nsIPresShell* aPresShell) = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint, michael@0: NS_IDOCUMENT_VIEWER_PRINT_IID) michael@0: michael@0: /* Use this macro when declaring classes that implement this interface. */ michael@0: #define NS_DECL_NSIDOCUMENTVIEWERPRINT \ michael@0: virtual void SetIsPrinting(bool aIsPrinting); \ michael@0: virtual bool GetIsPrinting(); \ michael@0: virtual void SetIsPrintPreview(bool aIsPrintPreview); \ michael@0: virtual bool GetIsPrintPreview(); \ michael@0: virtual nsresult CreateStyleSet(nsIDocument* aDocument, nsStyleSet** aStyleSet); \ michael@0: virtual void IncrementDestroyRefCount(); \ michael@0: virtual void ReturnToGalleyPresentation(); \ michael@0: virtual void OnDonePrinting(); \ michael@0: virtual bool IsInitializedForPrintPreview(); \ michael@0: virtual void InitializeForPrintPreview(); \ michael@0: virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager, \ michael@0: nsPresContext* aPresContext, \ michael@0: nsIPresShell* aPresShell); michael@0: michael@0: #endif /* nsIDocumentViewerPrint_h___ */