Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / layout / printing / nsPrintData.h
blobaf121d3181d5e14cb963395f785bb2af8e10d83c
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/. */
6 #ifndef nsPrintData_h___
7 #define nsPrintData_h___
9 #include "mozilla/Attributes.h"
11 // Interfaces
12 #include "nsIDOMWindow.h"
13 #include "nsDeviceContext.h"
14 #include "nsIPrintProgressParams.h"
15 #include "nsIPrintOptions.h"
16 #include "nsTArray.h"
17 #include "nsCOMArray.h"
18 #include "nsAutoPtr.h"
20 // Classes
21 class nsPrintObject;
22 class nsPrintPreviewListener;
23 class nsIWebProgressListener;
25 //------------------------------------------------------------------------
26 // nsPrintData Class
28 // mPreparingForPrint - indicates that we have started Printing but
29 // have not gone to the timer to start printing the pages. It gets turned
30 // off right before we go to the timer.
32 // mDocWasToBeDestroyed - Gets set when "someone" tries to unload the document
33 // while we were prparing to Print. This typically happens if a user starts
34 // to print while a page is still loading. If they start printing and pause
35 // at the print dialog and then the page comes in, we then abort printing
36 // because the document is no longer stable.
37 //
38 //------------------------------------------------------------------------
39 class nsPrintData {
40 public:
42 typedef enum {eIsPrinting, eIsPrintPreview } ePrintDataType;
44 explicit nsPrintData(ePrintDataType aType);
45 ~nsPrintData(); // non-virtual
47 // Listener Helper Methods
48 void OnEndPrinting();
49 void OnStartPrinting();
50 void DoOnProgressChange(int32_t aProgress,
51 int32_t aMaxProgress,
52 bool aDoStartStop,
53 int32_t aFlag);
56 ePrintDataType mType; // the type of data this is (Printing or Print Preview)
57 nsRefPtr<nsDeviceContext> mPrintDC;
58 FILE *mDebugFilePtr; // a file where information can go to when printing
60 nsPrintObject * mPrintObject;
61 nsPrintObject * mSelectedPO;
63 nsCOMArray<nsIWebProgressListener> mPrintProgressListeners;
64 nsCOMPtr<nsIPrintProgressParams> mPrintProgressParams;
66 nsCOMPtr<nsIDOMWindow> mCurrentFocusWin; // cache a pointer to the currently focused window
68 nsTArray<nsPrintObject*> mPrintDocList;
69 bool mIsIFrameSelected;
70 bool mIsParentAFrameSet;
71 bool mOnStartSent;
72 bool mIsAborted; // tells us the document is being aborted
73 bool mPreparingForPrint; // see comments above
74 bool mDocWasToBeDestroyed; // see comments above
75 bool mShrinkToFit;
76 int16_t mPrintFrameType;
77 int32_t mNumPrintablePages;
78 int32_t mNumPagesPrinted;
79 float mShrinkRatio;
80 float mOrigDCScale;
82 nsCOMPtr<nsIPrintSettings> mPrintSettings;
83 nsPrintPreviewListener* mPPEventListeners;
85 char16_t* mBrandName; // needed as a substitute name for a document
87 private:
88 nsPrintData() MOZ_DELETE;
89 nsPrintData& operator=(const nsPrintData& aOther) MOZ_DELETE;
93 #endif /* nsPrintData_h___ */