[go: up one dir, main page]

atspi 0.10.1

Pure-Rust, zbus-based AT-SPI2 protocol implementation.
Documentation
//! # `DBus` interface proxy for: `org.a11y.atspi.Collection`
//!
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
//! Source: `Collection.xml`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
//! section of the zbus documentation.
//!
#![allow(clippy::too_many_arguments)]
// this allow zbus to change the number of parameters in a function without setting off clippy

use serde::{Deserialize, Serialize};
use zbus::{dbus_proxy, zvariant::Type};

pub type MatchArgs<'a> = (
	&'a [i32],
	MatchType,
	std::collections::HashMap<&'a str, &'a str>,
	MatchType,
	&'a [i32],
	MatchType,
	&'a [&'a str],
	MatchType,
	bool,
);

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
#[repr(u32)]
pub enum SortOrder {
	Invalid,
	Canonical,
	Flow,
	Tab,
	ReverseCanonical,
	ReverseFlow,
	ReverseTab,
	LastDefined,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
#[repr(u32)]
pub enum TreeTraversalType {
	RestrictChildren,
	RestrictSibling,
	Inorder,
	LastDefined,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
#[repr(i32)]
pub enum MatchType {
	Invalid,
	All,
	Any,
	NA,
	Empty,
	LastDefined,
}

#[dbus_proxy(interface = "org.a11y.atspi.Collection", assume_defaults = true)]
trait Collection {
	/// GetActiveDescendant method
	fn get_active_descendant(&self) -> zbus::Result<(String, zbus::zvariant::OwnedObjectPath)>;

	/* ROLE fields:
	  &[i32]: AtspiStateSet,
	  i32: AtspiCollectionMatchType,
	  HashMap<&str, &str>: attributes,
	  i32: AtspiCollectionMatchType (attribute match type),
	  &[i32]: roles,
	  i32: AtspiCollectionMatchType (role match type),
	  &[&str]: interfaces,
	  i32: AtspiCollectionMatchType (interface match type),
	  bool: invert
	*/
	/// GetMatches method
	fn get_matches(
		&self,
		rule: &MatchArgs<'_>,
		sortby: SortOrder,
		count: i32,
		traverse: bool,
	) -> zbus::Result<Vec<(String, zbus::zvariant::OwnedObjectPath)>>;

	/// GetMatchesFrom method
	fn get_matches_from(
		&self,
		current_object: &zbus::zvariant::ObjectPath<'_>,
		rule: &MatchArgs<'_>,
		sortby: SortOrder,
		tree: TreeTraversalType,
		count: i32,
		traverse: bool,
	) -> zbus::Result<Vec<(String, zbus::zvariant::OwnedObjectPath)>>;

	/// GetMatchesTo method
	fn get_matches_to(
		&self,
		current_object: &zbus::zvariant::ObjectPath<'_>,
		rule: &MatchArgs<'_>,
		sortby: SortOrder,
		tree: TreeTraversalType,
		limit_scope: bool,
		count: i32,
		traverse: bool,
	) -> zbus::Result<Vec<(String, zbus::zvariant::OwnedObjectPath)>>;
}
use crate::{AtspiProxy, Interface};
impl<'a> AtspiProxy for CollectionProxy<'a> {
	const INTERFACE: Interface = Interface::Collection;
}