objc2_app_kit/generated/
NSAccessibilityCustomAction.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/nsaccessibilitycustomaction?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSAccessibilityCustomAction;
15);
16
17unsafe impl NSObjectProtocol for NSAccessibilityCustomAction {}
18
19impl NSAccessibilityCustomAction {
20    extern_methods!(
21        #[cfg(feature = "block2")]
22        #[unsafe(method(initWithName:handler:))]
23        #[unsafe(method_family = init)]
24        pub unsafe fn initWithName_handler(
25            this: Allocated<Self>,
26            name: &NSString,
27            handler: Option<&block2::Block<dyn Fn() -> Bool>>,
28        ) -> Retained<Self>;
29
30        #[unsafe(method(initWithName:target:selector:))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn initWithName_target_selector(
33            this: Allocated<Self>,
34            name: &NSString,
35            target: &ProtocolObject<dyn NSObjectProtocol>,
36            selector: Sel,
37        ) -> Retained<Self>;
38
39        #[unsafe(method(name))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn name(&self) -> Retained<NSString>;
42
43        /// Setter for [`name`][Self::name].
44        #[unsafe(method(setName:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn setName(&self, name: &NSString);
47
48        #[cfg(feature = "block2")]
49        #[unsafe(method(handler))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn handler(&self) -> *mut block2::Block<dyn Fn() -> Bool>;
52
53        #[cfg(feature = "block2")]
54        /// Setter for [`handler`][Self::handler].
55        #[unsafe(method(setHandler:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn setHandler(&self, handler: Option<&block2::Block<dyn Fn() -> Bool>>);
58
59        #[unsafe(method(target))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn target(&self) -> Option<Retained<ProtocolObject<dyn NSObjectProtocol>>>;
62
63        /// This is a [weak property][objc2::topics::weak_property].
64        /// Setter for [`target`][Self::target].
65        #[unsafe(method(setTarget:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setTarget(&self, target: Option<&ProtocolObject<dyn NSObjectProtocol>>);
68
69        #[unsafe(method(selector))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn selector(&self) -> Option<Sel>;
72
73        /// Setter for [`selector`][Self::selector].
74        #[unsafe(method(setSelector:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setSelector(&self, selector: Option<Sel>);
77    );
78}
79
80/// Methods declared on superclass `NSObject`.
81impl NSAccessibilityCustomAction {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new() -> Retained<Self>;
90    );
91}