1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/xpwidgets/nsPrintSettingsImpl.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,109 @@ 1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef nsPrintSettingsImpl_h__ 1.11 +#define nsPrintSettingsImpl_h__ 1.12 + 1.13 +#include "gfxCore.h" 1.14 +#include "nsIPrintSettings.h" 1.15 +#include "nsMargin.h" 1.16 +#include "nsString.h" 1.17 +#include "nsWeakReference.h" 1.18 + 1.19 +#define NUM_HEAD_FOOT 3 1.20 + 1.21 +//***************************************************************************** 1.22 +//*** nsPrintSettings 1.23 +//***************************************************************************** 1.24 + 1.25 +class nsPrintSettings : public nsIPrintSettings 1.26 +{ 1.27 +public: 1.28 + NS_DECL_ISUPPORTS 1.29 + NS_DECL_NSIPRINTSETTINGS 1.30 + 1.31 + nsPrintSettings(); 1.32 + nsPrintSettings(const nsPrintSettings& aPS); 1.33 + virtual ~nsPrintSettings(); 1.34 + 1.35 + nsPrintSettings& operator=(const nsPrintSettings& rhs); 1.36 + 1.37 +protected: 1.38 + // May be implemented by the platform-specific derived class 1.39 + virtual nsresult _Clone(nsIPrintSettings **_retval); 1.40 + virtual nsresult _Assign(nsIPrintSettings *aPS); 1.41 + 1.42 + typedef enum { 1.43 + eHeader, 1.44 + eFooter 1.45 + } nsHeaderFooterEnum; 1.46 + 1.47 + 1.48 + nsresult GetMarginStrs(char16_t * *aTitle, nsHeaderFooterEnum aType, int16_t aJust); 1.49 + nsresult SetMarginStrs(const char16_t * aTitle, nsHeaderFooterEnum aType, int16_t aJust); 1.50 + 1.51 + // Members 1.52 + nsWeakPtr mSession; // Should never be touched by Clone or Assign 1.53 + 1.54 + // mMargin, mEdge, and mUnwriteableMargin are stored in twips 1.55 + nsIntMargin mMargin; 1.56 + nsIntMargin mEdge; 1.57 + nsIntMargin mUnwriteableMargin; 1.58 + 1.59 + int32_t mPrintOptions; 1.60 + 1.61 + // scriptable data members 1.62 + int16_t mPrintRange; 1.63 + int32_t mStartPageNum; // only used for ePrintRange_SpecifiedRange 1.64 + int32_t mEndPageNum; 1.65 + double mScaling; 1.66 + bool mPrintBGColors; // print background colors 1.67 + bool mPrintBGImages; // print background images 1.68 + 1.69 + int16_t mPrintFrameTypeUsage; 1.70 + int16_t mPrintFrameType; 1.71 + int16_t mHowToEnableFrameUI; 1.72 + bool mIsCancelled; 1.73 + bool mPrintSilent; 1.74 + bool mPrintPreview; 1.75 + bool mShrinkToFit; 1.76 + bool mShowPrintProgress; 1.77 + int32_t mPrintPageDelay; 1.78 + 1.79 + nsString mTitle; 1.80 + nsString mURL; 1.81 + nsString mPageNumberFormat; 1.82 + nsString mHeaderStrs[NUM_HEAD_FOOT]; 1.83 + nsString mFooterStrs[NUM_HEAD_FOOT]; 1.84 + 1.85 + nsString mPaperName; 1.86 + nsString mPlexName; 1.87 + int16_t mPaperData; 1.88 + int16_t mPaperSizeType; 1.89 + double mPaperWidth; 1.90 + double mPaperHeight; 1.91 + int16_t mPaperSizeUnit; 1.92 + 1.93 + bool mPrintReversed; 1.94 + bool mPrintInColor; // a false means grayscale 1.95 + int32_t mOrientation; // see orientation consts 1.96 + nsString mColorspace; 1.97 + nsString mResolutionName; 1.98 + int32_t mResolution; 1.99 + int32_t mDuplex; 1.100 + bool mDownloadFonts; 1.101 + nsString mPrintCommand; 1.102 + int32_t mNumCopies; 1.103 + nsXPIDLString mPrinter; 1.104 + bool mPrintToFile; 1.105 + nsString mToFileName; 1.106 + int16_t mOutputFormat; 1.107 + bool mIsInitedFromPrinter; 1.108 + bool mIsInitedFromPrefs; 1.109 + bool mPersistMarginBoxSettings; 1.110 +}; 1.111 + 1.112 +#endif /* nsPrintSettings_h__ */