michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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 nsPrintSettingsImpl_h__ michael@0: #define nsPrintSettingsImpl_h__ michael@0: michael@0: #include "gfxCore.h" michael@0: #include "nsIPrintSettings.h" michael@0: #include "nsMargin.h" michael@0: #include "nsString.h" michael@0: #include "nsWeakReference.h" michael@0: michael@0: #define NUM_HEAD_FOOT 3 michael@0: michael@0: //***************************************************************************** michael@0: //*** nsPrintSettings michael@0: //***************************************************************************** michael@0: michael@0: class nsPrintSettings : public nsIPrintSettings michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIPRINTSETTINGS michael@0: michael@0: nsPrintSettings(); michael@0: nsPrintSettings(const nsPrintSettings& aPS); michael@0: virtual ~nsPrintSettings(); michael@0: michael@0: nsPrintSettings& operator=(const nsPrintSettings& rhs); michael@0: michael@0: protected: michael@0: // May be implemented by the platform-specific derived class michael@0: virtual nsresult _Clone(nsIPrintSettings **_retval); michael@0: virtual nsresult _Assign(nsIPrintSettings *aPS); michael@0: michael@0: typedef enum { michael@0: eHeader, michael@0: eFooter michael@0: } nsHeaderFooterEnum; michael@0: michael@0: michael@0: nsresult GetMarginStrs(char16_t * *aTitle, nsHeaderFooterEnum aType, int16_t aJust); michael@0: nsresult SetMarginStrs(const char16_t * aTitle, nsHeaderFooterEnum aType, int16_t aJust); michael@0: michael@0: // Members michael@0: nsWeakPtr mSession; // Should never be touched by Clone or Assign michael@0: michael@0: // mMargin, mEdge, and mUnwriteableMargin are stored in twips michael@0: nsIntMargin mMargin; michael@0: nsIntMargin mEdge; michael@0: nsIntMargin mUnwriteableMargin; michael@0: michael@0: int32_t mPrintOptions; michael@0: michael@0: // scriptable data members michael@0: int16_t mPrintRange; michael@0: int32_t mStartPageNum; // only used for ePrintRange_SpecifiedRange michael@0: int32_t mEndPageNum; michael@0: double mScaling; michael@0: bool mPrintBGColors; // print background colors michael@0: bool mPrintBGImages; // print background images michael@0: michael@0: int16_t mPrintFrameTypeUsage; michael@0: int16_t mPrintFrameType; michael@0: int16_t mHowToEnableFrameUI; michael@0: bool mIsCancelled; michael@0: bool mPrintSilent; michael@0: bool mPrintPreview; michael@0: bool mShrinkToFit; michael@0: bool mShowPrintProgress; michael@0: int32_t mPrintPageDelay; michael@0: michael@0: nsString mTitle; michael@0: nsString mURL; michael@0: nsString mPageNumberFormat; michael@0: nsString mHeaderStrs[NUM_HEAD_FOOT]; michael@0: nsString mFooterStrs[NUM_HEAD_FOOT]; michael@0: michael@0: nsString mPaperName; michael@0: nsString mPlexName; michael@0: int16_t mPaperData; michael@0: int16_t mPaperSizeType; michael@0: double mPaperWidth; michael@0: double mPaperHeight; michael@0: int16_t mPaperSizeUnit; michael@0: michael@0: bool mPrintReversed; michael@0: bool mPrintInColor; // a false means grayscale michael@0: int32_t mOrientation; // see orientation consts michael@0: nsString mColorspace; michael@0: nsString mResolutionName; michael@0: int32_t mResolution; michael@0: int32_t mDuplex; michael@0: bool mDownloadFonts; michael@0: nsString mPrintCommand; michael@0: int32_t mNumCopies; michael@0: nsXPIDLString mPrinter; michael@0: bool mPrintToFile; michael@0: nsString mToFileName; michael@0: int16_t mOutputFormat; michael@0: bool mIsInitedFromPrinter; michael@0: bool mIsInitedFromPrefs; michael@0: bool mPersistMarginBoxSettings; michael@0: }; michael@0: michael@0: #endif /* nsPrintSettings_h__ */