Index: chrome/common/extensions/api/document_scan.idl |
diff --git a/chrome/common/extensions/api/document_scan.idl b/chrome/common/extensions/api/document_scan.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ca44ea38c93e110ebb4c7306745a8e2b5172f227 |
--- /dev/null |
+++ b/chrome/common/extensions/api/document_scan.idl |
@@ -0,0 +1,55 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Use the <code>chrome.document_scan</code> API to discover and retrieve |
+// images from attached paper document scanners. |
+namespace documentScan { |
+ |
+ // Represents a document scanner's properties. |
+ dictionary ScannerInfo { |
+ // The name of an connected scanner. |
asargent_no_longer_on_chrome
2014/05/21 18:06:24
nit: "an" -> "a" (I think - if you are a grammar w
Paul Stewart
2014/05/22 18:37:50
Done.
|
+ DOMString name; |
+ |
+ // The manufacturer name of the scanner. |
+ DOMString manufacturer; |
+ |
+ // The model name of the scanner. |
+ DOMString model; |
+ |
+ // The type of scanner. |
+ DOMString type; |
+ }; |
+ |
+ dictionary ScanOptions { |
+ // The mode to perform the scan in: color, gray or lineart. |
+ DOMString? mode; |
asargent_no_longer_on_chrome
2014/05/21 18:06:24
nit: instead of just using a string, it would be b
Paul Stewart
2014/05/22 18:37:50
Done.
|
+ |
+ // The resolution in dpi to perform the scan. |
+ long? resolutionDpi; |
+ }; |
+ |
+ // Callback from the <code>listScanners</code> method. |
+ callback ListScannersCallback = void (ScannerInfo[] scannerInfos); |
+ |
+ // Callback from the <code>scan</code> method; on success (result == true) |
+ // PNG image data from the scan is returned in |image_data|. The image |
+ // is also saved to the user's download folder. |
+ callback ScanCallback = void (boolean result, ArrayBuffer image_data); |
asargent_no_longer_on_chrome
2014/05/21 18:06:24
The prevailing style for a long time has been to a
Paul Stewart
2014/05/22 18:37:50
Done.
|
+ |
+ interface Functions { |
+ // Returns information about available scanners on the system. |
+ // The list is regenerated each time this method is called. |
+ // |callback| : Called with the list of <code>ScannerInfo</code> objects. |
+ static void listScanners(ListScannersCallback callback); |
+ |
+ // Performs a document scan. On success, ths image data will be stored in |
asargent_no_longer_on_chrome
2014/05/21 18:06:24
typo: "ths"
Paul Stewart
2014/05/22 18:37:50
Done.
|
+ // the user's download folder, and the PNG data will also be |
+ // sent to the callback. |
asargent_no_longer_on_chrome
2014/05/21 18:06:24
It seems slightly strange to me to have both a fil
Paul Stewart
2014/05/22 18:37:50
I've been thinking about this myself as well. I t
|
+ // |scanner| : Name of the scanner to acquire an image from. |
+ // |options| : <code>ScanObject</code> object containing scan parameters. |
+ // |callback| : Called with the result and data from the scan. |
+ static void scan(DOMString scanner, ScanOptions options, |
+ ScanCallback callback); |
+ }; |
+}; |