forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprinter_status.h
85 lines (73 loc) · 2 KB
/
printer_status.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PRINTING_PRINTER_STATUS_H_
#define PRINTING_PRINTER_STATUS_H_
#include <cups/cups.h>
#include <string>
#include <vector>
#include "printing/printing_export.h"
namespace printing {
// Represents the status of a printer containing the properties printer-state,
// printer-state-reasons, and printer-state-message.
struct PRINTING_EXPORT PrinterStatus {
struct PrinterReason {
// Standardized reasons from RFC2911.
enum class Reason {
UNKNOWN_REASON = 0,
NONE = 1,
MEDIA_NEEDED = 2,
MEDIA_JAM = 3,
MOVING_TO_PAUSED = 4,
PAUSED = 5,
SHUTDOWN = 6,
CONNECTING_TO_DEVICE = 7,
TIMED_OUT = 8,
STOPPING = 9,
STOPPED_PARTLY = 10,
TONER_LOW = 11,
TONER_EMPTY = 12,
SPOOL_AREA_FULL = 13,
COVER_OPEN = 14,
INTERLOCK_OPEN = 15,
DOOR_OPEN = 16,
INPUT_TRAY_MISSING = 17,
MEDIA_LOW = 18,
MEDIA_EMPTY = 19,
OUTPUT_TRAY_MISSING = 20,
OUTPUT_AREA_ALMOST_FULL = 21,
OUTPUT_AREA_FULL = 22,
MARKER_SUPPLY_LOW = 23,
MARKER_SUPPLY_EMPTY = 24,
MARKER_WASTE_ALMOST_FULL = 25,
MARKER_WASTE_FULL = 26,
FUSER_OVER_TEMP = 27,
FUSER_UNDER_TEMP = 28,
OPC_NEAR_EOL = 29,
OPC_LIFE_OVER = 30,
DEVELOPER_LOW = 31,
DEVELOPER_EMPTY = 32,
INTERPRETER_RESOURCE_UNAVAILABLE = 33
};
// Severity of the state-reason.
enum class Severity {
UNKNOWN_SEVERITY = 0,
REPORT = 1,
WARNING = 2,
ERROR = 3,
};
Reason reason;
Severity severity;
};
PrinterStatus();
PrinterStatus(const PrinterStatus& other);
~PrinterStatus();
// printer-state
ipp_pstate_t state;
// printer-state-reasons
std::vector<PrinterReason> reasons;
// printer-state-message
std::string message;
};
} // namespace printing
#endif // PRINTING_PRINTER_STATUS_H_