objc2_app_kit/generated/
NSActionCell.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/nsactioncell?language=objc)
12    #[unsafe(super(NSCell, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSCell")]
15    pub struct NSActionCell;
16);
17
18#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
19extern_conformance!(
20    unsafe impl NSAccessibility for NSActionCell {}
21);
22
23#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
24extern_conformance!(
25    unsafe impl NSAccessibilityElementProtocol for NSActionCell {}
26);
27
28#[cfg(feature = "NSCell")]
29extern_conformance!(
30    unsafe impl NSCoding for NSActionCell {}
31);
32
33#[cfg(feature = "NSCell")]
34extern_conformance!(
35    unsafe impl NSCopying for NSActionCell {}
36);
37
38#[cfg(feature = "NSCell")]
39unsafe impl CopyingHelper for NSActionCell {
40    type Result = Self;
41}
42
43#[cfg(feature = "NSCell")]
44extern_conformance!(
45    unsafe impl NSObjectProtocol for NSActionCell {}
46);
47
48#[cfg(all(feature = "NSCell", feature = "NSUserInterfaceItemIdentification"))]
49extern_conformance!(
50    unsafe impl NSUserInterfaceItemIdentification for NSActionCell {}
51);
52
53#[cfg(feature = "NSCell")]
54impl NSActionCell {
55    extern_methods!(
56        #[unsafe(method(target))]
57        #[unsafe(method_family = none)]
58        pub fn target(&self) -> Option<Retained<AnyObject>>;
59
60        /// Setter for [`target`][Self::target].
61        ///
62        /// This is a [weak property][objc2::topics::weak_property].
63        ///
64        /// # Safety
65        ///
66        /// `target` should be of the correct type.
67        #[unsafe(method(setTarget:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
70
71        #[unsafe(method(action))]
72        #[unsafe(method_family = none)]
73        pub fn action(&self) -> Option<Sel>;
74
75        /// Setter for [`action`][Self::action].
76        ///
77        /// # Safety
78        ///
79        /// `action` must be a valid selector.
80        #[unsafe(method(setAction:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn setAction(&self, action: Option<Sel>);
83
84        #[unsafe(method(tag))]
85        #[unsafe(method_family = none)]
86        pub fn tag(&self) -> NSInteger;
87
88        /// Setter for [`tag`][Self::tag].
89        #[unsafe(method(setTag:))]
90        #[unsafe(method_family = none)]
91        pub fn setTag(&self, tag: NSInteger);
92    );
93}
94
95/// Methods declared on superclass `NSCell`.
96#[cfg(feature = "NSCell")]
97impl NSActionCell {
98    extern_methods!(
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(initTextCell:))]
104        #[unsafe(method_family = init)]
105        pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
106
107        #[cfg(feature = "NSImage")]
108        #[unsafe(method(initImageCell:))]
109        #[unsafe(method_family = init)]
110        pub fn initImageCell(this: Allocated<Self>, image: Option<&NSImage>) -> Retained<Self>;
111
112        /// # Safety
113        ///
114        /// `coder` possibly has further requirements.
115        #[unsafe(method(initWithCoder:))]
116        #[unsafe(method_family = init)]
117        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
118    );
119}
120
121/// Methods declared on superclass `NSObject`.
122#[cfg(feature = "NSCell")]
123impl NSActionCell {
124    extern_methods!(
125        #[unsafe(method(new))]
126        #[unsafe(method_family = new)]
127        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
128    );
129}