blob: 7d86b5d409518dd317f524547cda3307fb540d40 [file] [log] [blame]
Gavin Williamsfc97ff02020-03-24 17:39:181// Copyright 2020 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
Daniel Hosseinian86d0cca42020-03-26 01:25:415#ifndef PRINTING_PRINTER_STATUS_H_
6#define PRINTING_PRINTER_STATUS_H_
Gavin Williamsfc97ff02020-03-24 17:39:187
8#include <cups/cups.h>
9
10#include <string>
11#include <vector>
12
Alan Screen9347cae2021-04-27 18:11:2413#include "base/component_export.h"
Gavin Williamsfc97ff02020-03-24 17:39:1814
15namespace printing {
16
17// Represents the status of a printer containing the properties printer-state,
18// printer-state-reasons, and printer-state-message.
Alan Screen04f4dfe2021-04-29 07:05:2519struct COMPONENT_EXPORT(PRINTING_BASE) PrinterStatus {
Gavin Williamsfc97ff02020-03-24 17:39:1820 struct PrinterReason {
Gavin Williams87f0bb72020-08-13 19:09:0021 // This enum is used to record UMA histogram values and should not be
22 // reordered. Please keep in sync with PrinterStatusReasons in
23 // src/tools/metrics/histograms/enums.xml.
Gavin Williams9e2aee052020-08-11 22:59:3524 enum class Reason {
Gavin Williams9653f482020-09-09 18:05:5025 kUnknownReason = 0,
26 kNone = 1,
27 kMediaNeeded = 2,
28 kMediaJam = 3,
29 kMovingToPaused = 4,
30 kPaused = 5,
31 kShutdown = 6,
32 kConnectingToDevice = 7,
33 kTimedOut = 8,
34 kStopping = 9,
35 kStoppedPartly = 10,
36 kTonerLow = 11,
37 kTonerEmpty = 12,
38 kSpoolAreaFull = 13,
39 kCoverOpen = 14,
40 kInterlockOpen = 15,
41 kDoorOpen = 16,
42 kInputTrayMissing = 17,
43 kMediaLow = 18,
44 kMediaEmpty = 19,
45 kOutputTrayMissing = 20,
46 kOutputAreaAlmostFull = 21,
47 kOutputAreaFull = 22,
48 kMarkerSupplyLow = 23,
49 kMarkerSupplyEmpty = 24,
50 kMarkerWasteAlmostFull = 25,
51 kMarkerWasteFull = 26,
52 kFuserOverTemp = 27,
53 kFuserUnderTemp = 28,
54 kOpcNearEol = 29,
55 kOpcLifeOver = 30,
56 kDeveloperLow = 31,
57 kDeveloperEmpty = 32,
58 kInterpreterResourceUnavailable = 33,
59 kMaxValue = kInterpreterResourceUnavailable
Gavin Williamsfc97ff02020-03-24 17:39:1860 };
61
62 // Severity of the state-reason.
Gavin Williams9e2aee052020-08-11 22:59:3563 enum class Severity {
Gavin Williams9653f482020-09-09 18:05:5064 kUnknownSeverity = 0,
65 kReport = 1,
66 kWarning = 2,
67 kError = 3,
Gavin Williams9e2aee052020-08-11 22:59:3568 };
Gavin Williamsfc97ff02020-03-24 17:39:1869
70 Reason reason;
71 Severity severity;
72 };
73
74 PrinterStatus();
75 PrinterStatus(const PrinterStatus& other);
76 ~PrinterStatus();
77
78 // printer-state
79 ipp_pstate_t state;
80 // printer-state-reasons
81 std::vector<PrinterReason> reasons;
82 // printer-state-message
83 std::string message;
84};
85
86} // namespace printing
87
Daniel Hosseinian86d0cca42020-03-26 01:25:4188#endif // PRINTING_PRINTER_STATUS_H_