Back to index

lightning-sunbird  0.9+nobinonly
nsIPrintSettings.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 2000
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Don Cone <dcone@netscape.com>
00024  *   Rod Spears <rods@netscape.com>
00025  *   Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
00026  *   Julien Lafon <julien.lafon@gmail.com>
00027  *
00028  * Alternatively, the contents of this file may be used under the terms of
00029  * either of the GNU General Public License Version 2 or later (the "GPL"),
00030  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00031  * in which case the provisions of the GPL or the LGPL are applicable instead
00032  * of those above. If you wish to allow use of your version of this file only
00033  * under the terms of either the GPL or the LGPL, and not to allow others to
00034  * use your version of this file under the terms of the MPL, indicate your
00035  * decision by deleting the provisions above and replace them with the notice
00036  * and other provisions required by the GPL or the LGPL. If you do not delete
00037  * the provisions above, a recipient may use your version of this file under
00038  * the terms of any one of the MPL, the GPL or the LGPL.
00039  *
00040  * ***** END LICENSE BLOCK ***** */
00041 
00042 #include "nsISupports.idl"
00043 
00044 
00045 %{ C++
00046 #include "nsMargin.h"
00047 %}
00048 
00052   [ref] native nsNativeMarginRef(nsMargin);
00053   
00054 interface nsIPrintSession;
00055 
00061 [scriptable, uuid(f1094df6-ce0e-42c9-9847-2f663172c38d)]
00062 
00063 interface nsIPrintSettings : nsISupports
00064 {
00068   const unsigned long kInitSaveOddEvenPages   = 0x00000001;
00069   const unsigned long kInitSaveHeaderLeft     = 0x00000002;
00070   const unsigned long kInitSaveHeaderCenter   = 0x00000004;
00071   const unsigned long kInitSaveHeaderRight    = 0x00000008;
00072   const unsigned long kInitSaveFooterLeft     = 0x00000010;
00073   const unsigned long kInitSaveFooterCenter   = 0x00000020;
00074   const unsigned long kInitSaveFooterRight    = 0x00000040;
00075   const unsigned long kInitSaveBGColors       = 0x00000080;
00076   const unsigned long kInitSaveBGImages       = 0x00000100;
00077   const unsigned long kInitSavePaperSize      = 0x00000200;
00078   const unsigned long kInitSavePaperName      = 0x00000400;
00079   const unsigned long kInitSavePaperSizeUnit  = 0x00000800;
00080   const unsigned long kInitSavePaperSizeType  = 0x00001000;
00081   const unsigned long kInitSavePaperData      = 0x00002000;
00082   const unsigned long kInitSavePaperWidth     = 0x00004000;
00083   const unsigned long kInitSavePaperHeight    = 0x00008000;
00084 
00085   const unsigned long kInitSaveReversed       = 0x00010000;
00086   const unsigned long kInitSaveInColor        = 0x00020000;
00087   const unsigned long kInitSaveOrientation    = 0x00040000;
00088   const unsigned long kInitSavePrintCommand   = 0x00080000;
00089   const unsigned long kInitSavePrinterName    = 0x00100000;
00090   const unsigned long kInitSavePrintToFile    = 0x00200000;
00091   const unsigned long kInitSaveToFileName     = 0x00400000;
00092   const unsigned long kInitSavePageDelay      = 0x00800000;
00093   const unsigned long kInitSaveMargins        = 0x01000000;
00094   const unsigned long kInitSaveNativeData     = 0x02000000;
00095   const unsigned long kInitSavePlexName       = 0x04000000;
00096   const unsigned long kInitSaveShrinkToFit    = 0x08000000;
00097   const unsigned long kInitSaveScaling        = 0x10000000;
00098   const unsigned long kInitSaveColorspace     = 0x20000000;
00099   const unsigned long kInitSaveResolutionName = 0x40000000;
00100   const unsigned long kInitSaveDownloadFonts  = 0x80000000;
00101   const unsigned long kInitSaveAll            = 0xFFFFFFFF;
00102 
00103   /* Print Option Flags for Bit Field*/
00104   const long kPrintOddPages     = 0x00000001;
00105   const long kPrintEvenPages    = 0x00000002;
00106   const long kEnableSelectionRB = 0x00000004;
00107 
00108   /* Print Range Enums */
00109   const long kRangeAllPages           = 0;
00110   const long kRangeSpecifiedPageRange = 1;
00111   const long kRangeSelection          = 2;
00112   const long kRangeFocusFrame         = 3;
00113 
00114   /* Justification Enums */
00115   const long kJustLeft   = 0;
00116   const long kJustCenter = 1;
00117   const long kJustRight  = 2;
00118 
00122   const short kUseInternalDefault    = 0;
00123   const short kUseSettingWhenPossible = 1;
00124 
00128   const short kPaperSizeNativeData  = 0;
00129   const short kPaperSizeDefined     = 1;
00130 
00134   const short kPaperSizeInches      = 0;
00135   const short kPaperSizeMillimeters = 1;
00136 
00140   const short kPortraitOrientation  = 0;
00141   const short kLandscapeOrientation = 1;
00142 
00146   const short kNoFrames      = 0;
00147   const short kFramesAsIs    = 1;
00148   const short kSelectedFrame = 2;
00149   const short kEachFrameSep  = 3;
00150 
00154   const short kFrameEnableNone        = 0;
00155   const short kFrameEnableAll         = 1;
00156   const short kFrameEnableAsIsAndEach = 2;
00157 
00161   void SetPrintOptions(in PRInt32 aType, in PRBool aTurnOnOff);
00162 
00166   PRBool GetPrintOptions(in PRInt32 aType);
00167 
00171   PRInt32 GetPrintOptionsBits();
00172 
00176   void GetPageSizeInTwips(out long aWidth, out long aHeight);
00177 
00181     nsIPrintSettings clone();
00182 
00186     void assign(in nsIPrintSettings aPS);
00187 
00191   [noscript] attribute nsIPrintSession printSession; /* We hold a weak reference */
00192 
00193   attribute long    startPageRange;    
00194   attribute long    endPageRange;    
00195 
00196   attribute double  marginTop;     /*  these are in inches */
00197   attribute double  marginLeft;
00198   attribute double  marginBottom;
00199   attribute double  marginRight;
00200 
00201   attribute double  scaling;      /* values 0.0 - 1.0 */
00202   attribute boolean printBGColors; /* Print Background Colors */
00203   attribute boolean printBGImages; /* Print Background Images */
00204 
00205   attribute short   printRange; 
00206 
00207   attribute wstring title;
00208   attribute wstring docURL;
00209 
00210   attribute wstring headerStrLeft;
00211   attribute wstring headerStrCenter;
00212   attribute wstring headerStrRight;
00213 
00214   attribute wstring footerStrLeft;
00215   attribute wstring footerStrCenter;
00216   attribute wstring footerStrRight;
00217 
00218   attribute short   howToEnableFrameUI;  /* indicates how to enable the frameset UI            */
00219   attribute boolean isCancelled;         /* indicates whether the print job has been cancelled */
00220   attribute short   printFrameTypeUsage; /* indicates whether to use the interal value or not  */
00221   attribute short   printFrameType;
00222   attribute boolean printSilent;        /* print without putting up the dialog */
00223   attribute boolean shrinkToFit;        /* shrinks content to fit on page      */
00224   attribute boolean showPrintProgress;   /* indicates whether the progress dialog should be shown */
00225 
00226   /* Additional XP Related */
00227   attribute wstring paperName;     /* name of paper */
00228   attribute short   paperSizeType; /* use native data or is defined here */
00229   attribute short   paperData;     /* native data value */
00230   attribute double  paperWidth;    /* width of the paper in inches or mm */
00231   attribute double  paperHeight;   /* height of the paper in inches or mm */
00232   attribute short   paperSizeUnit; /* paper is in inches or mm */
00233 
00234   attribute wstring plexName;      /* name of plex mode (like "simplex", "duplex",
00235                                     * "tumble" and various custom values) */
00236 
00237   attribute wstring colorspace;    /* device-specific name of colorspace, overrides |printInColor| */
00238   attribute wstring resolutionName;/* device-specific identifer of resolution or quality
00239                                     * (like "600", "600x300", "600x300x12", "high-res",
00240                                     * "med-res". "low-res", etc.) */
00241   attribute boolean downloadFonts; /* enable font download to printer? */
00242 
00243   attribute boolean printReversed;
00244   attribute boolean printInColor;  /* a false means grayscale */
00245   attribute long    paperSize;     /*  see page size consts */
00246   attribute long    orientation;   /*  see orientation consts */
00247   attribute wstring printCommand;
00248   attribute long    numCopies;
00249 
00250   attribute wstring printerName;   /* name of destination printer */
00251 
00252   attribute boolean printToFile;
00253   attribute wstring toFileName;
00254 
00255   attribute long    printPageDelay; /* in milliseconds */
00256   
00257   /* initialize helpers */
00265   attribute boolean isInitializedFromPrinter;
00266 
00273   attribute boolean isInitializedFromPrefs;
00274 
00275   /* C++ Helper Functions */
00276   [noscript] void SetMarginInTwips(in nsNativeMarginRef aMargin);
00277   /* Purposely made this an "in" arg */
00278   [noscript] void GetMarginInTwips(in nsNativeMarginRef aMargin);
00279 
00280 };