objc2_app_kit/generated/
NSTableViewRowAction.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
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableviewrowactionstyle?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSTableViewRowActionStyle(pub NSInteger);
15impl NSTableViewRowActionStyle {
16    #[doc(alias = "NSTableViewRowActionStyleRegular")]
17    pub const Regular: Self = Self(0);
18    #[doc(alias = "NSTableViewRowActionStyleDestructive")]
19    pub const Destructive: Self = Self(1);
20}
21
22unsafe impl Encode for NSTableViewRowActionStyle {
23    const ENCODING: Encoding = NSInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NSTableViewRowActionStyle {
27    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableviewrowaction?language=objc)
32    #[unsafe(super(NSObject))]
33    #[derive(Debug, PartialEq, Eq, Hash)]
34    pub struct NSTableViewRowAction;
35);
36
37unsafe impl NSCopying for NSTableViewRowAction {}
38
39unsafe impl CopyingHelper for NSTableViewRowAction {
40    type Result = Self;
41}
42
43unsafe impl NSObjectProtocol for NSTableViewRowAction {}
44
45impl NSTableViewRowAction {
46    extern_methods!(
47        #[cfg(feature = "block2")]
48        #[unsafe(method(rowActionWithStyle:title:handler:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn rowActionWithStyle_title_handler(
51            style: NSTableViewRowActionStyle,
52            title: &NSString,
53            handler: &block2::Block<dyn Fn(NonNull<NSTableViewRowAction>, NSInteger)>,
54        ) -> Retained<Self>;
55
56        #[unsafe(method(style))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn style(&self) -> NSTableViewRowActionStyle;
59
60        #[unsafe(method(title))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn title(&self) -> Retained<NSString>;
63
64        /// Setter for [`title`][Self::title].
65        #[unsafe(method(setTitle:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setTitle(&self, title: &NSString);
68
69        #[cfg(feature = "NSColor")]
70        #[unsafe(method(backgroundColor))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
73
74        #[cfg(feature = "NSColor")]
75        /// Setter for [`backgroundColor`][Self::backgroundColor].
76        #[unsafe(method(setBackgroundColor:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setBackgroundColor(&self, background_color: Option<&NSColor>);
79
80        #[cfg(feature = "NSImage")]
81        #[unsafe(method(image))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
84
85        #[cfg(feature = "NSImage")]
86        /// Setter for [`image`][Self::image].
87        #[unsafe(method(setImage:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn setImage(&self, image: Option<&NSImage>);
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl NSTableViewRowAction {
95    extern_methods!(
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}