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 CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ |
| 6 #define CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 namespace chromeos { |
| 13 |
| 14 class Printer { |
| 15 public: |
| 16 // Represents a Postscript Printer Description with which the printer was |
| 17 // setup. |
| 18 struct PPDFile { |
| 19 // Identifier from the quirks server. -1 otherwise. |
| 20 int id; |
| 21 |
| 22 std::string file_name; |
| 23 |
| 24 // If there is a file with a later version on the quirks server, that file |
| 25 // should be used. The default value is 0. |
| 26 int version_number; |
| 27 |
| 28 // This will be true if the file was retrived from the quirks server. |
| 29 // Otherwise, the file was saved to disk by the user. |
| 30 bool from_quirks_server; |
| 31 }; |
| 32 |
| 33 // Constructs a printer object that is completely empty. |
| 34 Printer(); |
| 35 |
| 36 // Constructs a printer object with an id. |
| 37 explicit Printer(const std::string& id); |
| 38 |
| 39 ~Printer(); |
| 40 |
| 41 const std::string& id() const { return id_; } |
| 42 void set_id(const std::string& id) { id_ = id; } |
| 43 |
| 44 const std::string& display_name() const { return display_name_; } |
| 45 void set_display_name(const std::string& display_name) { |
| 46 display_name_ = display_name; |
| 47 } |
| 48 |
| 49 const std::string& description() const { return description_; } |
| 50 void set_description(const std::string& description) { |
| 51 description_ = description; |
| 52 } |
| 53 |
| 54 const std::string& manufacturer() const { return manufacturer_; } |
| 55 void set_manufacturer(const std::string& manufacturer) { |
| 56 manufacturer_ = manufacturer; |
| 57 } |
| 58 |
| 59 const std::string& model() const { return model_; } |
| 60 void set_model(const std::string& model) { model_ = model; } |
| 61 |
| 62 const std::string& uri() const { return uri_; } |
| 63 void set_uri(const std::string& uri) { uri_ = uri; } |
| 64 |
| 65 const PPDFile& ppd() const { return ppd_; } |
| 66 void set_ppd(const PPDFile& ppd) { ppd_ = ppd; } |
| 67 |
| 68 const std::string& uuid() const { return uuid_; } |
| 69 void set_uuid(const std::string& uuid) { uuid_ = uuid; } |
| 70 |
| 71 private: |
| 72 // Globally unique identifier. Empty indicates a new printer. |
| 73 std::string id_; |
| 74 |
| 75 // User defined string for printer identification. |
| 76 std::string display_name_; |
| 77 |
| 78 // User defined string for additional printer information. |
| 79 std::string description_; |
| 80 |
| 81 // The manufacturer of the printer, e.g. HP |
| 82 std::string manufacturer_; |
| 83 |
| 84 // The model of the printer, e.g. OfficeJet 415 |
| 85 std::string model_; |
| 86 |
| 87 // The full path for the printer. Suitable for configuration in CUPS. |
| 88 // Contains protocol, hostname, port, and queue. |
| 89 std::string uri_; |
| 90 |
| 91 // The associated postscript printer description. |
| 92 PPDFile ppd_; |
| 93 |
| 94 // The UUID from an autoconf protocol for deduplication. Could be empty. |
| 95 std::string uuid_; |
| 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(Printer); |
| 98 }; |
| 99 |
| 100 } // namespace chromeos |
| 101 |
| 102 #endif // CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ |
OLD | NEW |