Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: printing/backend/print_backend.h

Issue 7799003: Add printing.dll to the component build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « printing/backend/cups_helper.h ('k') | printing/backend/print_backend_consts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PRINTING_BACKEND_PRINT_BACKEND_H_ 5 #ifndef PRINTING_BACKEND_PRINT_BACKEND_H_
6 #define PRINTING_BACKEND_PRINT_BACKEND_H_ 6 #define PRINTING_BACKEND_PRINT_BACKEND_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "printing/printing_export.h"
14 15
15 namespace base { 16 namespace base {
16 class DictionaryValue; 17 class DictionaryValue;
17 } 18 }
18 19
19 // This is the interface for platform-specific code for a print backend 20 // This is the interface for platform-specific code for a print backend
20 namespace printing { 21 namespace printing {
21 22
22 struct PrinterBasicInfo { 23 struct PRINTING_EXPORT PrinterBasicInfo {
23 PrinterBasicInfo(); 24 PrinterBasicInfo();
24 ~PrinterBasicInfo(); 25 ~PrinterBasicInfo();
25 26
26 std::string printer_name; 27 std::string printer_name;
27 std::string printer_description; 28 std::string printer_description;
28 int printer_status; 29 int printer_status;
29 int is_default; 30 int is_default;
30 std::map<std::string, std::string> options; 31 std::map<std::string, std::string> options;
31 }; 32 };
32 33
33 typedef std::vector<PrinterBasicInfo> PrinterList; 34 typedef std::vector<PrinterBasicInfo> PrinterList;
34 35
35 struct PrinterCapsAndDefaults { 36 struct PRINTING_EXPORT PrinterCapsAndDefaults {
36 PrinterCapsAndDefaults(); 37 PrinterCapsAndDefaults();
37 ~PrinterCapsAndDefaults(); 38 ~PrinterCapsAndDefaults();
38 39
39 std::string printer_capabilities; 40 std::string printer_capabilities;
40 std::string caps_mime_type; 41 std::string caps_mime_type;
41 std::string printer_defaults; 42 std::string printer_defaults;
42 std::string defaults_mime_type; 43 std::string defaults_mime_type;
43 }; 44 };
44 45
45 // PrintBackend class will provide interface for different print backends 46 // PrintBackend class will provide interface for different print backends
46 // (Windows, CUPS) to implement. User will call CreateInstance() to 47 // (Windows, CUPS) to implement. User will call CreateInstance() to
47 // obtain available print backend. 48 // obtain available print backend.
48 // Please note, that PrintBackend is not platform specific, but rather 49 // Please note, that PrintBackend is not platform specific, but rather
49 // print system specific. For example, CUPS is available on both Linux and Mac, 50 // print system specific. For example, CUPS is available on both Linux and Mac,
50 // but not available on ChromeOS, etc. This design allows us to add more 51 // but not available on ChromeOS, etc. This design allows us to add more
51 // functionality on some platforms, while reusing core (CUPS) functions. 52 // functionality on some platforms, while reusing core (CUPS) functions.
52 class PrintBackend : public base::RefCountedThreadSafe<PrintBackend> { 53 class PRINTING_EXPORT PrintBackend
54 : public base::RefCountedThreadSafe<PrintBackend> {
53 public: 55 public:
54 virtual ~PrintBackend(); 56 virtual ~PrintBackend();
55 57
56 // Enumerates the list of installed local and network printers. 58 // Enumerates the list of installed local and network printers.
57 virtual bool EnumeratePrinters(PrinterList* printer_list) = 0; 59 virtual bool EnumeratePrinters(PrinterList* printer_list) = 0;
58 60
59 // Get the default printer name. Empty string if no default printer. 61 // Get the default printer name. Empty string if no default printer.
60 virtual std::string GetDefaultPrinterName() = 0; 62 virtual std::string GetDefaultPrinterName() = 0;
61 63
62 // Gets the capabilities and defaults for a specific printer. 64 // Gets the capabilities and defaults for a specific printer.
63 virtual bool GetPrinterCapsAndDefaults( 65 virtual bool GetPrinterCapsAndDefaults(
64 const std::string& printer_name, 66 const std::string& printer_name,
65 PrinterCapsAndDefaults* printer_info) = 0; 67 PrinterCapsAndDefaults* printer_info) = 0;
66 68
67 // Returns true if printer_name points to a valid printer. 69 // Returns true if printer_name points to a valid printer.
68 virtual bool IsValidPrinter(const std::string& printer_name) = 0; 70 virtual bool IsValidPrinter(const std::string& printer_name) = 0;
69 71
70 // Allocate a print backend. If |print_backend_settings| is NULL, default 72 // Allocate a print backend. If |print_backend_settings| is NULL, default
71 // settings will be used. 73 // settings will be used.
72 // Return NULL if no print backend available. 74 // Return NULL if no print backend available.
73 static scoped_refptr<PrintBackend> CreateInstance( 75 static scoped_refptr<PrintBackend> CreateInstance(
74 const base::DictionaryValue* print_backend_settings); 76 const base::DictionaryValue* print_backend_settings);
75 }; 77 };
76 78
77 } // namespace printing 79 } // namespace printing
78 80
79 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ 81 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_
OLDNEW
« no previous file with comments | « printing/backend/cups_helper.h ('k') | printing/backend/print_backend_consts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698