Simplified graphics interface for JS rendering.

 @status UNDER_REVIEW
[scriptable, uuid(343700dd-078b-42b6-a809-b9c1d7e951d0)]
interface nsIPrintSettings : nsISupports

Constants

 PrintSettings to be Saved Navigation Constants
const unsigned long kInitSaveOddEvenPages = 1

          
const unsigned long kInitSaveHeaderLeft = 2

          
const unsigned long kInitSaveHeaderCenter = 4

          
const unsigned long kInitSaveHeaderRight = 8

          
const unsigned long kInitSaveFooterLeft = 16

          
const unsigned long kInitSaveFooterCenter = 32

          
const unsigned long kInitSaveFooterRight = 64

          
const unsigned long kInitSaveBGColors = 128

          
const unsigned long kInitSaveBGImages = 256

          
const unsigned long kInitSavePaperSize = 512

          
const unsigned long kInitSavePaperData = 8192

          
const unsigned long kInitSaveUnwriteableMargins = 16384

          
const unsigned long kInitSaveEdges = 32768

          
const unsigned long kInitSaveReversed = 65536

          
const unsigned long kInitSaveInColor = 131072

          
const unsigned long kInitSaveOrientation = 262144

          
const unsigned long kInitSavePrintCommand = 524288

          
const unsigned long kInitSavePrinterName = 1048576

          
const unsigned long kInitSavePrintToFile = 2097152

          
const unsigned long kInitSaveToFileName = 4194304

          
const unsigned long kInitSavePageDelay = 8388608

          
const unsigned long kInitSaveMargins = 16777216

          
const unsigned long kInitSaveNativeData = 33554432

          
const unsigned long kInitSavePlexName = 67108864

          
const unsigned long kInitSaveShrinkToFit = 134217728

          
const unsigned long kInitSaveScaling = 268435456

          
const unsigned long kInitSaveColorspace = 536870912

          
const unsigned long kInitSaveResolutionName = 1073741824

          
const unsigned long kInitSaveDownloadFonts = 2147483648

          
const unsigned long kInitSaveAll = 4294967295

          
const long kPrintOddPages = 1

          
const long kPrintEvenPages = 2

          
const long kEnableSelectionRB = 4

          
const long kRangeAllPages = 0

          
const long kRangeSpecifiedPageRange = 1

          
const long kRangeSelection = 2

          
const long kRangeFocusFrame = 3

          
const long kJustLeft = 0

          
const long kJustCenter = 1

          
const long kJustRight = 2
 FrameSet Default Type Constants
const short kUseInternalDefault = 0

          
const short kUseSettingWhenPossible = 1
 Page Size Type Constants
const short kPaperSizeNativeData = 0

          
const short kPaperSizeDefined = 1
 Page Size Unit Constants
const short kPaperSizeInches = 0

          
const short kPaperSizeMillimeters = 1
 Orientation Constants
const short kPortraitOrientation = 0

          
const short kLandscapeOrientation = 1
 Print Frame Constants
const short kNoFrames = 0

          
const short kFramesAsIs = 1

          
const short kSelectedFrame = 2

          
const short kEachFrameSep = 3
 How to Enable Frame Set Printing Constants
const short kFrameEnableNone = 0

          
const short kFrameEnableAll = 1

          
const short kFrameEnableAsIsAndEach = 2
 Output file format
const short kOutputFormatNative = 0

          
const short kOutputFormatPS = 1

          
const short kOutputFormatPDF = 2

Attributes


          
attribute wstring colorspace

          
attribute wstring docURL

          
attribute boolean downloadFonts

          
attribute double edgeBottom

          
attribute double edgeLeft

          
attribute double edgeRight
 The edge measurements define the positioning of the headers
 and footers on the page. They're measured as an offset from
 the "unwriteable margin" (described below).
attribute double edgeTop

          
attribute long endPageRange

          
attribute wstring footerStrCenter

          
attribute wstring footerStrLeft

          
attribute wstring footerStrRight

          
attribute wstring headerStrCenter

          
attribute wstring headerStrLeft

          
attribute wstring headerStrRight

          
attribute short howToEnableFrameUI

          
attribute boolean isCancelled
 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
 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

          
attribute double marginBottom

          
attribute double marginLeft

          
attribute double marginRight
 The margins define the positioning of the content on the page.
 They're treated as an offset from the "unwriteable margin"
 (described below).
attribute double marginTop

          
attribute long numCopies

          
attribute long orientation

          
attribute short outputFormat

          
attribute short paperData

          
attribute double paperHeight

          
attribute wstring paperName

          
attribute short paperSizeType

          
attribute short paperSizeUnit

          
attribute double paperWidth

          
attribute wstring plexName

          
attribute boolean printBGColors

          
attribute boolean printBGImages

          
attribute wstring printCommand

          
attribute short printFrameType

          
attribute short printFrameTypeUsage

          
attribute boolean printInColor

          
attribute long printPageDelay

          
attribute short printRange

          
attribute boolean printReversed
 Data Members
[noscript] attribute nsIPrintSession printSession

          
attribute boolean printSilent

          
attribute boolean printToFile

          
attribute wstring printerName

          
attribute wstring resolutionName

          
attribute double scaling

          
attribute boolean showPrintProgress

          
attribute boolean shrinkToFit

          
attribute long startPageRange

          
attribute wstring title

          
attribute wstring toFileName

          
attribute double unwriteableMarginBottom

          
attribute double unwriteableMarginLeft

          
attribute double unwriteableMarginRight
 The unwriteable margin defines the printable region of the paper, creating
 an invisible border from which the edge and margin attributes are measured.
attribute double unwriteableMarginTop

Methods


          
[noscript] void GetEdgeInTwips(in nsNativeIntMarginRef aEdge)
 Get the page size in twips, considering the
 orientation (portrait or landscape).
void GetEffectivePageSize(out double aWidth, out double aHeight)

          
[noscript] void GetMarginInTwips(in nsNativeIntMarginRef aMargin)
 Get PrintOptions 
PRBool GetPrintOptions(in PRInt32 aType)
 Set PrintOptions Bit field
PRInt32 GetPrintOptionsBits()

          
[noscript] void GetUnwriteableMarginInTwips(in nsNativeIntMarginRef aEdge)

          
[noscript] void SetEdgeInTwips(in nsNativeIntMarginRef aEdge)

          
[noscript] void SetMarginInTwips(in nsNativeIntMarginRef aMargin)
 Set PrintOptions 
void SetPrintOptions(in PRInt32 aType, in PRBool aTurnOnOff)
 Sets/Gets the "unwriteable margin" for the page format.  This defines
 the boundary from which we'll measure the EdgeInTwips and MarginInTwips 
 attributes, to place the headers and content, respectively.

 Note: Implementations of SetUnwriteableMarginInTwips should handle
 negative margin values by falling back on the system default for
 that margin.
[noscript] void SetUnwriteableMarginInTwips(in nsNativeIntMarginRef aEdge)
 We call this function so that anything that requires a run of the event loop
 can do so safely. The print dialog runs the event loop but in silent printing
 that doesn't happen.

 Either this or ShowPrintDialog (but not both) MUST be called by the print engine
 before printing, otherwise printing can fail on some platforms.
[noscript] void SetupSilentPrinting()
 Assigns the internal values from the "in" arg to the current object
void assign(in nsIPrintSettings aPS)
 Makes a new copy