2006-02-07 01:11:55 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00: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/. */
|
2006-02-07 01:11:55 +00:00
|
|
|
|
|
|
|
#ifndef nsPrintSettingsImpl_h__
|
|
|
|
#define nsPrintSettingsImpl_h__
|
|
|
|
|
|
|
|
#include "nsIPrintSettings.h"
|
|
|
|
#include "nsMargin.h"
|
2006-02-07 01:14:12 +00:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsWeakReference.h"
|
2006-02-07 01:11:55 +00:00
|
|
|
|
2006-02-07 01:14:05 +00:00
|
|
|
#define NUM_HEAD_FOOT 3
|
|
|
|
|
2006-02-07 01:11:55 +00:00
|
|
|
//*****************************************************************************
|
|
|
|
//*** nsPrintSettings
|
|
|
|
//*****************************************************************************
|
2006-02-07 01:14:48 +00:00
|
|
|
|
2006-02-10 20:40:54 +00:00
|
|
|
class nsPrintSettings : public nsIPrintSettings
|
2006-02-07 01:11:55 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPRINTSETTINGS
|
|
|
|
|
|
|
|
nsPrintSettings();
|
2006-02-07 01:14:05 +00:00
|
|
|
nsPrintSettings(const nsPrintSettings& aPS);
|
2006-02-07 01:11:55 +00:00
|
|
|
|
2010-08-20 18:19:38 +00:00
|
|
|
nsPrintSettings& operator=(const nsPrintSettings& rhs);
|
2006-02-07 01:13:52 +00:00
|
|
|
|
2006-02-07 01:14:05 +00:00
|
|
|
protected:
|
2014-06-24 16:36:44 +00:00
|
|
|
virtual ~nsPrintSettings();
|
|
|
|
|
2006-02-07 01:14:05 +00:00
|
|
|
// May be implemented by the platform-specific derived class
|
|
|
|
virtual nsresult _Clone(nsIPrintSettings **_retval);
|
|
|
|
virtual nsresult _Assign(nsIPrintSettings *aPS);
|
|
|
|
|
2006-02-07 01:11:55 +00:00
|
|
|
typedef enum {
|
|
|
|
eHeader,
|
|
|
|
eFooter
|
|
|
|
} nsHeaderFooterEnum;
|
|
|
|
|
2006-02-07 01:14:05 +00:00
|
|
|
|
2014-01-04 15:02:17 +00:00
|
|
|
nsresult GetMarginStrs(char16_t * *aTitle, nsHeaderFooterEnum aType, int16_t aJust);
|
|
|
|
nsresult SetMarginStrs(const char16_t * aTitle, nsHeaderFooterEnum aType, int16_t aJust);
|
2006-02-07 01:11:55 +00:00
|
|
|
|
2006-02-07 01:14:12 +00:00
|
|
|
// Members
|
|
|
|
nsWeakPtr mSession; // Should never be touched by Clone or Assign
|
|
|
|
|
2008-03-19 20:51:42 +00:00
|
|
|
// mMargin, mEdge, and mUnwriteableMargin are stored in twips
|
2009-01-15 03:27:09 +00:00
|
|
|
nsIntMargin mMargin;
|
|
|
|
nsIntMargin mEdge;
|
|
|
|
nsIntMargin mUnwriteableMargin;
|
2008-03-19 20:51:42 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mPrintOptions;
|
2006-02-07 01:11:55 +00:00
|
|
|
|
|
|
|
// scriptable data members
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mPrintRange;
|
|
|
|
int32_t mStartPageNum; // only used for ePrintRange_SpecifiedRange
|
|
|
|
int32_t mEndPageNum;
|
2006-02-07 01:11:55 +00:00
|
|
|
double mScaling;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mPrintBGColors; // print background colors
|
|
|
|
bool mPrintBGImages; // print background images
|
2006-02-07 01:11:55 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mPrintFrameTypeUsage;
|
|
|
|
int16_t mPrintFrameType;
|
|
|
|
int16_t mHowToEnableFrameUI;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsCancelled;
|
|
|
|
bool mPrintSilent;
|
|
|
|
bool mPrintPreview;
|
|
|
|
bool mShrinkToFit;
|
|
|
|
bool mShowPrintProgress;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mPrintPageDelay;
|
2006-02-07 01:11:55 +00:00
|
|
|
|
|
|
|
nsString mTitle;
|
|
|
|
nsString mURL;
|
|
|
|
nsString mPageNumberFormat;
|
2006-02-07 01:14:05 +00:00
|
|
|
nsString mHeaderStrs[NUM_HEAD_FOOT];
|
|
|
|
nsString mFooterStrs[NUM_HEAD_FOOT];
|
2006-02-07 01:11:55 +00:00
|
|
|
|
2006-02-07 01:13:37 +00:00
|
|
|
nsString mPaperName;
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mPaperData;
|
2006-02-07 01:11:55 +00:00
|
|
|
double mPaperWidth;
|
|
|
|
double mPaperHeight;
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mPaperSizeUnit;
|
2006-02-07 01:11:55 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mPrintReversed;
|
|
|
|
bool mPrintInColor; // a false means grayscale
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mOrientation; // see orientation consts
|
2013-04-11 13:10:42 +00:00
|
|
|
int32_t mResolution;
|
|
|
|
int32_t mDuplex;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mNumCopies;
|
2006-02-07 01:14:23 +00:00
|
|
|
nsXPIDLString mPrinter;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mPrintToFile;
|
2006-02-07 01:11:55 +00:00
|
|
|
nsString mToFileName;
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mOutputFormat;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsInitedFromPrinter;
|
|
|
|
bool mIsInitedFromPrefs;
|
2006-02-07 01:11:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsPrintSettings_h__ */
|