/src/mozilla-central/layout/printing/nsPrintObject.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | #ifndef nsPrintObject_h___ |
7 | | #define nsPrintObject_h___ |
8 | | |
9 | | #include "mozilla/Attributes.h" |
10 | | #include "mozilla/UniquePtr.h" |
11 | | |
12 | | // Interfaces |
13 | | #include "nsCOMPtr.h" |
14 | | #include "nsIPresShell.h" |
15 | | #include "nsViewManager.h" |
16 | | #include "nsIDocShell.h" |
17 | | #include "nsIDocShellTreeOwner.h" |
18 | | |
19 | | class nsIContent; |
20 | | class nsIDocument; |
21 | | class nsPresContext; |
22 | | |
23 | | // nsPrintObject Document Type |
24 | | enum PrintObjectType {eDoc = 0, eFrame = 1, eIFrame = 2, eFrameSet = 3}; |
25 | | |
26 | | //--------------------------------------------------- |
27 | | //-- nsPrintObject Class |
28 | | //--------------------------------------------------- |
29 | | class nsPrintObject |
30 | | { |
31 | | |
32 | | public: |
33 | | nsPrintObject(); |
34 | | ~nsPrintObject(); // non-virtual |
35 | | |
36 | | // Methods |
37 | | nsresult Init(nsIDocShell* aDocShell, nsIDocument* aDoc, bool aPrintPreview); |
38 | | |
39 | 0 | bool IsPrintable() { return !mDontPrint; } |
40 | | void DestroyPresentation(); |
41 | | |
42 | | // Data Members |
43 | | nsCOMPtr<nsIDocShell> mDocShell; |
44 | | nsCOMPtr<nsIDocShellTreeOwner> mTreeOwner; |
45 | | nsCOMPtr<nsIDocument> mDocument; |
46 | | |
47 | | RefPtr<nsPresContext> mPresContext; |
48 | | nsCOMPtr<nsIPresShell> mPresShell; |
49 | | RefPtr<nsViewManager> mViewManager; |
50 | | |
51 | | nsCOMPtr<nsIContent> mContent; |
52 | | PrintObjectType mFrameType; |
53 | | |
54 | | nsTArray<mozilla::UniquePtr<nsPrintObject>> mKids; |
55 | | nsPrintObject* mParent; // This is a non-owning pointer. |
56 | | bool mHasBeenPrinted; |
57 | | bool mDontPrint; |
58 | | bool mPrintAsIs; |
59 | | bool mInvisible; // Indicates PO is set to not visible by CSS |
60 | | bool mPrintPreview; |
61 | | bool mDidCreateDocShell; |
62 | | float mShrinkRatio; |
63 | | float mZoomRatio; |
64 | | |
65 | | private: |
66 | | nsPrintObject& operator=(const nsPrintObject& aOther) = delete; |
67 | | }; |
68 | | |
69 | | |
70 | | |
71 | | #endif /* nsPrintObject_h___ */ |
72 | | |