| Index: chrome/browser/extensions/api/document_scan/document_scan_interface.h
|
| diff --git a/chrome/browser/extensions/api/document_scan/document_scan_interface.h b/chrome/browser/extensions/api/document_scan/document_scan_interface.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..323d8ba7e71d9a76e0363682f5447b927fb5f54c
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/api/document_scan/document_scan_interface.h
|
| @@ -0,0 +1,62 @@
|
| +// 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.
|
| +
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
|
| +#define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
|
| +
|
| +namespace extensions {
|
| +
|
| +namespace api {
|
| +
|
| +class DocumentScanInterface {
|
| + public:
|
| + struct ScannerDescription {
|
| + std::string name;
|
| + std::string manufacturer;
|
| + std::string model;
|
| + std::string scanner_type;
|
| + std::string image_mime_type;
|
| + };
|
| +
|
| + enum ScanMode {
|
| + kScanModeColor,
|
| + kScanModeGray,
|
| + kScanModeLineart
|
| + };
|
| +
|
| + typedef base::Callback<void(
|
| + const std::vector<ScannerDescription>& scanner_descriptions,
|
| + const std::string& error)> ListScannersResultsCallback;
|
| +
|
| + typedef base::Callback<void(
|
| + const std::string& scanned_image,
|
| + const std::string& error)> ScanResultsCallback;
|
| +
|
| + virtual ~DocumentScanInterface() {}
|
| +
|
| + virtual void Scan(const std::string& scanner_name,
|
| + ScanMode mode,
|
| + int resolution_dpi,
|
| + const ScanResultsCallback& callback) = 0;
|
| + virtual void ListScanners(const ListScannersResultsCallback& callback) = 0;
|
| + virtual std::string GetImageMimeType() const = 0;
|
| +
|
| + // Creates a platform-specific DocumentScanInterface instance.
|
| + static DocumentScanInterface *CreateInstance();
|
| +
|
| + protected:
|
| + DocumentScanInterface() {}
|
| +};
|
| +
|
| +} // namespace api
|
| +
|
| +} // namespace extensions
|
| +
|
| +#endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
|
|
|