Chromium Code Reviews| Index: printing/backend/cups_jobs.h |
| diff --git a/printing/backend/cups_jobs.h b/printing/backend/cups_jobs.h |
| index b1ca693c82858288fdf01ebffc2f41eda426e141..42cb20ce946c52158777dcfe39579f1f742a18df 100644 |
| --- a/printing/backend/cups_jobs.h |
| +++ b/printing/backend/cups_jobs.h |
| @@ -10,6 +10,7 @@ |
| #include <cups/cups.h> |
| #include <string> |
| +#include <utility> |
| #include <vector> |
| #include "printing/printing_export.h" |
| @@ -110,6 +111,23 @@ struct PRINTING_EXPORT PrinterStatus { |
| std::string message; |
| }; |
| +struct PRINTING_EXPORT PrinterInfo { |
| + PrinterInfo(); |
| + PrinterInfo(const PrinterInfo& info); |
| + |
| + ~PrinterInfo(); |
| + |
| + // printer-make-and-model |
| + std::string make_and_model; |
| + |
| + // ipp-versions-supported |
| + // A collection of major, minor pairs. |
| + std::vector<std::pair<int, int>> ipp_versions; |
| + |
| + // Does ipp-features-supported contain 'ipp-everywhere'. |
| + bool ipp_everywhere = false; |
| +}; |
| + |
| // Specifies classes of jobs. |
| enum JobCompletionState { |
| COMPLETED, // only completed jobs |
| @@ -125,6 +143,13 @@ void ParseJobsResponse(ipp_t* response, |
| // Attempts to extract a PrinterStatus object out of |response|. |
| void ParsePrinterStatus(ipp_t* response, PrinterStatus* printer_status); |
| +// Queries the printer at |address| on |port| with a Get-Printer-Attributes |
| +// request to populate |printer_info|. Returns false if the request failed. |
|
Carlson
2017/05/25 19:04:36
This is a long latency function with no callback,
skau
2017/05/27 02:01:20
I've added a file comment since it applies to all
|
| +bool PRINTING_EXPORT GetPrinterInfo(const std::string& address, |
| + const int port, |
| + const std::string& resource, |
| + PrinterInfo* printer_info); |
| + |
| // Attempts to retrieve printer status using connection |http| for |printer_id|. |
| // Returns true if succcssful and updates the fields in |printer_status| as |
| // appropriate. Returns false if the request failed. |