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 CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace chromeos { | |
11 | |
12 // Represents a Postscript Printer Description with which the printer was setup. | |
13 struct PPDFile { | |
14 // Identifier from the quirks server. -1 otherwise. | |
stevenjb
2016/07/29 16:56:50
nit: Typically we only use a single space between
skau
2016/08/01 19:37:19
Done.
| |
15 int id; | |
16 | |
17 std::string file_name; | |
18 | |
19 // If there is a file with a later version on the quirks server, that file | |
20 // should be used. The default value is 0. | |
21 int version_number; | |
22 | |
23 // This will be true if the file was retrived from the quirks server. | |
24 // Otherwise, the file was saved to disk by the user. | |
25 bool from_quirks_server; | |
26 }; | |
stevenjb
2016/07/29 16:56:50
Can we embed this in the Printer class instead of
skau
2016/08/01 19:37:19
Done.
| |
27 | |
28 class Printer { | |
29 public: | |
30 Printer(); | |
stevenjb
2016/07/29 16:56:50
Do we need a default constructor?
skau
2016/08/01 19:37:19
I think it's clearer than constructing it with an
stevenjb
2016/08/01 20:48:16
Generally we try to avoid multiple constructors si
skau
2016/08/01 21:10:10
The use cases are different so I'm going to leave
| |
31 explicit Printer(const std::string& id); | |
32 | |
33 ~Printer(); | |
34 | |
35 const std::string& id() const { return id_; } | |
36 void set_id(const std::string& id) { id_ = id; } | |
37 | |
38 const std::string& display_name() const { return display_name_; } | |
39 void set_display_name(const std::string& display_name) { | |
40 display_name_ = display_name; | |
41 } | |
42 | |
43 const std::string& description() const { return description_; } | |
44 void set_description(const std::string& description) { | |
45 description_ = description; | |
46 } | |
47 | |
48 const std::string& manufacturer() const { return manufacturer_; } | |
49 void set_manufacturer(const std::string& manufacturer) { | |
50 manufacturer_ = manufacturer; | |
51 } | |
52 | |
53 const std::string& model() const { return model_; } | |
54 void set_model(const std::string& model) { model_ = model; } | |
55 | |
56 const std::string& uri() const { return uri_; } | |
57 void set_uri(const std::string& uri) { uri_ = uri; } | |
58 | |
59 const PPDFile& ppd() const { return ppd_; } | |
60 void set_ppd(const PPDFile& ppd) { ppd_ = ppd; } | |
61 | |
62 const std::string& uuid() const { return uuid_; } | |
63 void set_uuid(const std::string& uuid) { uuid_ = uuid; } | |
64 | |
65 private: | |
66 // Globally unique identifier. Empty indicates a new printer. | |
67 std::string id_; | |
68 | |
69 // User defined string for printer identification. | |
70 std::string display_name_; | |
71 | |
72 // User defined string for additional printer information. | |
73 std::string description_; | |
74 | |
75 // The manufacturer of the printer. e.g. HP | |
stevenjb
2016/07/29 16:56:50
punctuation nit: ', e.g. HP.'
skau
2016/08/01 19:37:19
Done.
| |
76 std::string manufacturer_; | |
77 | |
78 // The model of the printer. e.g. OfficeJet 415 | |
stevenjb
2016/07/29 16:56:50
ditto
skau
2016/08/01 19:37:19
Done.
| |
79 std::string model_; | |
80 | |
81 // The full path for the printer. Suitable for configuration in CUPS. | |
82 // Contains protocol, hostname, port, and queue. | |
83 std::string uri_; | |
84 | |
85 // The associated postscript printer description. | |
86 PPDFile ppd_; | |
87 | |
88 // The UUID from an autoconf protocol for deduplication. Could be empty. | |
89 std::string uuid_; | |
stevenjb
2016/07/29 16:56:50
DISALLOW_COPY_AND_ASSIGN
skau
2016/08/01 19:37:19
Done.
| |
90 }; | |
91 | |
92 } // namespace chromeos | |
93 | |
94 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_CONFIGURATION_H_ | |
OLD | NEW |