ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / extensions / common / api / printer_provider.idl
blob940e018e58d54a91dc116b544062a059b61f07a5
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // <p>The <code>chrome.printerProvider</code> API exposes events used by print
6 // manager to query printers controlled by extensions, to query their
7 // capabilities and to submit print jobs to these printers.
8 // <p/>
9 // <p>Available only on dev channel since Chrome 42.</p>
10 namespace printerProvider {
11 // Error codes returned in response to $(ref:onPrintRequested) event.
12 enum PrintError {
13 // Operation completed successfully.
14 OK,
16 // General failure.
17 FAILED,
19 // Print ticket is invalid. For example, ticket is inconsistent with
20 // capabilities or extension is not able to handle all settings from the
21 // ticket.
22 INVALID_TICKET,
24 // Document is invalid. For example, data may be corrupted or the format is
25 // incompatible with the extension.
26 INVALID_DATA
29 // Printer description for $(ref:onGetPrintersRequested) event.
30 dictionary PrinterInfo {
31 // Unique printer ID.
32 DOMString id;
34 // Printer's human readable name.
35 DOMString name;
37 // Printer's human readable description.
38 DOMString? description;
41 // Printing request parameters. Passed to $(ref:onPrintRequested) event.
42 dictionary PrintJob {
43 // ID of the printer which should handle the job.
44 DOMString printerId;
46 // Print ticket in
47 // <a href="https://developers.google.com/cloud-print/docs/cdd#cjt">
48 // CJT format</a>.
49 object ticket;
51 // The document content type. Supported formats are
52 // <code>"application/pdf"</code> and <code>"image/pwg-raster"</code>.
53 DOMString contentType;
55 // Buffer containing the document to print. Format must match |contentType|.
56 ArrayBuffer document;
59 callback PrintersCallback = void(PrinterInfo[] printerInfo);
61 // |capabilities|: Device capabilities in
62 // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD
63 // format</a>.
64 callback CapabilitiesCallback = void(object capabilities);
66 callback PrintCallback = void(PrintError result);
68 interface Events {
69 // Event fired when print manager requests printers provided by extensions.
70 // |resultCallback|: Callback to return printer list. Every listener must
71 // call callback exactly once.
72 static void onGetPrintersRequested(PrintersCallback resultCallback);
74 // Event fired when print manager requests printer capabilities.
75 // |printerId|: Unique ID of the printer whose capabilities are requested.
76 // |resultCallback|: Callback to return device capabilities in
77 // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD
78 // format</a>.
79 // The receiving listener must call callback exectly once.
80 static void onGetCapabilityRequested(DOMString printerId,
81 CapabilitiesCallback resultCallback);
83 // Event fired when print manager requests printing.
84 // |printJob|: The printing request parameters.
85 // |resultCallback|: Callback that should be called when the printing
86 // request is completed.
87 static void onPrintRequested(PrintJob printJob,
88 PrintCallback resultCallback);