objc2-application-services 0.3.2

Bindings to the ApplicationServices framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;

use crate::*;

/// Error codes returned by accessibility functions.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/axerror?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AXError(pub i32);
impl AXError {
    /// No error occurred.
    #[doc(alias = "kAXErrorSuccess")]
    pub const Success: Self = Self(0);
    /// A system error occurred, such as the failure to allocate an object.
    #[doc(alias = "kAXErrorFailure")]
    pub const Failure: Self = Self(-25200);
    /// An illegal argument was passed to the function.
    #[doc(alias = "kAXErrorIllegalArgument")]
    pub const IllegalArgument: Self = Self(-25201);
    /// The AXUIElementRef passed to the function is invalid.
    #[doc(alias = "kAXErrorInvalidUIElement")]
    pub const InvalidUIElement: Self = Self(-25202);
    /// The AXObserverRef passed to the function is not a valid observer.
    #[doc(alias = "kAXErrorInvalidUIElementObserver")]
    pub const InvalidUIElementObserver: Self = Self(-25203);
    /// The function cannot complete because messaging failed in some way or because the application with which the function is communicating is busy or unresponsive.
    #[doc(alias = "kAXErrorCannotComplete")]
    pub const CannotComplete: Self = Self(-25204);
    /// The attribute is not supported by the AXUIElementRef.
    #[doc(alias = "kAXErrorAttributeUnsupported")]
    pub const AttributeUnsupported: Self = Self(-25205);
    /// The action is not supported by the AXUIElementRef.
    #[doc(alias = "kAXErrorActionUnsupported")]
    pub const ActionUnsupported: Self = Self(-25206);
    /// The notification is not supported by the AXUIElementRef.
    #[doc(alias = "kAXErrorNotificationUnsupported")]
    pub const NotificationUnsupported: Self = Self(-25207);
    /// Indicates that the function or method is not implemented (this can be returned if a process does not support the accessibility API).
    #[doc(alias = "kAXErrorNotImplemented")]
    pub const NotImplemented: Self = Self(-25208);
    /// This notification has already been registered for.
    #[doc(alias = "kAXErrorNotificationAlreadyRegistered")]
    pub const NotificationAlreadyRegistered: Self = Self(-25209);
    /// Indicates that a notification is not registered yet.
    #[doc(alias = "kAXErrorNotificationNotRegistered")]
    pub const NotificationNotRegistered: Self = Self(-25210);
    /// The accessibility API is disabled (as when, for example, the user deselects "Enable access for assistive devices" in Universal Access Preferences).
    #[doc(alias = "kAXErrorAPIDisabled")]
    pub const APIDisabled: Self = Self(-25211);
    /// The requested value or AXUIElementRef does not exist.
    #[doc(alias = "kAXErrorNoValue")]
    pub const NoValue: Self = Self(-25212);
    /// The parameterized attribute is not supported by the AXUIElementRef.
    #[doc(alias = "kAXErrorParameterizedAttributeUnsupported")]
    pub const ParameterizedAttributeUnsupported: Self = Self(-25213);
    /// Not enough precision.
    #[doc(alias = "kAXErrorNotEnoughPrecision")]
    pub const NotEnoughPrecision: Self = Self(-25214);
}

#[cfg(feature = "objc2")]
unsafe impl Encode for AXError {
    const ENCODING: Encoding = i32::ENCODING;
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for AXError {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}