Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / layout / printing / nsPrintData.h
blobca7282c75bf6f44c05c10246dd3813cc4184fcf2
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
37 #ifndef nsPrintData_h___
38 #define nsPrintData_h___
40 // Interfaces
41 #include "nsIDOMWindow.h"
42 #include "nsIDeviceContext.h"
43 #include "nsIPrintProgressParams.h"
44 #include "nsIPrintOptions.h"
45 #include "nsVoidArray.h"
46 #include "nsCOMArray.h"
48 // Classes
49 class nsPrintObject;
50 class nsPrintPreviewListener;
51 class nsIWebProgressListener;
53 //------------------------------------------------------------------------
54 // nsPrintData Class
56 // mPreparingForPrint - indicates that we have started Printing but
57 // have not gone to the timer to start printing the pages. It gets turned
58 // off right before we go to the timer.
60 // mDocWasToBeDestroyed - Gets set when "someone" tries to unload the document
61 // while we were prparing to Print. This typically happens if a user starts
62 // to print while a page is still loading. If they start printing and pause
63 // at the print dialog and then the page comes in, we then abort printing
64 // because the document is no longer stable.
65 //
66 //------------------------------------------------------------------------
67 class nsPrintData {
68 public:
70 typedef enum {eIsPrinting, eIsPrintPreview } ePrintDataType;
72 // This enum tells indicates what the default should be for the title
73 // if the title from the document is null
74 enum eDocTitleDefault {
75 eDocTitleDefNone,
76 eDocTitleDefBlank,
77 eDocTitleDefURLDoc
81 nsPrintData(ePrintDataType aType);
82 ~nsPrintData(); // non-virtual
84 // Listener Helper Methods
85 void OnEndPrinting();
86 void OnStartPrinting();
87 void DoOnProgressChange(PRInt32 aProgess,
88 PRInt32 aMaxProgress,
89 PRBool aDoStartStop,
90 PRInt32 aFlag);
93 ePrintDataType mType; // the type of data this is (Printing or Print Preview)
94 nsCOMPtr<nsIDeviceContext> mPrintDC;
95 FILE *mDebugFilePtr; // a file where information can go to when printing
97 nsPrintObject * mPrintObject;
98 nsPrintObject * mSelectedPO;
100 nsCOMArray<nsIWebProgressListener> mPrintProgressListeners;
101 nsCOMPtr<nsIPrintProgressParams> mPrintProgressParams;
103 nsCOMPtr<nsIDOMWindow> mCurrentFocusWin; // cache a pointer to the currently focused window
105 nsVoidArray* mPrintDocList;
106 PRPackedBool mIsIFrameSelected;
107 PRPackedBool mIsParentAFrameSet;
108 PRPackedBool mOnStartSent;
109 PRPackedBool mIsAborted; // tells us the document is being aborted
110 PRPackedBool mPreparingForPrint; // see comments above
111 PRPackedBool mDocWasToBeDestroyed; // see comments above
112 PRBool mShrinkToFit;
113 PRInt16 mPrintFrameType;
114 PRInt32 mNumPrintablePages;
115 PRInt32 mNumPagesPrinted;
116 float mShrinkRatio;
117 float mOrigDCScale;
119 nsCOMPtr<nsIPrintSettings> mPrintSettings;
120 nsPrintPreviewListener* mPPEventListeners;
122 PRUnichar* mBrandName; // needed as a substitute name for a document
124 private:
125 nsPrintData(); //not implemented
126 nsPrintData& operator=(const nsPrintData& aOther); // not implemented
130 #endif /* nsPrintData_h___ */