#![allow(clippy::too_many_arguments)]
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 {
fn get_active_descendant(&self) -> zbus::Result<(String, zbus::zvariant::OwnedObjectPath)>;
fn get_matches(
&self,
rule: &MatchArgs<'_>,
sortby: SortOrder,
count: i32,
traverse: bool,
) -> zbus::Result<Vec<(String, zbus::zvariant::OwnedObjectPath)>>;
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)>>;
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;
}