chromium/out/Default/gen/extensions/common/api/printer_provider.h

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// GENERATED FROM THE API DEFINITION IN
//   extensions/common/api/printer_provider.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_PRINTER_PROVIDER_H__
#define EXTENSIONS_COMMON_API_PRINTER_PROVIDER_H__

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/values.h"
#include <string_view>
#include "extensions/common/api/usb.h"


namespace extensions {
namespace api {
namespace printer_provider {

//
// Types
//

// Error codes returned in response to $(ref:onPrintRequested) event.
enum class PrintError {};


const char* ToString(PrintError as_enum);
PrintError ParsePrintError(std::string_view as_string);
std::u16string GetPrintErrorParseError(std::string_view as_string);

struct PrinterInfo {};

struct PrintJob {};


//
// Events
//

namespace OnGetPrintersRequested {

extern const char kEventName[];  // "printerProvider.onGetPrintersRequested"

// Callback to return printer list. Every listener must call callback exactly
// once.
base::Value::List Create(base::Value::Dict result_callback);
}  // namespace OnGetPrintersRequested

namespace OnGetUsbPrinterInfoRequested {

extern const char kEventName[];  // "printerProvider.onGetUsbPrinterInfoRequested"

// The USB device.
// Callback to return printer info. The receiving listener must call callback
// exactly once. If the parameter to this callback is undefined that indicates
// that the application has determined that the device is not supported.
base::Value::List Create(const extensions::api::usb::Device& device, base::Value::Dict result_callback);
}  // namespace OnGetUsbPrinterInfoRequested

namespace OnGetCapabilityRequested {

extern const char kEventName[];  // "printerProvider.onGetCapabilityRequested"

// Unique ID of the printer whose capabilities are requested.
// Callback to return device capabilities in <a
// href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD format</a>.
// The receiving listener must call callback exectly once.
base::Value::List Create(const std::string& printer_id, base::Value::Dict result_callback);
}  // namespace OnGetCapabilityRequested

namespace OnPrintRequested {

extern const char kEventName[];  // "printerProvider.onPrintRequested"

// The printing request parameters.
// Callback that should be called when the printing request is completed.
base::Value::List Create(const PrintJob& print_job, base::Value::Dict result_callback);
}  // namespace OnPrintRequested

}  // namespace printer_provider
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_PRINTER_PROVIDER_H__