OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 // Use the <code>chrome.document_scan</code> API to discover and retrieve | |
6 // images from attached paper document scanners. | |
7 namespace documentScan { | |
8 | |
9 // Represents a document scanner's properties. | |
10 dictionary ScannerInfo { | |
11 // The name of a connected scanner. | |
12 DOMString name; | |
13 | |
14 // The manufacturer name of the scanner. | |
15 DOMString manufacturer; | |
16 | |
17 // The model name of the scanner. | |
18 DOMString model; | |
19 | |
20 // The type of scanner. | |
21 DOMString type; | |
22 }; | |
23 | |
24 // Mode to perform the scan in. | |
25 enum ScanMode { color, gray, lineart }; | |
26 | |
27 dictionary ScanOptions { | |
28 // The mode to perform the scan in: color, gray or lineart. | |
29 ScanMode? mode; | |
30 | |
31 // The resolution in dpi to perform the scan. | |
32 long? resolutionDpi; | |
33 }; | |
34 | |
35 // Callback from the <code>listScanners</code> method. | |
36 callback ListScannersCallback = void (ScannerInfo[] scannerInfos); | |
37 | |
38 // Callback from the <code>scan</code> method; on success (result == true) | |
39 // PNG image data from the scan is returned in |image_data|. The image | |
40 // is also saved to the user's download folder. | |
mef
2014/05/23 18:38:18
Is saving to download folder specific to ChromeOS?
Paul Stewart
2014/05/23 19:45:36
You just found a vestige! Patch set 6 removes tha
| |
41 callback ScanCallback = void (ArrayBuffer image_data); | |
42 | |
43 interface Functions { | |
44 // Returns information about available scanners on the system. | |
45 // The list is regenerated each time this method is called. | |
46 // |callback| : Called with the list of <code>ScannerInfo</code> objects. | |
47 static void listScanners(ListScannersCallback callback); | |
48 | |
49 // Performs a document scan. On success, the PNG data will also be | |
50 // sent to the callback. | |
51 // |scanner| : Name of the scanner to acquire an image from. | |
52 // |options| : <code>ScanObject</code> object containing scan parameters. | |
53 // |callback| : Called with the result and data from the scan. | |
54 static void scan(DOMString scanner, ScanOptions options, | |
55 ScanCallback callback); | |
56 }; | |
57 }; | |
OLD | NEW |