OLD | NEW |
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 CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ |
6 #define CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_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/callback_old.h" | 13 #include "base/callback.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 | 15 |
16 #include "printing/backend/print_backend.h" | 16 #include "printing/backend/print_backend.h" |
17 | 17 |
18 class FilePath; | 18 class FilePath; |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class DictionaryValue; | 21 class DictionaryValue; |
22 } | 22 } |
23 | 23 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 bool succeeded() const { return succeeded_; } | 140 bool succeeded() const { return succeeded_; } |
141 std::string message() const { return message_; } | 141 std::string message() const { return message_; } |
142 | 142 |
143 private: | 143 private: |
144 bool succeeded_; | 144 bool succeeded_; |
145 std::string message_; | 145 std::string message_; |
146 | 146 |
147 PrintSystemResult() { } | 147 PrintSystemResult() { } |
148 }; | 148 }; |
149 | 149 |
150 typedef Callback3< | 150 typedef base::Callback<void(bool, |
151 bool, | 151 const std::string&, |
152 const std::string&, | 152 const printing::PrinterCapsAndDefaults&)> |
153 const printing::PrinterCapsAndDefaults&>::Type | 153 PrinterCapsAndDefaultsCallback; |
154 PrinterCapsAndDefaultsCallback; | |
155 | 154 |
156 virtual ~PrintSystem(); | 155 virtual ~PrintSystem(); |
157 | 156 |
158 // Initialize print system. This need to be called before any other function | 157 // Initialize print system. This need to be called before any other function |
159 // of PrintSystem. | 158 // of PrintSystem. |
160 virtual PrintSystemResult Init() = 0; | 159 virtual PrintSystemResult Init() = 0; |
161 | 160 |
162 // Enumerates the list of installed local and network printers. | 161 // Enumerates the list of installed local and network printers. |
163 virtual PrintSystemResult EnumeratePrinters( | 162 virtual PrintSystemResult EnumeratePrinters( |
164 printing::PrinterList* printer_list) = 0; | 163 printing::PrinterList* printer_list) = 0; |
165 | 164 |
166 // Gets the capabilities and defaults for a specific printer asynchronously. | 165 // Gets the capabilities and defaults for a specific printer asynchronously. |
167 virtual void GetPrinterCapsAndDefaults( | 166 virtual void GetPrinterCapsAndDefaults( |
168 const std::string& printer_name, | 167 const std::string& printer_name, |
169 PrinterCapsAndDefaultsCallback* callback) = 0; | 168 const PrinterCapsAndDefaultsCallback& callback) = 0; |
170 | 169 |
171 // Returns true if printer_name points to a valid printer. | 170 // Returns true if printer_name points to a valid printer. |
172 virtual bool IsValidPrinter(const std::string& printer_name) = 0; | 171 virtual bool IsValidPrinter(const std::string& printer_name) = 0; |
173 | 172 |
174 // Returns true if ticket is valid. | 173 // Returns true if ticket is valid. |
175 virtual bool ValidatePrintTicket(const std::string& printer_name, | 174 virtual bool ValidatePrintTicket(const std::string& printer_name, |
176 const std::string& print_ticket_data) = 0; | 175 const std::string& print_ticket_data) = 0; |
177 | 176 |
178 // Get details for already spooled job. | 177 // Get details for already spooled job. |
179 virtual bool GetJobDetails(const std::string& printer_name, | 178 virtual bool GetJobDetails(const std::string& printer_name, |
(...skipping 27 matching lines...) Expand all Loading... |
207 // Visual Studio where it gets confused between multiple Delegate | 206 // Visual Studio where it gets confused between multiple Delegate |
208 // classes and gives a C2500 error. (I saw this error on the try bots - | 207 // classes and gives a C2500 error. (I saw this error on the try bots - |
209 // the workaround was not needed for my machine). | 208 // the workaround was not needed for my machine). |
210 typedef PrintSystem::PrintServerWatcher::Delegate PrintServerWatcherDelegate; | 209 typedef PrintSystem::PrintServerWatcher::Delegate PrintServerWatcherDelegate; |
211 typedef PrintSystem::PrinterWatcher::Delegate PrinterWatcherDelegate; | 210 typedef PrintSystem::PrinterWatcher::Delegate PrinterWatcherDelegate; |
212 typedef PrintSystem::JobSpooler::Delegate JobSpoolerDelegate; | 211 typedef PrintSystem::JobSpooler::Delegate JobSpoolerDelegate; |
213 | 212 |
214 } // namespace cloud_print | 213 } // namespace cloud_print |
215 | 214 |
216 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ | 215 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ |
OLD | NEW |