[go: nahoru, domu]

blob: 40e54dedfff59662c8888c53ac106258bcd8eb94 [file] [log] [blame]
tbarzic1378bc32015-02-25 21:41:221// Copyright 2015 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
5#ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_
6#define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_
7
8#include <string>
9
tbarzic1378bc32015-02-25 21:41:2210#include "base/memory/ref_counted.h"
11#include "base/memory/ref_counted_memory.h"
tbarzic170b95c2015-03-26 00:05:2612#include "base/strings/string16.h"
Vladislav Kuzkokov89356b642019-01-29 19:51:3513#include "base/values.h"
tbarzic1378bc32015-02-25 21:41:2214
15namespace extensions {
16
17// Struct describing print job that should be forwarded to an extension via
18// chrome.printerProvider.onPrintRequested event.
Lei Zhang64161dd2018-04-27 00:24:0619// TODO(tbarzic): This should probably be a class and have some methods.
tbarzic1378bc32015-02-25 21:41:2220struct PrinterProviderPrintJob {
21 PrinterProviderPrintJob();
Vladislav Kuzkokov89356b642019-01-29 19:51:3522 PrinterProviderPrintJob(PrinterProviderPrintJob&& other);
23 PrinterProviderPrintJob& operator=(PrinterProviderPrintJob&& other);
tbarzic1378bc32015-02-25 21:41:2224 ~PrinterProviderPrintJob();
25
26 // The id of the printer that should handle the print job. The id is
27 // formatted as <extension_id>:<printer_id>, where <extension_id> is the
28 // id of the extension that manages the printer, and <printer_id> is
29 // the the printer's id within the extension (as reported via
30 // chrome.printerProvider.onGetPrintersRequested event callback).
31 std::string printer_id;
32
tbarzic170b95c2015-03-26 00:05:2633 // The print job title.
Jan Wilken Dörrie85285b02021-03-11 23:38:4734 std::u16string job_title;
tbarzic170b95c2015-03-26 00:05:2635
tbarzic1378bc32015-02-25 21:41:2236 // The print job ticket.
Vladislav Kuzkokov89356b642019-01-29 19:51:3537 base::Value ticket;
tbarzic1378bc32015-02-25 21:41:2238
39 // Content type of the document that should be printed.
40 std::string content_type;
41
Lei Zhang64161dd2018-04-27 00:24:0642 // The document data that should be printed.
tbarzic1378bc32015-02-25 21:41:2243 scoped_refptr<base::RefCountedMemory> document_bytes;
Vladislav Kuzkokov89356b642019-01-29 19:51:3544
45 private:
46 DISALLOW_COPY_AND_ASSIGN(PrinterProviderPrintJob);
tbarzic1378bc32015-02-25 21:41:2247};
48
49} // namespace extensions
50
51#endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_PRINTER_PROVIDER_PRINT_JOB_H_