| 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.
|
| + 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;
|
| +
|
| + // 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);
|
| +
|
| + 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
|
| + // the user's download folder, and the PNG data will also be
|
| + // sent to the callback.
|
| + // |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);
|
| + };
|
| +};
|
|
|