#![allow(missing_docs)]
use serde::{Deserialize, Serialize};
use zbus::proxy;
use zbus::zvariant::Type;
#[derive(Debug, Clone, Deserialize, Serialize, Type)]
pub struct RawOption {
pub option_name: String,
pub group_name: String,
pub default_value: String,
pub num_supported: i32,
pub supported_values: Vec<(String,)>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Type)]
pub struct RawMargin {
pub left: i32,
pub right: i32,
pub top: i32,
pub bottom: i32,
}
#[derive(Debug, Clone, Deserialize, Serialize, Type)]
pub struct RawMedia {
pub name: String,
pub width: i32,
pub length: i32,
pub num_margins: i32,
pub margins: Vec<RawMargin>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Type)]
pub struct RawPrinter(
pub String, pub String, pub String, pub String, pub String, pub bool, pub String, pub String, );
#[allow(missing_docs)]
#[proxy(interface = "org.openprinting.PrintBackend", assume_defaults = true)]
pub trait PrintBackend {
fn get_all_printers(&self) -> zbus::Result<(i32, Vec<(zbus::zvariant::OwnedValue,)>)>;
fn get_backend_name(&self) -> zbus::Result<String>;
fn get_filtered_printer_list(&self) -> zbus::Result<(i32, Vec<(zbus::zvariant::OwnedValue,)>)>;
#[zbus(name = "doListing", no_reply)]
fn do_listing(&self, is_listed: bool) -> zbus::Result<()>;
#[allow(clippy::type_complexity)]
fn get_all_options(
&self,
printer_id: &str,
) -> zbus::Result<(i32, Vec<RawOption>, i32, Vec<RawMedia>)>;
fn get_all_translations(
&self,
printer_id: &str,
locale: &str,
) -> zbus::Result<std::collections::HashMap<String, String>>;
#[zbus(name = "getDefaultPrinter")]
fn get_default_printer(&self) -> zbus::Result<String>;
#[zbus(name = "getPrinterState")]
fn get_printer_state(&self, printer_id: &str) -> zbus::Result<String>;
#[zbus(name = "isAcceptingJobs")]
fn is_accepting_jobs(&self, printer_id: &str) -> zbus::Result<bool>;
#[zbus(name = "getOptionTranslation")]
fn get_option_translation(
&self,
printer_name: &str,
option_name: &str,
locale: &str,
) -> zbus::Result<String>;
#[zbus(name = "getChoiceTranslation")]
fn get_choice_translation(
&self,
printer_name: &str,
option_name: &str,
choice_name: &str,
locale: &str,
) -> zbus::Result<String>;
#[zbus(name = "getGroupTranslation")]
fn get_group_translation(
&self,
printer_name: &str,
group_name: &str,
locale: &str,
) -> zbus::Result<String>;
#[zbus(name = "printFd")]
fn print_fd(
&self,
printer_id: &str,
num_settings: i32,
settings: &[(&str, &str)],
title: &str,
) -> zbus::Result<(String, zbus::zvariant::OwnedFd)>;
#[zbus(name = "printSocket")]
fn print_socket(
&self,
printer_id: &str,
num_settings: i32,
settings: &[(&str, &str)],
title: &str,
) -> zbus::Result<(String, String)>;
#[zbus(name = "showRemotePrinters", no_reply)]
fn show_remote_printers(&self, is_visible: bool) -> zbus::Result<()>;
#[zbus(name = "showTemporaryPrinters", no_reply)]
fn show_temporary_printers(&self, is_visible: bool) -> zbus::Result<()>;
#[zbus(name = "keepAlive")]
fn keep_alive(&self) -> zbus::Result<()>;
#[zbus(name = "replace", no_reply)]
fn replace(&self, previous_dialog_id: &str) -> zbus::Result<()>;
#[zbus(name = "ping", no_reply)]
fn ping(&self, printer_id: &str) -> zbus::Result<()>;
#[zbus(signal)]
fn printer_added(
&self,
printer_id: &str,
printer_name: &str,
printer_info: &str,
printer_location: &str,
printer_make_and_model: &str,
printer_is_accepting_jobs: bool,
printer_state: &str,
backend_name: &str,
) -> zbus::Result<()>;
#[zbus(signal)]
fn printer_removed(&self, printer_id: &str, backend_name: &str) -> zbus::Result<()>;
#[zbus(signal)]
fn printer_state_changed(
&self,
printer_id: &str,
printer_state: &str,
printer_is_accepting_jobs: bool,
backend_name: &str,
) -> zbus::Result<()>;
}