nsPrintObject.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 nsPrintObject_h___
  6. #define nsPrintObject_h___
  7. #include "mozilla/Attributes.h"
  8. // Interfaces
  9. #include "nsCOMPtr.h"
  10. #include "nsIPresShell.h"
  11. #include "nsViewManager.h"
  12. #include "nsIDocShell.h"
  13. #include "nsIDocShellTreeOwner.h"
  14. class nsIContent;
  15. class nsIDocument;
  16. class nsPresContext;
  17. // nsPrintObject Document Type
  18. enum PrintObjectType {eDoc = 0, eFrame = 1, eIFrame = 2, eFrameSet = 3};
  19. //---------------------------------------------------
  20. //-- nsPrintObject Class
  21. //---------------------------------------------------
  22. class nsPrintObject
  23. {
  24. public:
  25. nsPrintObject();
  26. ~nsPrintObject(); // non-virtual
  27. // Methods
  28. nsresult Init(nsIDocShell* aDocShell, nsIDOMDocument* aDoc,
  29. bool aPrintPreview);
  30. bool IsPrintable() { return !mDontPrint; }
  31. void DestroyPresentation();
  32. // Data Members
  33. nsCOMPtr<nsIDocShell> mDocShell;
  34. nsCOMPtr<nsIDocShellTreeOwner> mTreeOwner;
  35. nsCOMPtr<nsIDocument> mDocument;
  36. RefPtr<nsPresContext> mPresContext;
  37. nsCOMPtr<nsIPresShell> mPresShell;
  38. RefPtr<nsViewManager> mViewManager;
  39. nsCOMPtr<nsIContent> mContent;
  40. PrintObjectType mFrameType;
  41. nsTArray<nsPrintObject*> mKids;
  42. nsPrintObject* mParent;
  43. bool mHasBeenPrinted;
  44. bool mDontPrint;
  45. bool mPrintAsIs;
  46. bool mInvisible; // Indicates PO is set to not visible by CSS
  47. bool mPrintPreview;
  48. bool mDidCreateDocShell;
  49. float mShrinkRatio;
  50. float mZoomRatio;
  51. private:
  52. nsPrintObject& operator=(const nsPrintObject& aOther) = delete;
  53. };
  54. #endif /* nsPrintObject_h___ */