2006-02-07 01:12:08 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla browser.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications, Inc. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Travis Bogard <travis@netscape.com>
|
2006-02-07 01:13:09 +00:00
|
|
|
* Jessica Blanco <jblanco@us.ibm.com>
|
2006-02-07 01:12:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsPrintOptionsImpl_h__
|
|
|
|
#define nsPrintOptionsImpl_h__
|
|
|
|
|
|
|
|
#include "nsIPrintOptions.h"
|
2006-02-07 01:12:18 +00:00
|
|
|
class nsIPref;
|
2006-02-07 01:13:05 +00:00
|
|
|
class nsIPrintSettings;
|
2006-02-07 01:12:08 +00:00
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//*** nsPrintOptions
|
|
|
|
//*****************************************************************************
|
2006-02-07 01:12:35 +00:00
|
|
|
class NS_GFX nsPrintOptions : public nsIPrintOptions
|
2006-02-07 01:12:08 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPRINTOPTIONS
|
|
|
|
|
|
|
|
nsPrintOptions();
|
|
|
|
virtual ~nsPrintOptions();
|
|
|
|
|
2006-02-07 01:12:18 +00:00
|
|
|
protected:
|
|
|
|
void ReadBitFieldPref(nsIPref * aPref, const char * aPrefId, PRInt32 anOption);
|
|
|
|
void WriteBitFieldPref(nsIPref * aPref, const char * aPrefId, PRInt32 anOption);
|
2006-02-07 01:12:20 +00:00
|
|
|
void ReadJustification(nsIPref * aPref, const char * aPrefId, PRInt16& aJust, PRInt16 aInitValue);
|
|
|
|
void WriteJustification(nsIPref * aPref, const char * aPrefId, PRInt16 aJust);
|
2006-02-07 01:12:18 +00:00
|
|
|
void ReadInchesToTwipsPref(nsIPref * aPref, const char * aPrefId, nscoord& aTwips);
|
|
|
|
void WriteInchesFromTwipsPref(nsIPref * aPref, const char * aPrefId, nscoord aTwips);
|
2006-02-07 01:12:08 +00:00
|
|
|
|
2006-02-07 01:12:20 +00:00
|
|
|
nsresult ReadPrefString(nsIPref * aPref, const char * aPrefId, nsString& aString);
|
|
|
|
nsresult WritePrefString(nsIPref * aPref, const char * aPrefId, nsString& aString);
|
2006-02-07 01:13:12 +00:00
|
|
|
nsresult ReadPrefDouble(nsIPref * aPref, const char * aPrefId, double& aVal);
|
|
|
|
nsresult WritePrefDouble(nsIPref * aPref, const char * aPrefId, double aVal);
|
2006-02-07 01:12:20 +00:00
|
|
|
|
2006-02-07 01:12:58 +00:00
|
|
|
typedef enum {
|
|
|
|
eHeader,
|
|
|
|
eFooter
|
|
|
|
} nsHeaderFooterEnum;
|
|
|
|
|
|
|
|
nsresult GetMarginStrs(PRUnichar * *aTitle, nsHeaderFooterEnum aType, PRInt16 aJust);
|
|
|
|
nsresult SetMarginStrs(const PRUnichar * aTitle, nsHeaderFooterEnum aType, PRInt16 aJust);
|
|
|
|
|
2006-02-07 01:12:08 +00:00
|
|
|
// Members
|
2006-02-07 01:12:18 +00:00
|
|
|
nsMargin mMargin;
|
2006-02-07 01:12:20 +00:00
|
|
|
PRInt32 mPrintOptions;
|
2006-02-07 01:12:18 +00:00
|
|
|
|
2006-02-07 01:12:20 +00:00
|
|
|
// scriptable data members
|
|
|
|
PRInt16 mPrintRange;
|
2006-02-07 01:12:18 +00:00
|
|
|
PRInt32 mStartPageNum; // only used for ePrintRange_SpecifiedRange
|
|
|
|
PRInt32 mEndPageNum;
|
2006-02-07 01:13:10 +00:00
|
|
|
double mScaling;
|
|
|
|
PRBool mPrintBGColors; // print background colors
|
|
|
|
PRBool mPrintBGImages; // print background images
|
2006-02-07 01:12:08 +00:00
|
|
|
|
2006-02-07 01:13:12 +00:00
|
|
|
PRInt16 mPrintFrameTypeUsage;
|
2006-02-07 01:12:20 +00:00
|
|
|
PRInt16 mPrintFrameType;
|
2006-02-07 01:12:27 +00:00
|
|
|
PRBool mHowToEnableFrameUI;
|
2006-02-07 01:12:29 +00:00
|
|
|
PRBool mIsCancelled;
|
2006-02-07 01:12:32 +00:00
|
|
|
PRBool mPrintSilent;
|
2006-02-07 01:12:29 +00:00
|
|
|
PRInt32 mPrintPageDelay;
|
2006-02-07 01:12:08 +00:00
|
|
|
|
2006-02-07 01:12:18 +00:00
|
|
|
nsString mTitle;
|
|
|
|
nsString mURL;
|
2006-02-07 01:12:58 +00:00
|
|
|
nsString mPageNumberFormat;
|
|
|
|
nsString mHeaderStrs[3];
|
|
|
|
nsString mFooterStrs[3];
|
2006-02-07 01:12:08 +00:00
|
|
|
|
2006-02-07 01:13:12 +00:00
|
|
|
nsIPrintSettings* mPrintSettingsObj; //weak ref, hold address only
|
|
|
|
|
|
|
|
PRInt16 mPaperData;
|
|
|
|
PRInt16 mPaperSizeType;
|
|
|
|
double mPaperWidth;
|
|
|
|
double mPaperHeight;
|
|
|
|
PRInt16 mPaperSizeUnit;
|
|
|
|
|
|
|
|
PRInt32 mPaperSize; // this has been deprecated
|
2006-02-07 01:12:20 +00:00
|
|
|
PRBool mPrintReversed;
|
|
|
|
PRBool mPrintInColor; // a false means grayscale
|
2006-02-07 01:12:51 +00:00
|
|
|
PRInt32 mOrientation; // see orientation consts
|
2006-02-07 01:12:20 +00:00
|
|
|
nsString mPrintCommand;
|
2006-02-07 01:13:09 +00:00
|
|
|
PRInt32 mNumCopies;
|
|
|
|
nsString mPrinter;
|
2006-02-07 01:12:20 +00:00
|
|
|
PRBool mPrintToFile;
|
|
|
|
nsString mToFileName;
|
|
|
|
|
2006-02-07 01:13:01 +00:00
|
|
|
static nsFont* sDefaultFont;
|
2006-02-07 01:12:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* nsPrintOptions_h__ */
|