//! # `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.
//!

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

#[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: &(
            &[i32],
            MatchType,
            std::collections::HashMap<&str, &str>,
            MatchType,
            &[i32],
            MatchType,
            &[&str],
            MatchType,
            bool,
        ),
        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: &(
            &[i32],
            MatchType,
            std::collections::HashMap<&str, &str>,
            MatchType,
            &[i32],
            MatchType,
            &[&str],
            MatchType,
            bool,
        ),
        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: &(
            &[i32],
            MatchType,
            std::collections::HashMap<&str, &str>,
            MatchType,
            &[i32],
            MatchType,
            &[&str],
            MatchType,
            bool,
        ),
        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;
}