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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // print system specific. For example, CUPS is available on both Linux and Mac, | 47 // print system specific. For example, CUPS is available on both Linux and Mac, |
48 // but not available on ChromeOS, etc. This design allows us to add more | 48 // but not available on ChromeOS, etc. This design allows us to add more |
49 // functionality on some platforms, while reusing core (CUPS) functions. | 49 // functionality on some platforms, while reusing core (CUPS) functions. |
50 class PrintBackend : public base::RefCountedThreadSafe<PrintBackend> { | 50 class PrintBackend : public base::RefCountedThreadSafe<PrintBackend> { |
51 public: | 51 public: |
52 virtual ~PrintBackend(); | 52 virtual ~PrintBackend(); |
53 | 53 |
54 // Enumerates the list of installed local and network printers. | 54 // Enumerates the list of installed local and network printers. |
55 virtual bool EnumeratePrinters(PrinterList* printer_list) = 0; | 55 virtual bool EnumeratePrinters(PrinterList* printer_list) = 0; |
56 | 56 |
| 57 // Get the default printer name. Empty string if no default printer. |
| 58 virtual std::string GetDefaultPrinterName() = 0; |
| 59 |
57 // Gets the capabilities and defaults for a specific printer. | 60 // Gets the capabilities and defaults for a specific printer. |
58 virtual bool GetPrinterCapsAndDefaults( | 61 virtual bool GetPrinterCapsAndDefaults( |
59 const std::string& printer_name, | 62 const std::string& printer_name, |
60 PrinterCapsAndDefaults* printer_info) = 0; | 63 PrinterCapsAndDefaults* printer_info) = 0; |
61 | 64 |
62 // Returns true if printer_name points to a valid printer. | 65 // Returns true if printer_name points to a valid printer. |
63 virtual bool IsValidPrinter(const std::string& printer_name) = 0; | 66 virtual bool IsValidPrinter(const std::string& printer_name) = 0; |
64 | 67 |
65 // Allocate a print backend. If |print_backend_settings| is NULL, default | 68 // Allocate a print backend. If |print_backend_settings| is NULL, default |
66 // settings will be used. | 69 // settings will be used. |
67 // Return NULL if no print backend available. | 70 // Return NULL if no print backend available. |
68 static scoped_refptr<PrintBackend> CreateInstance( | 71 static scoped_refptr<PrintBackend> CreateInstance( |
69 const DictionaryValue* print_backend_settings); | 72 const DictionaryValue* print_backend_settings); |
70 }; | 73 }; |
71 | 74 |
72 } // namespace printing | 75 } // namespace printing |
73 | 76 |
74 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ | 77 #endif // PRINTING_BACKEND_PRINT_BACKEND_H_ |
OLD | NEW |