1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsIPrintSettingsService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,106 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* Interface to the Service for gwetting the Global PrintSettings object 1.10 + or a unique PrintSettings object 1.11 +*/ 1.12 + 1.13 +#include "nsISupports.idl" 1.14 + 1.15 +interface nsIPrintSettings; 1.16 + 1.17 +[scriptable, uuid(841387C8-72E6-484b-9296-BF6EEA80D58A)] 1.18 +interface nsIPrintSettingsService : nsISupports 1.19 +{ 1.20 + /** 1.21 + * Returns a "global" PrintSettings object 1.22 + * Creates a new the first time, if one doesn't exist. 1.23 + * 1.24 + * Then returns the same object each time after that. 1.25 + * 1.26 + * Initializes the globalPrintSettings from the default printer 1.27 + */ 1.28 + readonly attribute nsIPrintSettings globalPrintSettings; 1.29 + 1.30 + /** 1.31 + * Returns a new, unique PrintSettings object each time. 1.32 + * 1.33 + * For example, if each browser was to have its own unique 1.34 + * PrintSettings, then each browser window would call this to 1.35 + * create its own unique PrintSettings object. 1.36 + * 1.37 + * If each browse window was to use the same PrintSettings object 1.38 + * then it should use "globalPrintSettings" 1.39 + * 1.40 + * Initializes the newPrintSettings from the default printer 1.41 + * 1.42 + */ 1.43 + readonly attribute nsIPrintSettings newPrintSettings; 1.44 + 1.45 + /** 1.46 + * The name of the last printer used, or else the system default printer. 1.47 + */ 1.48 + readonly attribute wstring defaultPrinterName; 1.49 + 1.50 + /** 1.51 + * Initializes certain settings from the native printer into the PrintSettings 1.52 + * if aPrinterName is null then it uses the default printer name if it can 1.53 + * These settings include, but are not limited to: 1.54 + * Page Orientation 1.55 + * Page Size 1.56 + * Number of Copies 1.57 + */ 1.58 + void initPrintSettingsFromPrinter(in wstring aPrinterName, in nsIPrintSettings aPrintSettings); 1.59 + 1.60 + /** 1.61 + * Reads PrintSettings values from Prefs, 1.62 + * the values to be read are indicated by the "flags" arg. 1.63 + * 1.64 + * aPrintSettings should be initialized with the name of a printer. First 1.65 + * it reads in the PrintSettings from the last print job. Then it uses the 1.66 + * PrinterName in the PrinterSettings to read any settings that were saved 1.67 + * just for that printer. 1.68 + * 1.69 + * aPS - PrintSettings to have its settings read 1.70 + * aUsePrinterNamePrefix - indicates whether to use the printer name as a prefix 1.71 + * aFlags - indicates which prefs to read, see nsIPrintSettings.idl for the 1.72 + * const values. 1.73 + * 1.74 + * Items not read: 1.75 + * startPageRange, endPageRange, scaling, printRange, title 1.76 + * docURL, howToEnableFrameUI, isCancelled, printFrameTypeUsage 1.77 + * printFrameType, printSilent, shrinkToFit, numCopies, 1.78 + * printerName 1.79 + * 1.80 + */ 1.81 + void initPrintSettingsFromPrefs(in nsIPrintSettings aPrintSettings, in boolean aUsePrinterNamePrefix, in unsigned long aFlags); 1.82 + 1.83 + /** 1.84 + * Writes PrintSettings values to Prefs, 1.85 + * the values to be written are indicated by the "flags" arg. 1.86 + * 1.87 + * If there is no PrinterName in the PrinterSettings 1.88 + * the values are saved as the "generic" values not associated with any printer. 1.89 + * If a PrinterName is there, then it saves the items qualified for that Printer 1.90 + * 1.91 + * aPS - PrintSettings to have its settings saved 1.92 + * aUsePrinterNamePrefix - indicates whether to use the printer name as a prefix 1.93 + * aFlags - indicates which prefs to save, see nsIPrintSettings.idl for the const values. 1.94 + * 1.95 + * Items not written: 1.96 + * startPageRange, endPageRange, scaling, printRange, title 1.97 + * docURL, howToEnableFrameUI, isCancelled, printFrameTypeUsage 1.98 + * printFrameType, printSilent, shrinkToFit, numCopies 1.99 + * 1.100 + */ 1.101 + void savePrintSettingsToPrefs(in nsIPrintSettings aPrintSettings, in boolean aUsePrinterNamePrefix, in unsigned long aFlags); 1.102 + 1.103 +}; 1.104 + 1.105 +%{C++ 1.106 +// {841387C8-72E6-484b-9296-BF6EEA80D58A} 1.107 +#define NS_PRINTSETTINGSSERVICE_IID \ 1.108 + {0x841387c8, 0x72e6, 0x484b, { 0x92, 0x96, 0xbf, 0x6e, 0xea, 0x80, 0xd5, 0x8a}} 1.109 +%}