printer_status.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // 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. #ifndef PRINTING_PRINTER_STATUS_H_
  5. #define PRINTING_PRINTER_STATUS_H_
  6. #include <cups/cups.h>
  7. #include <string>
  8. #include <vector>
  9. #include "base/component_export.h"
  10. namespace printing {
  11. // Represents the status of a printer containing the properties printer-state,
  12. // printer-state-reasons, and printer-state-message.
  13. struct COMPONENT_EXPORT(PRINTING_BASE) PrinterStatus {
  14. struct PrinterReason {
  15. // This enum is used to record UMA histogram values and should not be
  16. // reordered. Please keep in sync with PrinterStatusReasons in
  17. // src/tools/metrics/histograms/enums.xml.
  18. enum class Reason {
  19. kUnknownReason = 0,
  20. kNone = 1,
  21. kMediaNeeded = 2,
  22. kMediaJam = 3,
  23. kMovingToPaused = 4,
  24. kPaused = 5,
  25. kShutdown = 6,
  26. kConnectingToDevice = 7,
  27. kTimedOut = 8,
  28. kStopping = 9,
  29. kStoppedPartly = 10,
  30. kTonerLow = 11,
  31. kTonerEmpty = 12,
  32. kSpoolAreaFull = 13,
  33. kCoverOpen = 14,
  34. kInterlockOpen = 15,
  35. kDoorOpen = 16,
  36. kInputTrayMissing = 17,
  37. kMediaLow = 18,
  38. kMediaEmpty = 19,
  39. kOutputTrayMissing = 20,
  40. kOutputAreaAlmostFull = 21,
  41. kOutputAreaFull = 22,
  42. kMarkerSupplyLow = 23,
  43. kMarkerSupplyEmpty = 24,
  44. kMarkerWasteAlmostFull = 25,
  45. kMarkerWasteFull = 26,
  46. kFuserOverTemp = 27,
  47. kFuserUnderTemp = 28,
  48. kOpcNearEol = 29,
  49. kOpcLifeOver = 30,
  50. kDeveloperLow = 31,
  51. kDeveloperEmpty = 32,
  52. kInterpreterResourceUnavailable = 33,
  53. kMaxValue = kInterpreterResourceUnavailable
  54. };
  55. // Severity of the state-reason.
  56. enum class Severity {
  57. kUnknownSeverity = 0,
  58. kReport = 1,
  59. kWarning = 2,
  60. kError = 3,
  61. };
  62. Reason reason;
  63. Severity severity;
  64. };
  65. PrinterStatus();
  66. PrinterStatus(const PrinterStatus& other);
  67. ~PrinterStatus();
  68. // printer-state
  69. ipp_pstate_t state;
  70. // printer-state-reasons
  71. std::vector<PrinterReason> reasons;
  72. // printer-state-message
  73. std::string message;
  74. };
  75. } // namespace printing
  76. #endif // PRINTING_PRINTER_STATUS_H_