Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: chrome/browser/chromeos/printing/cups_print_job.h

Issue 2435303003: [CUPS] Implement the Print Job notification. (Closed)
Patch Set: Fix the compile warning. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/printing/cups_print_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/printing/cups_print_job.h
diff --git a/chrome/browser/chromeos/printing/cups_print_job.h b/chrome/browser/chromeos/printing/cups_print_job.h
new file mode 100644
index 0000000000000000000000000000000000000000..36b9c73474351dfa7aabe658545b433b26775b72
--- /dev/null
+++ b/chrome/browser/chromeos/printing/cups_print_job.h
@@ -0,0 +1,78 @@
+// Copyright 2016 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 CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_
+#define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "chromeos/printing/printer_configuration.h"
+
+namespace chromeos {
+
+class CupsPrintJob {
+ public:
+ enum class State {
+ STATE_NONE,
+ STATE_WAITING,
+ STATE_STARTED,
+ STATE_PAGE_DONE,
+ STATE_CANCELLED,
+ STATE_SUSPENDED,
+ STATE_RESUMED,
+ STATE_DOCUMENT_DONE,
+ STATE_ERROR
+ };
+
+ enum class ErrorCode {
+ NO_ERROR,
+ PAPER_JAM,
+ OUT_OF_INK,
+ PRINTER_UNREACHABLE,
+ UNKNOWN_ERROR,
+ };
+
+ CupsPrintJob(const Printer& printer,
+ int job_id,
+ const std::string& document_title,
+ int total_page_number);
+ ~CupsPrintJob();
+
+ // Returns a unique id for the print job.
+ std::string GetUniqueId() const;
+
+ // Getters.
+ const Printer& printer() const { return printer_; }
+ int job_id() const { return job_id_; }
+ const std::string& document_title() const { return document_title_; }
+ int total_page_number() const { return total_page_number_; }
+ int printed_page_number() const { return printed_page_number_; }
+ State state() const { return state_; }
+ ErrorCode error_code() const { return error_code_; }
+
+ // Setters.
+ void set_printed_page_number(int page_number) {
+ printed_page_number_ = page_number;
+ }
+ void set_state(State state) { state_ = state; }
+ void set_error_code(ErrorCode error_code) { error_code_ = error_code; }
+
+ private:
+ Printer printer_;
+ int job_id_;
+
+ std::string document_title_;
+ int total_page_number_ = 0;
+ int printed_page_number_ = 0;
+
+ State state_ = State::STATE_NONE;
+ ErrorCode error_code_ = ErrorCode::NO_ERROR;
+
+ DISALLOW_COPY_AND_ASSIGN(CupsPrintJob);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_H_
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/printing/cups_print_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698