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 #ifndef EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
6 #define EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h"
14 namespace extensions
{
18 class DocumentScanInterface
{
20 struct ScannerDescription
{
22 ~ScannerDescription();
24 std::string manufacturer
;
26 std::string scanner_type
;
27 std::string image_mime_type
;
30 enum ScanMode
{ kScanModeColor
, kScanModeGray
, kScanModeLineart
};
32 typedef base::Callback
<void(
33 const std::vector
<ScannerDescription
>& scanner_descriptions
,
34 const std::string
& error
)> ListScannersResultsCallback
;
36 typedef base::Callback
<void(const std::string
& scanned_image
,
37 const std::string
& mime_type
,
38 const std::string
& error
)> ScanResultsCallback
;
40 virtual ~DocumentScanInterface();
42 virtual void Scan(const std::string
& scanner_name
,
45 const ScanResultsCallback
& callback
) = 0;
46 virtual void ListScanners(const ListScannersResultsCallback
& callback
) = 0;
48 // Creates a platform-specific DocumentScanInterface instance.
49 static DocumentScanInterface
* CreateInstance();
52 DocumentScanInterface();
55 } // namespace core_api
57 } // namespace extensions
59 #endif // EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_