Struct atspi_proxies::action::ActionProxy

source ·
pub struct ActionProxy<'p>(/* private fields */);
Expand description

A handle for a remote object implementing the org.a11y.atspi.Action interface.

The Action interface allows exploring and invoking the actions of a user-actionable UI component.

For example, a button may expose a “click” action - a popup menu may expose an “open” action.

Components which are not “passive” providers of UI information should implement this interface, unless there is a more specialized interface for interaction like org.a11y.atspi.Text or org.a11y.atspi.Value.

Implementations§

source§

impl<'p> ActionProxy<'p>

source

pub async fn new(conn: &Connection) -> Result<ActionProxy<'p>>

Creates a new proxy with the default service and path.

source

pub fn builder(conn: &Connection) -> Builder<'p, Self>

Returns a customizable builder for this proxy.

source

pub fn into_inner(self) -> Proxy<'p>

Consumes self, returning the underlying zbus::Proxy.

source

pub fn inner(&self) -> &Proxy<'p>

The reference to the underlying zbus::Proxy.

source

pub fn inner_mut(&mut self) -> &mut Proxy<'p>

The mutable reference to the underlying zbus::Proxy.

source

pub async fn do_action(&self, index: i32) -> Result<bool>

Performs the specified action on the object.

Returns: Ok(true) on success, Ok(false) otherwise.

§Arguments
  • index - The index of the action to perform.
source

pub async fn get_actions(&self) -> Result<Vec<(String, String, String)>>

Returns an array of localized name, localized description, keybinding for the actions that an object supports.

See get_key_binding method for a description of that field’s syntax.

This is equivalent to using the methods get_localized_name, get_description and get_key_binding for each action, but with a single call and thus less DBus traffic.

By convention, if there is more than one action available, the first one is considered the “default” action of the object.

source

pub async fn get_description(&self, index: i32) -> Result<String>

Returns the localized description for the action at the specified index, starting at zero.

For example, a screen reader will read out this description when the user asks for extra detail on an action. For example, “Clicks the button” for the “click” action of a button.

source

pub async fn get_key_binding(&self, index: i32) -> Result<String>

Returns the keybinding for the action, specified by a zero-based index.

Gets the keybinding which can be used to invoke this action, if one exists.

The string returned should contain localized, human-readable, key sequences as they would appear when displayed on screen. It must be in the format “mnemonic;sequence;shortcut”.

  • The mnemonic key activates the object if it is presently enabled on screen. This typically corresponds to the underlined letter within the widget. Example: “n” in a traditional “Ṉew…” menu item or the “a” in “Apply” for a button.

  • The sequence is the full list of keys which invoke the action even if the relevant element is not currently shown on screen. For instance, for a menu item the sequence is the keybindings used to open the parent menus before invoking.

The sequence string is colon-delimited. Example: “Alt+F:N” in a traditional “Ṉew…” menu item.

  • The shortcut, if it exists, will invoke the same action without showing the component or its enclosing menus or dialogs. Example: “Ctrl+N” in a traditional “Ṉew…” menu item. The shortcut string is colon-delimited. Example: “Ctrl+N” in a traditional “Ṉew…” menu item.

Example: For a traditional “Ṉew…” menu item, the expected return value would be: “N;Alt+F:N;Ctrl+N” for the English locale and “N;Alt+D:N;Strg+N” for the German locale. If, hypothetically, this menu item lacked a mnemonic, it would be represented by “;;Ctrl+N” and “;;Strg+N” respectively.

If there is no key binding for this action, “” is returned.

source

pub async fn get_localized_name(&self, index: i32) -> Result<String>

Returns a short, localized name for the action at the specified by a zero-based index.

This is what screen readers will read out during normal navigation. For example, “Click” for a button.

source

pub async fn get_name(&self, index: i32) -> Result<String>

Returns a machine-readable name for the action at the specified, zero-based index.

source

pub async fn nactions(&self) -> Result<i32>

Returns the number of available actions.

By convention, if there is more than one action available, the first one is considered the “default” action of the object.

source

pub fn cached_nactions( &self ) -> Result<Option<<Result<i32> as ResultAdapter>::Ok>, <Result<i32> as ResultAdapter>::Err>

Get the cached value of the Nactions property, or None if the property is not cached.

source

pub async fn receive_nactions_changed( &self ) -> PropertyStream<'p, <Result<i32> as ResultAdapter>::Ok>

Create a stream for the Nactions property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Trait Implementations§

source§

impl<'p> AsMut<Proxy<'p>> for ActionProxy<'p>

source§

fn as_mut(&mut self) -> &mut Proxy<'p>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<'p> AsRef<Proxy<'p>> for ActionProxy<'p>

source§

fn as_ref(&self) -> &Proxy<'p>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'p> Clone for ActionProxy<'p>

source§

fn clone(&self) -> ActionProxy<'p>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'p> Debug for ActionProxy<'p>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'p> From<Proxy<'p>> for ActionProxy<'p>

source§

fn from(proxy: Proxy<'p>) -> Self

Converts to this type from the input type.
source§

impl<'a> ProxyDefault for ActionProxy<'a>

source§

const INTERFACE: Option<&'static str> = _

source§

const DESTINATION: Option<&'static str> = _

source§

const PATH: Option<&'static str> = _

source§

impl<'p> ProxyImpl<'p> for ActionProxy<'p>

source§

fn builder(conn: &Connection) -> Builder<'p, Self>

Returns a customizable builder for this proxy.
source§

fn into_inner(self) -> Proxy<'p>

Consumes self, returning the underlying zbus::Proxy.
source§

fn inner(&self) -> &Proxy<'p>

The reference to the underlying zbus::Proxy.
source§

impl<'p> Serialize for ActionProxy<'p>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'p> Type for ActionProxy<'p>

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

§

impl<'p> Freeze for ActionProxy<'p>

§

impl<'p> !RefUnwindSafe for ActionProxy<'p>

§

impl<'p> Send for ActionProxy<'p>

§

impl<'p> Sync for ActionProxy<'p>

§

impl<'p> Unpin for ActionProxy<'p>

§

impl<'p> !UnwindSafe for ActionProxy<'p>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynamicType for T
where T: Type + ?Sized,

source§

fn dynamic_signature(&self) -> Signature<'_>

Get the signature for the implementing type. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more