objc2_app_kit/generated/
NSAccessibilityElement.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsaccessibilityelement?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSAccessibilityElement;
15);
16
17#[cfg(feature = "NSAccessibilityProtocols")]
18extern_conformance!(
19    unsafe impl NSAccessibility for NSAccessibilityElement {}
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for NSAccessibilityElement {}
24);
25
26impl NSAccessibilityElement {
27    extern_methods!(
28        #[cfg(feature = "NSAccessibilityConstants")]
29        /// # Safety
30        ///
31        /// `parent` should be of the correct type.
32        #[unsafe(method(accessibilityElementWithRole:frame:label:parent:))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn accessibilityElementWithRole_frame_label_parent(
35            role: &NSAccessibilityRole,
36            frame: NSRect,
37            label: Option<&NSString>,
38            parent: Option<&AnyObject>,
39        ) -> Retained<AnyObject>;
40
41        #[unsafe(method(accessibilityAddChildElement:))]
42        #[unsafe(method_family = none)]
43        pub fn accessibilityAddChildElement(&self, child_element: &NSAccessibilityElement);
44
45        #[unsafe(method(accessibilityFrameInParentSpace))]
46        #[unsafe(method_family = none)]
47        pub fn accessibilityFrameInParentSpace(&self) -> NSRect;
48
49        /// Setter for [`accessibilityFrameInParentSpace`][Self::accessibilityFrameInParentSpace].
50        #[unsafe(method(setAccessibilityFrameInParentSpace:))]
51        #[unsafe(method_family = none)]
52        pub fn setAccessibilityFrameInParentSpace(
53            &self,
54            accessibility_frame_in_parent_space: NSRect,
55        );
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60impl NSAccessibilityElement {
61    extern_methods!(
62        #[unsafe(method(init))]
63        #[unsafe(method_family = init)]
64        pub fn init(this: Allocated<Self>) -> Retained<Self>;
65
66        #[unsafe(method(new))]
67        #[unsafe(method_family = new)]
68        pub fn new() -> Retained<Self>;
69    );
70}
71
72impl DefaultRetained for NSAccessibilityElement {
73    #[inline]
74    fn default_retained() -> Retained<Self> {
75        Self::new()
76    }
77}