Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef nsPrintSettingsImpl_h__ |
michael@0 | 8 | #define nsPrintSettingsImpl_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "gfxCore.h" |
michael@0 | 11 | #include "nsIPrintSettings.h" |
michael@0 | 12 | #include "nsMargin.h" |
michael@0 | 13 | #include "nsString.h" |
michael@0 | 14 | #include "nsWeakReference.h" |
michael@0 | 15 | |
michael@0 | 16 | #define NUM_HEAD_FOOT 3 |
michael@0 | 17 | |
michael@0 | 18 | //***************************************************************************** |
michael@0 | 19 | //*** nsPrintSettings |
michael@0 | 20 | //***************************************************************************** |
michael@0 | 21 | |
michael@0 | 22 | class nsPrintSettings : public nsIPrintSettings |
michael@0 | 23 | { |
michael@0 | 24 | public: |
michael@0 | 25 | NS_DECL_ISUPPORTS |
michael@0 | 26 | NS_DECL_NSIPRINTSETTINGS |
michael@0 | 27 | |
michael@0 | 28 | nsPrintSettings(); |
michael@0 | 29 | nsPrintSettings(const nsPrintSettings& aPS); |
michael@0 | 30 | virtual ~nsPrintSettings(); |
michael@0 | 31 | |
michael@0 | 32 | nsPrintSettings& operator=(const nsPrintSettings& rhs); |
michael@0 | 33 | |
michael@0 | 34 | protected: |
michael@0 | 35 | // May be implemented by the platform-specific derived class |
michael@0 | 36 | virtual nsresult _Clone(nsIPrintSettings **_retval); |
michael@0 | 37 | virtual nsresult _Assign(nsIPrintSettings *aPS); |
michael@0 | 38 | |
michael@0 | 39 | typedef enum { |
michael@0 | 40 | eHeader, |
michael@0 | 41 | eFooter |
michael@0 | 42 | } nsHeaderFooterEnum; |
michael@0 | 43 | |
michael@0 | 44 | |
michael@0 | 45 | nsresult GetMarginStrs(char16_t * *aTitle, nsHeaderFooterEnum aType, int16_t aJust); |
michael@0 | 46 | nsresult SetMarginStrs(const char16_t * aTitle, nsHeaderFooterEnum aType, int16_t aJust); |
michael@0 | 47 | |
michael@0 | 48 | // Members |
michael@0 | 49 | nsWeakPtr mSession; // Should never be touched by Clone or Assign |
michael@0 | 50 | |
michael@0 | 51 | // mMargin, mEdge, and mUnwriteableMargin are stored in twips |
michael@0 | 52 | nsIntMargin mMargin; |
michael@0 | 53 | nsIntMargin mEdge; |
michael@0 | 54 | nsIntMargin mUnwriteableMargin; |
michael@0 | 55 | |
michael@0 | 56 | int32_t mPrintOptions; |
michael@0 | 57 | |
michael@0 | 58 | // scriptable data members |
michael@0 | 59 | int16_t mPrintRange; |
michael@0 | 60 | int32_t mStartPageNum; // only used for ePrintRange_SpecifiedRange |
michael@0 | 61 | int32_t mEndPageNum; |
michael@0 | 62 | double mScaling; |
michael@0 | 63 | bool mPrintBGColors; // print background colors |
michael@0 | 64 | bool mPrintBGImages; // print background images |
michael@0 | 65 | |
michael@0 | 66 | int16_t mPrintFrameTypeUsage; |
michael@0 | 67 | int16_t mPrintFrameType; |
michael@0 | 68 | int16_t mHowToEnableFrameUI; |
michael@0 | 69 | bool mIsCancelled; |
michael@0 | 70 | bool mPrintSilent; |
michael@0 | 71 | bool mPrintPreview; |
michael@0 | 72 | bool mShrinkToFit; |
michael@0 | 73 | bool mShowPrintProgress; |
michael@0 | 74 | int32_t mPrintPageDelay; |
michael@0 | 75 | |
michael@0 | 76 | nsString mTitle; |
michael@0 | 77 | nsString mURL; |
michael@0 | 78 | nsString mPageNumberFormat; |
michael@0 | 79 | nsString mHeaderStrs[NUM_HEAD_FOOT]; |
michael@0 | 80 | nsString mFooterStrs[NUM_HEAD_FOOT]; |
michael@0 | 81 | |
michael@0 | 82 | nsString mPaperName; |
michael@0 | 83 | nsString mPlexName; |
michael@0 | 84 | int16_t mPaperData; |
michael@0 | 85 | int16_t mPaperSizeType; |
michael@0 | 86 | double mPaperWidth; |
michael@0 | 87 | double mPaperHeight; |
michael@0 | 88 | int16_t mPaperSizeUnit; |
michael@0 | 89 | |
michael@0 | 90 | bool mPrintReversed; |
michael@0 | 91 | bool mPrintInColor; // a false means grayscale |
michael@0 | 92 | int32_t mOrientation; // see orientation consts |
michael@0 | 93 | nsString mColorspace; |
michael@0 | 94 | nsString mResolutionName; |
michael@0 | 95 | int32_t mResolution; |
michael@0 | 96 | int32_t mDuplex; |
michael@0 | 97 | bool mDownloadFonts; |
michael@0 | 98 | nsString mPrintCommand; |
michael@0 | 99 | int32_t mNumCopies; |
michael@0 | 100 | nsXPIDLString mPrinter; |
michael@0 | 101 | bool mPrintToFile; |
michael@0 | 102 | nsString mToFileName; |
michael@0 | 103 | int16_t mOutputFormat; |
michael@0 | 104 | bool mIsInitedFromPrinter; |
michael@0 | 105 | bool mIsInitedFromPrefs; |
michael@0 | 106 | bool mPersistMarginBoxSettings; |
michael@0 | 107 | }; |
michael@0 | 108 | |
michael@0 | 109 | #endif /* nsPrintSettings_h__ */ |