2001-09-26 00:16:04 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
2001-02-01 23:04:07 +00:00
|
|
|
*
|
2001-09-26 00:16:04 +00:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
2001-02-01 23:04:07 +00:00
|
|
|
*
|
2001-09-26 00:16:04 +00:00
|
|
|
* 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.
|
2001-02-01 23:04:07 +00:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-26 00:16:04 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-02-01 23:04:07 +00:00
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Don Cone <dcone@netscape.com>
|
2001-09-26 00:16:04 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-02-01 23:04:07 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2002-01-01 12:58:53 +00:00
|
|
|
|
|
|
|
%{ C++
|
|
|
|
#include "nsMargin.h"
|
|
|
|
#include "nsFont.h"
|
|
|
|
%}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Native types
|
|
|
|
*/
|
|
|
|
[ref] native nsNativeMarginRef(nsMargin);
|
2002-07-13 00:18:46 +00:00
|
|
|
|
|
|
|
interface nsIPrintSession;
|
2002-01-01 12:58:53 +00:00
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
/**
|
|
|
|
* Simplified graphics interface for JS rendering.
|
2001-03-24 00:22:18 +00:00
|
|
|
*
|
|
|
|
* @status UNDER_REVIEW
|
2001-02-01 23:04:07 +00:00
|
|
|
*/
|
|
|
|
[scriptable, uuid(83427530-F790-11d4-A869-00105A183419)]
|
|
|
|
|
|
|
|
interface nsIPrintSettings : nsISupports
|
|
|
|
{
|
2002-03-16 13:08:45 +00:00
|
|
|
/**
|
|
|
|
* PrintSettings to be Saved Navigation Constants
|
|
|
|
*/
|
|
|
|
const unsigned long kInitSaveOddEvenPages = 0x00000001;
|
|
|
|
const unsigned long kInitSaveHeaderLeft = 0x00000002;
|
|
|
|
const unsigned long kInitSaveHeaderCenter = 0x00000004;
|
|
|
|
const unsigned long kInitSaveHeaderRight = 0x00000008;
|
|
|
|
const unsigned long kInitSaveFooterLeft = 0x00000010;
|
|
|
|
const unsigned long kInitSaveFooterCenter = 0x00000020;
|
|
|
|
const unsigned long kInitSaveFooterRight = 0x00000040;
|
|
|
|
const unsigned long kInitSaveBGColors = 0x00000080;
|
|
|
|
const unsigned long kInitSaveBGImages = 0x00000100;
|
|
|
|
const unsigned long kInitSavePaperSize = 0x00000200;
|
|
|
|
const unsigned long kInitSavePaperName = 0x00000400;
|
|
|
|
const unsigned long kInitSavePaperSizeUnit = 0x00000800;
|
|
|
|
const unsigned long kInitSavePaperSizeType = 0x00001000;
|
|
|
|
const unsigned long kInitSavePaperData = 0x00002000;
|
|
|
|
const unsigned long kInitSavePaperWidth = 0x00004000;
|
|
|
|
const unsigned long kInitSavePaperHeight = 0x00008000;
|
|
|
|
|
|
|
|
const unsigned long kInitSaveReversed = 0x00010000;
|
|
|
|
const unsigned long kInitSaveInColor = 0x00020000;
|
|
|
|
const unsigned long kInitSaveOrientation = 0x00040000;
|
|
|
|
const unsigned long kInitSavePrintCommand = 0x00080000;
|
|
|
|
const unsigned long kInitSavePrinterName = 0x00100000;
|
|
|
|
const unsigned long kInitSavePrintToFile = 0x00200000;
|
|
|
|
const unsigned long kInitSaveToFileName = 0x00400000;
|
|
|
|
const unsigned long kInitSavePageDelay = 0x00800000;
|
|
|
|
const unsigned long kInitSaveMargins = 0x01000000;
|
2002-05-02 13:47:53 +00:00
|
|
|
const unsigned long kInitSaveNativeData = 0x02000000;
|
2002-03-16 13:08:45 +00:00
|
|
|
const unsigned long kInitSaveAll = 0xFFFFFFFF;
|
2002-01-01 12:58:53 +00:00
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
/* Print Option Flags for Bit Field*/
|
2002-01-01 12:58:53 +00:00
|
|
|
const long kPrintOddPages = 0x00000001;
|
|
|
|
const long kPrintEvenPages = 0x00000002;
|
|
|
|
const long kEnableSelectionRB = 0x00000004;
|
2001-02-01 23:04:07 +00:00
|
|
|
|
|
|
|
/* Print Range Enums */
|
|
|
|
const long kRangeAllPages = 0;
|
|
|
|
const long kRangeSpecifiedPageRange = 1;
|
|
|
|
const long kRangeSelection = 2;
|
|
|
|
const long kRangeFocusFrame = 3;
|
|
|
|
|
|
|
|
/* Justification Enums */
|
|
|
|
const long kJustLeft = 0;
|
|
|
|
const long kJustCenter = 1;
|
|
|
|
const long kJustRight = 2;
|
|
|
|
|
|
|
|
/**
|
2002-01-01 12:58:53 +00:00
|
|
|
* FrameSet Default Type Constants
|
|
|
|
*/
|
|
|
|
const short kUseInternalDefault = 0;
|
|
|
|
const short kUseSettingWhenPossible = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Page Size Type Constants
|
2001-02-01 23:04:07 +00:00
|
|
|
*/
|
2002-01-01 12:58:53 +00:00
|
|
|
const short kPaperSizeNativeData = 0;
|
|
|
|
const short kPaperSizeDefined = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Page Size Unit Constants
|
|
|
|
*/
|
|
|
|
const short kPaperSizeInches = 0;
|
|
|
|
const short kPaperSizeMillimeters = 1;
|
2001-02-01 23:04:07 +00:00
|
|
|
|
2001-11-03 13:00:40 +00:00
|
|
|
/**
|
2001-11-03 14:45:46 +00:00
|
|
|
* Orientation Constants
|
2001-11-03 13:00:40 +00:00
|
|
|
*/
|
2001-11-03 14:45:46 +00:00
|
|
|
const short kPortraitOrientation = 0;
|
|
|
|
const short kLandscapeOrientation = 1;
|
2001-11-03 14:17:37 +00:00
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
/**
|
|
|
|
* Print Frame Constants
|
|
|
|
*/
|
|
|
|
const short kNoFrames = 0;
|
|
|
|
const short kFramesAsIs = 1;
|
|
|
|
const short kSelectedFrame = 2;
|
|
|
|
const short kEachFrameSep = 3;
|
2001-02-01 23:04:07 +00:00
|
|
|
|
2002-01-01 12:58:53 +00:00
|
|
|
/**
|
|
|
|
* How to Enable Frame Set Printing Constants
|
|
|
|
*/
|
|
|
|
const short kFrameEnableNone = 0;
|
|
|
|
const short kFrameEnableAll = 1;
|
|
|
|
const short kFrameEnableAsIsAndEach = 2;
|
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
/**
|
|
|
|
* Set PrintOptions
|
|
|
|
*/
|
|
|
|
void SetPrintOptions(in PRInt32 aType, in PRBool aTurnOnOff);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get PrintOptions
|
|
|
|
*/
|
|
|
|
PRBool GetPrintOptions(in PRInt32 aType);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set PrintOptions Bit field
|
|
|
|
*/
|
|
|
|
PRInt32 GetPrintOptionsBits();
|
|
|
|
|
2002-01-01 12:58:53 +00:00
|
|
|
/**
|
|
|
|
* Returns W/H in Twips from Paper Size H/W
|
|
|
|
*/
|
|
|
|
void GetPageSizeInTwips(out long aWidth, out long aHeight);
|
|
|
|
|
2002-05-02 13:47:53 +00:00
|
|
|
/**
|
|
|
|
* Makes a new copy
|
|
|
|
*/
|
|
|
|
nsIPrintSettings clone();
|
|
|
|
|
2002-06-18 00:06:32 +00:00
|
|
|
/**
|
|
|
|
* Assigns the internal values from the "in" arg to the current object
|
|
|
|
*/
|
|
|
|
void assign(in nsIPrintSettings aPS);
|
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
/**
|
|
|
|
* Data Members
|
|
|
|
*/
|
2002-07-13 00:18:46 +00:00
|
|
|
[noscript] attribute nsIPrintSession printSession; /* We hold a weak reference */
|
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
attribute long startPageRange;
|
|
|
|
attribute long endPageRange;
|
|
|
|
|
|
|
|
attribute double marginTop; /* these are in inches */
|
|
|
|
attribute double marginLeft;
|
|
|
|
attribute double marginBottom;
|
|
|
|
attribute double marginRight;
|
|
|
|
|
2001-11-26 12:48:41 +00:00
|
|
|
attribute double scaling; /* values 0.0 - 1.0 */
|
|
|
|
attribute boolean printBGColors; /* Print Background Colors */
|
|
|
|
attribute boolean printBGImages; /* Print Background Images */
|
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute short printRange;
|
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
attribute wstring title;
|
|
|
|
attribute wstring docURL;
|
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute wstring headerStrLeft;
|
|
|
|
attribute wstring headerStrCenter;
|
|
|
|
attribute wstring headerStrRight;
|
2001-02-01 23:04:07 +00:00
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute wstring footerStrLeft;
|
|
|
|
attribute wstring footerStrCenter;
|
|
|
|
attribute wstring footerStrRight;
|
2001-02-01 23:04:07 +00:00
|
|
|
|
2002-01-01 12:58:53 +00:00
|
|
|
attribute short howToEnableFrameUI; /* indicates how to enable the frameset UI */
|
|
|
|
attribute boolean isCancelled; /* indicates whether the print job has been cancelled */
|
|
|
|
attribute short printFrameTypeUsage; /* indicates whether to use the interal value or not */
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute short printFrameType;
|
2002-02-19 11:49:27 +00:00
|
|
|
attribute boolean printSilent; /* print without putting up the dialog */
|
|
|
|
attribute boolean shrinkToFit; /* shrinks content to fit on page */
|
2002-04-28 01:42:17 +00:00
|
|
|
attribute boolean showPrintProgress; /* indicates whether the progress dialog should be shown */
|
2001-11-03 14:17:37 +00:00
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
/* Additional XP Related */
|
2002-03-16 13:08:45 +00:00
|
|
|
attribute wstring paperName; /* name of paper */
|
2002-01-01 12:58:53 +00:00
|
|
|
attribute short paperSizeType; /* use native data or is defined here */
|
|
|
|
attribute short paperData; /* native data value */
|
|
|
|
attribute double paperWidth; /* width of the paper in inches or mm */
|
|
|
|
attribute double paperHeight; /* height of the paper in inches or mm */
|
|
|
|
attribute short paperSizeUnit; /* paper is in inches or mm */
|
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute boolean printReversed;
|
|
|
|
attribute boolean printInColor; /* a false means grayscale */
|
|
|
|
attribute long paperSize; /* see page size consts */
|
|
|
|
attribute long orientation; /* see orientation consts */
|
|
|
|
attribute wstring printCommand;
|
2002-01-01 12:58:53 +00:00
|
|
|
attribute long numCopies;
|
|
|
|
attribute wstring printerName;
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute boolean printToFile;
|
|
|
|
attribute wstring toFileName;
|
2001-02-01 23:04:07 +00:00
|
|
|
|
2001-11-03 14:45:46 +00:00
|
|
|
attribute long printPageDelay; /* in milliseconds */
|
2002-07-13 00:18:46 +00:00
|
|
|
|
2002-10-30 13:38:13 +00:00
|
|
|
/* initialize helpers */
|
|
|
|
/**
|
|
|
|
* This attribute tracks whether the PS has been initialized
|
|
|
|
* from a printer specified by the "printerName" attr.
|
|
|
|
* If a different name is set into the "printerName"
|
|
|
|
* attribute than the one it was initialized with the PS
|
|
|
|
* will then get intialized from that printer.
|
|
|
|
*/
|
|
|
|
attribute boolean isInitializedFromPrinter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This attribute tracks whether the PS has been initialized
|
|
|
|
* from prefs. If a different name is set into the "printerName"
|
|
|
|
* attribute than the one it was initialized with the PS
|
|
|
|
* will then get intialized from prefs again.
|
|
|
|
*/
|
|
|
|
attribute boolean isInitializedFromPrefs;
|
|
|
|
|
2002-01-01 12:58:53 +00:00
|
|
|
/* C++ Helper Functions */
|
|
|
|
[noscript] void SetMarginInTwips(in nsNativeMarginRef aMargin);
|
|
|
|
/* Purposely made this an "in" arg */
|
|
|
|
[noscript] void GetMarginInTwips(in nsNativeMarginRef aMargin);
|
|
|
|
|
2001-02-01 23:04:07 +00:00
|
|
|
};
|