1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
7 #include
"nsIPrintSettings.idl"
19 interface nsIStringEnumerator
;
20 interface nsIWebBrowserPrint
;
25 [ref] native nsNativeFontRef
(nsFont
);
26 [ref] native PrintDataRef
(const mozilla
::embedding
::PrintData
);
27 [ptr] native PrintDataPtr
(mozilla
::embedding
::PrintData
);
30 * Print options interface
32 * Do not attempt to freeze this API - it still needs lots of work. Consult
33 * John Keiser <jkeiser@netscape.com> and Roland Mainz
34 * <roland.mainz@informatik.med.uni-giessen.de> for futher details.
36 [scriptable
, uuid(2ac74034
-700e-40fd
-8059-81d33223af58
)]
38 interface nsIPrintOptions
: nsISupports
41 * Show Native Print Options dialog, this may not be supported on all platforms
43 void ShowPrintSetupDialog
(in nsIPrintSettings aThePrintSettings
);
46 * Creates a new PrintSettnigs Object
47 * and initializes it from prefs
49 nsIPrintSettings CreatePrintSettings
();
52 * Get a prefixed integer pref
54 int32_t getPrinterPrefInt
(in nsIPrintSettings aPrintSettings
, in wstring
58 * display Printer Job Properties dialog
60 void displayJobProperties
(in wstring aPrinter
, in nsIPrintSettings
61 aPrintSettings
, out boolean aDisplayed
);
64 * Native data constants
66 const short kNativeDataPrintRecord
= 0;
68 [noscript
] voidPtr GetNativeData
(in short aDataType
);
71 * Given some nsIPrintSettings and (optionally) an nsIWebBrowserPrint, populates
72 * a PrintData representing them which can be sent over IPC. Values are only
73 * ever read from aSettings and aWBP.
76 * An nsIPrintSettings for a print job.
77 * @param aWBP (optional)
78 * The nsIWebBrowserPrint for the print job.
80 * Pointer to a pre-existing PrintData to populate.
84 [noscript
] void SerializeToPrintData
(in nsIPrintSettings aPrintSettings
,
85 in nsIWebBrowserPrint aWebBrowserPrint
,
86 in PrintDataPtr data
);
89 * This function is the opposite of SerializeToPrintData, in that it takes
90 * a PrintData, and populates a pre-existing nsIPrintSettings with the data
94 * Printing information sent through IPC.
96 * A pre-existing nsIPrintSettings to populate with the PrintData.
100 [noscript
] void DeserializeToPrintSettings
(in PrintDataRef data
,
101 in nsIPrintSettings aPrintSettings
);
104 [scriptable
, uuid(5e738fff
-404c
-4c94
-9189-e8f2cce93e94
)]
106 interface nsIPrinterEnumerator
: nsISupports
109 * The name of the system default printer. This name should also be
110 * present in printerNameList below. This is not necessarily gecko's
111 * default printer; see nsIPrintSettingsService.defaultPrinterName
114 readonly attribute wstring defaultPrinterName
;
117 * Initializes certain settings from the native printer into the PrintSettings
118 * These settings include, but are not limited to:
123 void initPrintSettingsFromPrinter
(in wstring aPrinterName
, in nsIPrintSettings aPrintSettings
);
126 * The list of printer names
128 readonly attribute nsIStringEnumerator printerNameList
;
130 /* takes printer selected and will display job properties dlg for that printer
131 * returns true if dialog displays
133 void displayPropertiesDlg
(in wstring aPrinter
, in nsIPrintSettings aPrintSettings
);