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
"nsIPrinter.idl"
8 #include
"nsIPrintSettings.idl"
10 [scriptable
, uuid(5e738fff
-404c
-4c94
-9189-e8f2cce93e94
)]
11 interface nsIPrinterList
: nsISupports
14 * Initializes certain settings from the native printer into the PrintSettings
15 * These settings include, but are not limited to:
20 void initPrintSettingsFromPrinter
(in AString aPrinterName
,
21 in nsIPrintSettings aPrintSettings
);
24 * The system default printer name. This is not necessarily gecko's
25 * default printer; see nsIPrintSettingsService.lastUsedPrinterName
28 readonly attribute AString systemDefaultPrinterName
;
31 * Returns a promise that resolves to the printer of a given name, or is
32 * rejected if there is no such printer.
34 [implicit_jscontext
] Promise getPrinterByName
(in AString aPrinterName
);
37 * Returns a promise that resolves to the printer of a given system name, or
38 * is rejected if there is no such printer.
39 * This may be more efficient than using getNamedPrinter, but requires the
40 * caller to know the system name of the printer they want to find.
42 [implicit_jscontext
] Promise getPrinterBySystemName
(in AString aPrinterName
);
45 * Returns a promise that resolves to the printer of the given name, or
46 * the default system printer, or is rejected if there are no printers
49 [implicit_jscontext
] Promise getNamedOrDefaultPrinter
(in AString aPrinterName
);
52 * Returns a promise that resolves to an array of printers.
54 [implicit_jscontext
] readonly attribute Promise printers
;
57 * Returns a Promise that resolves to an array of nsIPaper instances
58 * for common paper sizes suitable to be supported for Save to PDF.
60 [implicit_jscontext
] readonly attribute Promise fallbackPaperList
;