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

Unified Diff: printing/backend/cups_connection.h

Issue 2691093006: Implement IPP Get-Jobs and Get-Printer-Attributes requests. (Closed)
Patch Set: use a const array Created 3 years, 9 months 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 | « printing/BUILD.gn ('k') | printing/backend/cups_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/backend/cups_connection.h
diff --git a/printing/backend/cups_connection.h b/printing/backend/cups_connection.h
index fe8a7a23f90e87e993f70964912bfcbdb9ed089b..0f0475e405c2379168733cc49d6a0f8561daa5a1 100644
--- a/printing/backend/cups_connection.h
+++ b/printing/backend/cups_connection.h
@@ -14,29 +14,17 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "printing/backend/cups_deleters.h"
+#include "printing/backend/cups_jobs.h"
#include "printing/backend/cups_printer.h"
#include "printing/printing_export.h"
#include "url/gurl.h"
namespace printing {
-// Represents a print job sent to the queue.
-struct PRINTING_EXPORT CupsJob {
- enum JobState {
- UNKNOWN,
- PENDING,
- HELD,
- COMPLETED,
- PROCESSING,
- STOPPED,
- CANCELED,
- ABORTED
- };
-
- int id;
- std::string title;
- std::string printer_id;
- JobState state;
+// Represents the status of a printer queue.
+struct PRINTING_EXPORT QueueStatus {
+ PrinterStatus printer_status;
+ std::vector<CupsJob> jobs;
};
// Represents a connection to a CUPS server.
@@ -56,8 +44,12 @@ class PRINTING_EXPORT CupsConnection {
// Returns a printer for |printer_name| from the connected server.
std::unique_ptr<CupsPrinter> GetPrinter(const std::string& printer_name);
- // Returns a list of print jobs from all connected printers.
- std::vector<CupsJob> GetJobs();
+ // Queries CUPS for printer queue status for |printer_ids|. Populates |jobs|
+ // with said information with one QueueStatus per printer_id. Returns true if
+ // all the queries were successful. In the event of failure, |jobs| will be
+ // unchanged.
+ bool GetJobs(const std::vector<std::string>& printer_ids,
+ std::vector<QueueStatus>* jobs);
std::string server_name() const;
« no previous file with comments | « printing/BUILD.gn ('k') | printing/backend/cups_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698