|
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 |
|
8 #include "mozilla/Attributes.h" |
|
9 |
|
10 // Interfaces |
|
11 #include "nsCOMPtr.h" |
|
12 #include "nsIPresShell.h" |
|
13 #include "nsStyleSet.h" |
|
14 #include "nsViewManager.h" |
|
15 #include "nsIDocShell.h" |
|
16 #include "nsIDocShellTreeOwner.h" |
|
17 |
|
18 class nsIContent; |
|
19 class nsIDocument; |
|
20 class nsPresContext; |
|
21 |
|
22 // nsPrintObject Document Type |
|
23 enum PrintObjectType {eDoc = 0, eFrame = 1, eIFrame = 2, eFrameSet = 3}; |
|
24 |
|
25 //--------------------------------------------------- |
|
26 //-- nsPrintObject Class |
|
27 //--------------------------------------------------- |
|
28 class nsPrintObject |
|
29 { |
|
30 |
|
31 public: |
|
32 nsPrintObject(); |
|
33 ~nsPrintObject(); // non-virtual |
|
34 |
|
35 // Methods |
|
36 nsresult Init(nsIDocShell* aDocShell, nsIDOMDocument* aDoc, |
|
37 bool aPrintPreview); |
|
38 |
|
39 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 nsRefPtr<nsPresContext> mPresContext; |
|
48 nsCOMPtr<nsIPresShell> mPresShell; |
|
49 nsRefPtr<nsViewManager> mViewManager; |
|
50 |
|
51 nsCOMPtr<nsIContent> mContent; |
|
52 PrintObjectType mFrameType; |
|
53 |
|
54 nsTArray<nsPrintObject*> mKids; |
|
55 nsPrintObject* mParent; |
|
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) MOZ_DELETE; |
|
67 }; |
|
68 |
|
69 |
|
70 |
|
71 #endif /* nsPrintObject_h___ */ |
|
72 |