michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsPrintData_h___ michael@0: #define nsPrintData_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: // Interfaces michael@0: #include "nsIDOMWindow.h" michael@0: #include "nsDeviceContext.h" michael@0: #include "nsIPrintProgressParams.h" michael@0: #include "nsIPrintOptions.h" michael@0: #include "nsTArray.h" michael@0: #include "nsCOMArray.h" michael@0: #include "nsAutoPtr.h" michael@0: michael@0: // Classes michael@0: class nsPrintObject; michael@0: class nsPrintPreviewListener; michael@0: class nsIWebProgressListener; michael@0: michael@0: //------------------------------------------------------------------------ michael@0: // nsPrintData Class michael@0: // michael@0: // mPreparingForPrint - indicates that we have started Printing but michael@0: // have not gone to the timer to start printing the pages. It gets turned michael@0: // off right before we go to the timer. michael@0: // michael@0: // mDocWasToBeDestroyed - Gets set when "someone" tries to unload the document michael@0: // while we were prparing to Print. This typically happens if a user starts michael@0: // to print while a page is still loading. If they start printing and pause michael@0: // at the print dialog and then the page comes in, we then abort printing michael@0: // because the document is no longer stable. michael@0: // michael@0: //------------------------------------------------------------------------ michael@0: class nsPrintData { michael@0: public: michael@0: michael@0: typedef enum {eIsPrinting, eIsPrintPreview } ePrintDataType; michael@0: michael@0: nsPrintData(ePrintDataType aType); michael@0: ~nsPrintData(); // non-virtual michael@0: michael@0: // Listener Helper Methods michael@0: void OnEndPrinting(); michael@0: void OnStartPrinting(); michael@0: void DoOnProgressChange(int32_t aProgress, michael@0: int32_t aMaxProgress, michael@0: bool aDoStartStop, michael@0: int32_t aFlag); michael@0: michael@0: michael@0: ePrintDataType mType; // the type of data this is (Printing or Print Preview) michael@0: nsRefPtr mPrintDC; michael@0: FILE *mDebugFilePtr; // a file where information can go to when printing michael@0: michael@0: nsPrintObject * mPrintObject; michael@0: nsPrintObject * mSelectedPO; michael@0: michael@0: nsCOMArray mPrintProgressListeners; michael@0: nsCOMPtr mPrintProgressParams; michael@0: michael@0: nsCOMPtr mCurrentFocusWin; // cache a pointer to the currently focused window michael@0: michael@0: nsTArray mPrintDocList; michael@0: bool mIsIFrameSelected; michael@0: bool mIsParentAFrameSet; michael@0: bool mOnStartSent; michael@0: bool mIsAborted; // tells us the document is being aborted michael@0: bool mPreparingForPrint; // see comments above michael@0: bool mDocWasToBeDestroyed; // see comments above michael@0: bool mShrinkToFit; michael@0: int16_t mPrintFrameType; michael@0: int32_t mNumPrintablePages; michael@0: int32_t mNumPagesPrinted; michael@0: float mShrinkRatio; michael@0: float mOrigDCScale; michael@0: michael@0: nsCOMPtr mPrintSettings; michael@0: nsPrintPreviewListener* mPPEventListeners; michael@0: michael@0: char16_t* mBrandName; // needed as a substitute name for a document michael@0: michael@0: private: michael@0: nsPrintData() MOZ_DELETE; michael@0: nsPrintData& operator=(const nsPrintData& aOther) MOZ_DELETE; michael@0: michael@0: }; michael@0: michael@0: #endif /* nsPrintData_h___ */ michael@0: