2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsPrintSettingsImpl_h__
|
|
|
|
#define nsPrintSettingsImpl_h__
|
|
|
|
|
|
|
|
#include "gfxCore.h"
|
|
|
|
#include "nsIPrintSettings.h"
|
|
|
|
#include "nsMargin.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
#define NUM_HEAD_FOOT 3
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//*** nsPrintSettings
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
class nsPrintSettings : public nsIPrintSettings
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPRINTSETTINGS
|
|
|
|
|
|
|
|
nsPrintSettings();
|
|
|
|
nsPrintSettings(const nsPrintSettings& aPS);
|
|
|
|
virtual ~nsPrintSettings();
|
|
|
|
|
2010-08-20 11:19:38 -07:00
|
|
|
nsPrintSettings& operator=(const nsPrintSettings& rhs);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// May be implemented by the platform-specific derived class
|
|
|
|
virtual nsresult _Clone(nsIPrintSettings **_retval);
|
|
|
|
virtual nsresult _Assign(nsIPrintSettings *aPS);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
eHeader,
|
|
|
|
eFooter
|
|
|
|
} nsHeaderFooterEnum;
|
|
|
|
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult GetMarginStrs(PRUnichar * *aTitle, nsHeaderFooterEnum aType, int16_t aJust);
|
|
|
|
nsresult SetMarginStrs(const PRUnichar * aTitle, nsHeaderFooterEnum aType, int16_t aJust);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Members
|
|
|
|
nsWeakPtr mSession; // Should never be touched by Clone or Assign
|
|
|
|
|
2008-03-19 13:51:42 -07:00
|
|
|
// mMargin, mEdge, and mUnwriteableMargin are stored in twips
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntMargin mMargin;
|
|
|
|
nsIntMargin mEdge;
|
|
|
|
nsIntMargin mUnwriteableMargin;
|
2008-03-19 13:51:42 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mPrintOptions;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// scriptable data members
|
2012-08-22 08:56:38 -07:00
|
|
|
int16_t mPrintRange;
|
|
|
|
int32_t mStartPageNum; // only used for ePrintRange_SpecifiedRange
|
|
|
|
int32_t mEndPageNum;
|
2007-03-22 10:30:00 -07:00
|
|
|
double mScaling;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mPrintBGColors; // print background colors
|
|
|
|
bool mPrintBGImages; // print background images
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
int16_t mPrintFrameTypeUsage;
|
|
|
|
int16_t mPrintFrameType;
|
|
|
|
int16_t mHowToEnableFrameUI;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsCancelled;
|
|
|
|
bool mPrintSilent;
|
|
|
|
bool mPrintPreview;
|
|
|
|
bool mShrinkToFit;
|
|
|
|
bool mShowPrintProgress;
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mPrintPageDelay;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsString mTitle;
|
|
|
|
nsString mURL;
|
|
|
|
nsString mPageNumberFormat;
|
|
|
|
nsString mHeaderStrs[NUM_HEAD_FOOT];
|
|
|
|
nsString mFooterStrs[NUM_HEAD_FOOT];
|
|
|
|
|
|
|
|
nsString mPaperName;
|
|
|
|
nsString mPlexName;
|
2012-08-22 08:56:38 -07:00
|
|
|
int16_t mPaperData;
|
|
|
|
int16_t mPaperSizeType;
|
2007-03-22 10:30:00 -07:00
|
|
|
double mPaperWidth;
|
|
|
|
double mPaperHeight;
|
2012-08-22 08:56:38 -07:00
|
|
|
int16_t mPaperSizeUnit;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mPrintReversed;
|
|
|
|
bool mPrintInColor; // a false means grayscale
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mOrientation; // see orientation consts
|
2007-03-22 10:30:00 -07:00
|
|
|
nsString mColorspace;
|
|
|
|
nsString mResolutionName;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mDownloadFonts;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsString mPrintCommand;
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mNumCopies;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsXPIDLString mPrinter;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mPrintToFile;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsString mToFileName;
|
2012-08-22 08:56:38 -07:00
|
|
|
int16_t mOutputFormat;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsInitedFromPrinter;
|
|
|
|
bool mIsInitedFromPrefs;
|
2013-02-20 07:50:21 -08:00
|
|
|
bool mPersistMarginBoxSettings;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsPrintSettings_h__ */
|