blob: 7832aa65151032f4a802fa81aa35b7967d3378a1 [file] [log] [blame]
// Copyright 2020 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.
module printing.mojom;
import "printing/backend/mojom/print_backend.mojom";
import "printing/mojom/print.mojom";
// The default printer name, or the `ResultCode` if there was an error when
// trying to retrieve this data.
union DefaultPrinterNameResult {
string default_printer_name;
ResultCode result_code;
};
// The list of installed printers, or the `ResultCode` if there was an error
// when trying to retrieve this data.
union PrinterListResult {
array<PrinterBasicInfo> printer_list;
ResultCode result_code;
};
// The capabilities and defaults of a printer, or the `ResultCode` if there was
// an error when trying to retrieve this data.
union PrinterSemanticCapsAndDefaultsResult {
PrinterSemanticCapsAndDefaults printer_caps;
ResultCode result_code;
};
// The set of basic info, paper details, and capabilities/defaults for a
// printer.
struct PrinterCapsAndInfo {
PrinterBasicInfo printer_info;
array<Paper> user_defined_papers;
PrinterSemanticCapsAndDefaults printer_caps;
};
// The set of basic info, paper details, and capabilities/defaults for a
// printer, or the `ResultCode` if there was an error when trying to retrieve
// this data.
union PrinterCapsAndInfoResult {
PrinterCapsAndInfo printer_caps_and_info;
ResultCode result_code;
};
// The main interface to Chrome's Print Backend Service, which performs
// printer queries and commands to operating system printer drivers in an
// isolated process.
interface PrintBackendService {
// Establish the locale to be used for calls with this service and the
// interface to the underlying data source.
Init(string locale);
// TODO(crbug.com/1225111) Message with no arguments and no reply that is
// useful to ensure that an idle timeout change takes effect.
Poke();
// Enumerates the list of installed local and network printers.
EnumeratePrinters()
=> (PrinterListResult printer_list);
// Gets the default printer name from the data source.
GetDefaultPrinterName()
=> (DefaultPrinterNameResult printer_name);
// Gets the semantic capabilities and defaults for a specific printer.
GetPrinterSemanticCapsAndDefaults(string printer_name)
=> (PrinterSemanticCapsAndDefaultsResult printer_caps);
// Gets the basic info, paper sizes, and semantic capabilities and defaults
// for a specific printer.
FetchCapabilities(string printer_name)
=> (PrinterCapsAndInfoResult printer_caps_and_info);
};