OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
(...skipping 30 matching lines...) Expand all Loading... |
41 // obtain available print backend. | 41 // obtain available print backend. |
42 // Please note, that PrintBackend is not platform specific, but rather | 42 // Please note, that PrintBackend is not platform specific, but rather |
43 // print system specific. For example, CUPS is available on both Linux and Mac, | 43 // print system specific. For example, CUPS is available on both Linux and Mac, |
44 // but not available on ChromeOS, etc. This design allows us to add more | 44 // but not available on ChromeOS, etc. This design allows us to add more |
45 // functionality on some platforms, while reusing core (CUPS) functions. | 45 // functionality on some platforms, while reusing core (CUPS) functions. |
46 class PrintBackend : public base::RefCountedThreadSafe<PrintBackend> { | 46 class PrintBackend : public base::RefCountedThreadSafe<PrintBackend> { |
47 public: | 47 public: |
48 virtual ~PrintBackend(); | 48 virtual ~PrintBackend(); |
49 | 49 |
50 // Enumerates the list of installed local and network printers. | 50 // Enumerates the list of installed local and network printers. |
51 virtual void EnumeratePrinters(PrinterList* printer_list) = 0; | 51 virtual bool EnumeratePrinters(PrinterList* printer_list) = 0; |
52 | 52 |
53 // Gets the capabilities and defaults for a specific printer. | 53 // Gets the capabilities and defaults for a specific printer. |
54 virtual bool GetPrinterCapsAndDefaults( | 54 virtual bool GetPrinterCapsAndDefaults( |
55 const std::string& printer_name, | 55 const std::string& printer_name, |
56 PrinterCapsAndDefaults* printer_info) = 0; | 56 PrinterCapsAndDefaults* printer_info) = 0; |
57 | 57 |
58 // Returns true if printer_name points to a valid printer. | 58 // Returns true if printer_name points to a valid printer. |
59 virtual bool IsValidPrinter(const std::string& printer_name) = 0; | 59 virtual bool IsValidPrinter(const std::string& printer_name) = 0; |
60 | 60 |
61 // Allocate a print backend. If |print_backend_settings| is NULL, default | 61 // Allocate a print backend. If |print_backend_settings| is NULL, default |
62 // settings will be used. | 62 // settings will be used. |
63 // Return NULL if no print backend available. | 63 // Return NULL if no print backend available. |
64 static scoped_refptr<PrintBackend> CreateInstance( | 64 static scoped_refptr<PrintBackend> CreateInstance( |
65 const DictionaryValue* print_backend_settings); | 65 const DictionaryValue* print_backend_settings); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace printing | 68 } // namespace printing |
69 | 69 |
70 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ | 70 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ |
OLD | NEW |