OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PRINTING_BACKEND_PRINT_BACKEND_CUPS_H_ |
| 6 #define PRINTING_BACKEND_PRINT_BACKEND_CUPS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/files/file_util.h" |
| 11 #include "printing/backend/cups_helper.h" |
| 12 #include "printing/backend/print_backend.h" |
| 13 #include "url/gurl.h" |
| 14 |
| 15 namespace printing { |
| 16 |
| 17 class PrintBackendCUPS : public PrintBackend { |
| 18 public: |
| 19 PrintBackendCUPS(const GURL& print_server_url, |
| 20 http_encryption_t encryption, |
| 21 bool blocking); |
| 22 |
| 23 private: |
| 24 ~PrintBackendCUPS() override {} |
| 25 |
| 26 // PrintBackend implementation. |
| 27 bool EnumeratePrinters(PrinterList* printer_list) override; |
| 28 std::string GetDefaultPrinterName() override; |
| 29 bool GetPrinterBasicInfo(const std::string& printer_name, |
| 30 PrinterBasicInfo* printer_info) override; |
| 31 bool GetPrinterSemanticCapsAndDefaults( |
| 32 const std::string& printer_name, |
| 33 PrinterSemanticCapsAndDefaults* printer_info) override; |
| 34 bool GetPrinterCapsAndDefaults(const std::string& printer_name, |
| 35 PrinterCapsAndDefaults* printer_info) override; |
| 36 std::string GetPrinterDriverInfo(const std::string& printer_name) override; |
| 37 bool IsValidPrinter(const std::string& printer_name) override; |
| 38 |
| 39 // The following functions are wrappers around corresponding CUPS functions. |
| 40 // <functions>2() are called when print server is specified, and plain version |
| 41 // in another case. There is an issue specifying CUPS_HTTP_DEFAULT in the |
| 42 // functions>2(), it does not work in CUPS prior to 1.4. |
| 43 int GetDests(cups_dest_t** dests); |
| 44 base::FilePath GetPPD(const char* name); |
| 45 |
| 46 // Wrapper around cupsGetNamedDest(). Returned result should be freed with |
| 47 // cupsFreeDests(). |
| 48 cups_dest_t* GetNamedDest(const std::string& printer_name); |
| 49 |
| 50 GURL print_server_url_; |
| 51 http_encryption_t cups_encryption_; |
| 52 bool blocking_; |
| 53 }; |
| 54 |
| 55 } // namespace printing |
| 56 |
| 57 #endif // PRINTING_BACKEND_PRINT_BACKEND_CUPS_H_ |
OLD | NEW |