| Index: printing/backend/cups_jobs.h
|
| diff --git a/printing/backend/cups_jobs.h b/printing/backend/cups_jobs.h
|
| index b1ca693c82858288fdf01ebffc2f41eda426e141..8c0e4d4b703d8d2ee3fb5b5d44531fe15251ef32 100644
|
| --- a/printing/backend/cups_jobs.h
|
| +++ b/printing/backend/cups_jobs.h
|
| @@ -10,10 +10,16 @@
|
| #include <cups/cups.h>
|
|
|
| #include <string>
|
| +#include <utility>
|
| #include <vector>
|
|
|
| +#include "base/version.h"
|
| #include "printing/printing_export.h"
|
|
|
| +// This file contains a collection of functions used to query IPP printers or
|
| +// print servers and the related code to parse these responses. All Get*
|
| +// operations block on the network request and cannot be run on the UI thread.
|
| +
|
| namespace printing {
|
|
|
| // Represents a print job sent to the queue.
|
| @@ -110,6 +116,27 @@ 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;
|
| +
|
| + // document-format-supported
|
| + // MIME types for supported formats.
|
| + std::vector<std::string> document_formats;
|
| +
|
| + // ipp-versions-supported
|
| + // A collection of supported IPP protocol versions.
|
| + std::vector<base::Version> 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 +152,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.
|
| +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.
|
|
|