OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/strings/string16.h" | |
14 #include "printing/print_job_constants.h" | 13 #include "printing/print_job_constants.h" |
15 #include "printing/printing_export.h" | 14 #include "printing/printing_export.h" |
16 | 15 |
17 namespace base { | 16 namespace base { |
18 class DictionaryValue; | 17 class DictionaryValue; |
19 } | 18 } |
20 | 19 |
21 // 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 |
22 namespace printing { | 21 namespace printing { |
23 | 22 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const std::string& printer_name, | 90 const std::string& printer_name, |
92 PrinterCapsAndDefaults* printer_info) = 0; | 91 PrinterCapsAndDefaults* printer_info) = 0; |
93 | 92 |
94 // Gets the information about driver for a specific printer. | 93 // Gets the information about driver for a specific printer. |
95 virtual std::string GetPrinterDriverInfo( | 94 virtual std::string GetPrinterDriverInfo( |
96 const std::string& printer_name) = 0; | 95 const std::string& printer_name) = 0; |
97 | 96 |
98 // Returns true if printer_name points to a valid printer. | 97 // Returns true if printer_name points to a valid printer. |
99 virtual bool IsValidPrinter(const std::string& printer_name) = 0; | 98 virtual bool IsValidPrinter(const std::string& printer_name) = 0; |
100 | 99 |
101 // Simplify title to resolve issue with some drivers. | |
102 static base::string16 SimplifyDocumentTitle(const base::string16& title); | |
103 | |
104 // Allocate a print backend. If |print_backend_settings| is NULL, default | 100 // Allocate a print backend. If |print_backend_settings| is NULL, default |
105 // settings will be used. | 101 // settings will be used. |
106 // Return NULL if no print backend available. | 102 // Return NULL if no print backend available. |
107 static scoped_refptr<PrintBackend> CreateInstance( | 103 static scoped_refptr<PrintBackend> CreateInstance( |
108 const base::DictionaryValue* print_backend_settings); | 104 const base::DictionaryValue* print_backend_settings); |
109 | 105 |
110 protected: | 106 protected: |
111 friend class base::RefCountedThreadSafe<PrintBackend>; | 107 friend class base::RefCountedThreadSafe<PrintBackend>; |
112 virtual ~PrintBackend(); | 108 virtual ~PrintBackend(); |
113 }; | 109 }; |
114 | 110 |
115 } // namespace printing | 111 } // namespace printing |
116 | 112 |
117 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ | 113 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ |
OLD | NEW |