Bug 1454293 [wpt PR 10484] - null is not the correct origin for createDocument()...
[gecko.git] / widget / nsPrintSettingsImpl.h
blob32b2a69b0f681060796ee63ef39fd064f37bce76
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsPrintSettingsImpl_h__
8 #define nsPrintSettingsImpl_h__
10 #include "nsIPrintSettings.h"
11 #include "nsMargin.h"
12 #include "nsString.h"
13 #include "nsWeakReference.h"
15 #define NUM_HEAD_FOOT 3
17 //*****************************************************************************
18 //*** nsPrintSettings
19 //*****************************************************************************
21 class nsPrintSettings : public nsIPrintSettings
23 public:
24 NS_DECL_ISUPPORTS
25 NS_DECL_NSIPRINTSETTINGS
27 nsPrintSettings();
28 nsPrintSettings(const nsPrintSettings& aPS);
30 nsPrintSettings& operator=(const nsPrintSettings& rhs);
32 protected:
33 virtual ~nsPrintSettings();
35 // May be implemented by the platform-specific derived class
36 virtual nsresult _Clone(nsIPrintSettings **_retval);
37 virtual nsresult _Assign(nsIPrintSettings *aPS);
39 typedef enum {
40 eHeader,
41 eFooter
42 } nsHeaderFooterEnum;
45 // Members
46 nsWeakPtr mSession; // Should never be touched by Clone or Assign
48 // mMargin, mEdge, and mUnwriteableMargin are stored in twips
49 nsIntMargin mMargin;
50 nsIntMargin mEdge;
51 nsIntMargin mUnwriteableMargin;
53 int32_t mPrintOptions;
55 // scriptable data members
56 int16_t mPrintRange;
57 int32_t mStartPageNum; // only used for ePrintRange_SpecifiedRange
58 int32_t mEndPageNum;
59 double mScaling;
60 bool mPrintBGColors; // print background colors
61 bool mPrintBGImages; // print background images
63 int16_t mPrintFrameTypeUsage;
64 int16_t mPrintFrameType;
65 int16_t mHowToEnableFrameUI;
66 bool mIsCancelled;
67 bool mPrintSilent;
68 bool mPrintPreview;
69 bool mShrinkToFit;
70 bool mShowPrintProgress;
71 int32_t mPrintPageDelay;
73 nsString mTitle;
74 nsString mURL;
75 nsString mPageNumberFormat;
76 nsString mHeaderStrs[NUM_HEAD_FOOT];
77 nsString mFooterStrs[NUM_HEAD_FOOT];
79 nsString mPaperName;
80 int16_t mPaperData;
81 double mPaperWidth;
82 double mPaperHeight;
83 int16_t mPaperSizeUnit;
85 bool mPrintReversed;
86 bool mPrintInColor; // a false means grayscale
87 int32_t mOrientation; // see orientation consts
88 int32_t mResolution;
89 int32_t mDuplex;
90 int32_t mNumCopies;
91 nsString mPrinter;
92 bool mPrintToFile;
93 nsString mToFileName;
94 int16_t mOutputFormat;
95 bool mIsInitedFromPrinter;
96 bool mIsInitedFromPrefs;
99 #endif /* nsPrintSettings_h__ */