objc2-accessibility 0.3.2

Bindings to the Accessibility framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

#[inline]
pub unsafe extern "C-unwind" fn AXPrefersHorizontalTextLayout() -> bool {
    extern "C-unwind" {
        fn AXPrefersHorizontalTextLayout() -> Bool;
    }
    unsafe { AXPrefersHorizontalTextLayout() }.as_bool()
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axprefershorizontaltextlayoutdidchangenotification?language=objc)
    pub static AXPrefersHorizontalTextLayoutDidChangeNotification: &'static NSNotificationName;
}

#[inline]
pub unsafe extern "C-unwind" fn AXAnimatedImagesEnabled() -> bool {
    extern "C-unwind" {
        fn AXAnimatedImagesEnabled() -> Bool;
    }
    unsafe { AXAnimatedImagesEnabled() }.as_bool()
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axanimatedimagesenableddidchangenotification?language=objc)
    pub static AXAnimatedImagesEnabledDidChangeNotification: &'static NSNotificationName;
}

/// Returns whether Assistive Access is running.
/// The value does not change during a process's lifetime, so it is not necessary to observe changes.
#[inline]
pub unsafe extern "C-unwind" fn AXAssistiveAccessEnabled() -> bool {
    extern "C-unwind" {
        fn AXAssistiveAccessEnabled() -> Bool;
    }
    unsafe { AXAssistiveAccessEnabled() }.as_bool()
}

#[inline]
pub unsafe extern "C-unwind" fn AXPrefersNonBlinkingTextInsertionIndicator() -> bool {
    extern "C-unwind" {
        fn AXPrefersNonBlinkingTextInsertionIndicator() -> Bool;
    }
    unsafe { AXPrefersNonBlinkingTextInsertionIndicator() }.as_bool()
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axprefersnonblinkingtextinsertionindicatordidchangenotification?language=objc)
    pub static AXPrefersNonBlinkingTextInsertionIndicatorDidChangeNotification:
        &'static NSNotificationName;
}

/// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axsettingsfeature?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AXSettingsFeature(pub NSInteger);
impl AXSettingsFeature {
    #[doc(alias = "AXSettingsFeaturePersonalVoiceAllowAppsToRequestToUse")]
    pub const PersonalVoiceAllowAppsToRequestToUse: Self = Self(1);
    #[doc(alias = "AXSettingsFeatureAllowAppsToAddAudioToCalls")]
    pub const AllowAppsToAddAudioToCalls: Self = Self(2);
    #[doc(alias = "AXSettingsFeatureAssistiveTouch")]
    pub const AssistiveTouch: Self = Self(3);
    #[doc(alias = "AXSettingsFeatureAssistiveTouchDevices")]
    pub const AssistiveTouchDevices: Self = Self(4);
    #[doc(alias = "AXSettingsFeatureDwellControl")]
    pub const DwellControl: Self = Self(5);
}

unsafe impl Encode for AXSettingsFeature {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for AXSettingsFeature {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern "C-unwind" {
    #[cfg(feature = "block2")]
    pub fn AXOpenSettingsFeature(
        feature: AXSettingsFeature,
        completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
    );
}