Bug 1716846 [wpt PR 29402] - Update wpt metadata, a=testonly
[gecko.git] / widget / nsIPrinterList.idl
blobd49cedc16eab23e9975cb4faa8cf4d5820c0c2d9
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
13 /**
14 * Initializes certain settings from the native printer into the PrintSettings
15 * These settings include, but are not limited to:
16 * Page Orientation
17 * Page Size
18 * Number of Copies
20 void initPrintSettingsFromPrinter(in AString aPrinterName,
21 in nsIPrintSettings aPrintSettings);
23 /**
24 * The system default printer name. This is not necessarily gecko's
25 * default printer; see nsIPrintSettingsService.lastUsedPrinterName
26 * for that.
28 readonly attribute AString systemDefaultPrinterName;
30 /**
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);
36 /**
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);
44 /**
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
47 * available.
49 [implicit_jscontext] Promise getNamedOrDefaultPrinter(in AString aPrinterName);
51 /**
52 * Returns a promise that resolves to an array of printers.
54 [implicit_jscontext] readonly attribute Promise printers;
56 /**
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;