Blame layout/base/nsIDocumentViewerPrint.h

Packit f0b94e
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
Packit f0b94e
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
Packit f0b94e
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit f0b94e
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit f0b94e
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit f0b94e
#ifndef nsIDocumentViewerPrint_h___
Packit f0b94e
#define nsIDocumentViewerPrint_h___
Packit f0b94e
Packit f0b94e
#include "nsISupports.h"
Packit f0b94e
Packit f0b94e
class nsIDocument;
Packit f0b94e
namespace mozilla {
Packit f0b94e
class StyleSetHandle;
Packit f0b94e
}  // namespace mozilla
Packit f0b94e
class nsIPresShell;
Packit f0b94e
class nsPresContext;
Packit f0b94e
class nsViewManager;
Packit f0b94e
Packit f0b94e
// {c6f255cf-cadd-4382-b57f-cd2a9874169b}
Packit f0b94e
#define NS_IDOCUMENT_VIEWER_PRINT_IID                \
Packit f0b94e
  {                                                  \
Packit f0b94e
    0xc6f255cf, 0xcadd, 0x4382, {                    \
Packit f0b94e
      0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b \
Packit f0b94e
    }                                                \
Packit f0b94e
  }
Packit f0b94e
Packit f0b94e
/**
Packit f0b94e
 * A DocumentViewerPrint is an INTERNAL Interface used for interaction
Packit f0b94e
 * between the DocumentViewer and nsPrintJob.
Packit f0b94e
 */
Packit f0b94e
class nsIDocumentViewerPrint : public nsISupports {
Packit f0b94e
 public:
Packit f0b94e
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_VIEWER_PRINT_IID)
Packit f0b94e
Packit f0b94e
  virtual void SetIsPrinting(bool aIsPrinting) = 0;
Packit f0b94e
  virtual bool GetIsPrinting() = 0;
Packit f0b94e
Packit f0b94e
  virtual void SetIsPrintPreview(bool aIsPrintPreview) = 0;
Packit f0b94e
  virtual bool GetIsPrintPreview() = 0;
Packit f0b94e
Packit f0b94e
  // The style set returned by CreateStyleSet is in the middle of an
Packit f0b94e
  // update batch so that the caller can add sheets to it if needed.
Packit f0b94e
  // Callers should call EndUpdate() on it when ready to use.
Packit f0b94e
  virtual mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) = 0;
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * This is used by nsPagePrintTimer to make nsDocumentViewer::Destroy()
Packit f0b94e
   * a no-op until printing is finished.  That prevents the nsDocumentViewer
Packit f0b94e
   * and its document, presshell and prescontext from going away.
Packit f0b94e
   */
Packit f0b94e
  virtual void IncrementDestroyBlockedCount() = 0;
Packit f0b94e
  virtual void DecrementDestroyBlockedCount() = 0;
Packit f0b94e
Packit f0b94e
  virtual void OnDonePrinting() = 0;
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Returns true is InitializeForPrintPreview() has been called.
Packit f0b94e
   */
Packit f0b94e
  virtual bool IsInitializedForPrintPreview() = 0;
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Marks this viewer to be used for print preview.
Packit f0b94e
   */
Packit f0b94e
  virtual void InitializeForPrintPreview() = 0;
Packit f0b94e
Packit f0b94e
  /**
Packit f0b94e
   * Replaces the current presentation with print preview presentation.
Packit f0b94e
   */
Packit f0b94e
  virtual void SetPrintPreviewPresentation(nsViewManager* aViewManager,
Packit f0b94e
                                           nsPresContext* aPresContext,
Packit f0b94e
                                           nsIPresShell* aPresShell) = 0;
Packit f0b94e
};
Packit f0b94e
Packit f0b94e
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint,
Packit f0b94e
                              NS_IDOCUMENT_VIEWER_PRINT_IID)
Packit f0b94e
Packit f0b94e
/* Use this macro when declaring classes that implement this interface. */
Packit f0b94e
#define NS_DECL_NSIDOCUMENTVIEWERPRINT                                     \
Packit f0b94e
  void SetIsPrinting(bool aIsPrinting) override;                           \
Packit f0b94e
  bool GetIsPrinting() override;                                           \
Packit f0b94e
  void SetIsPrintPreview(bool aIsPrintPreview) override;                   \
Packit f0b94e
  bool GetIsPrintPreview() override;                                       \
Packit f0b94e
  mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) override; \
Packit f0b94e
  void IncrementDestroyBlockedCount() override;                            \
Packit f0b94e
  void DecrementDestroyBlockedCount() override;                            \
Packit f0b94e
  void OnDonePrinting() override;                                          \
Packit f0b94e
  bool IsInitializedForPrintPreview() override;                            \
Packit f0b94e
  void InitializeForPrintPreview() override;                               \
Packit f0b94e
  void SetPrintPreviewPresentation(nsViewManager* aViewManager,            \
Packit f0b94e
                                   nsPresContext* aPresContext,            \
Packit f0b94e
                                   nsIPresShell* aPresShell) override;
Packit f0b94e
Packit f0b94e
#endif /* nsIDocumentViewerPrint_h___ */