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