objc2_app_kit/generated/
NSTableViewRowAction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[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 #[unsafe(super(NSObject))]
33 #[derive(Debug, PartialEq, Eq, Hash)]
34 pub struct NSTableViewRowAction;
35);
36
37extern_conformance!(
38 unsafe impl NSCopying for NSTableViewRowAction {}
39);
40
41unsafe impl CopyingHelper for NSTableViewRowAction {
42 type Result = Self;
43}
44
45extern_conformance!(
46 unsafe impl NSObjectProtocol for NSTableViewRowAction {}
47);
48
49impl NSTableViewRowAction {
50 extern_methods!(
51 #[cfg(feature = "block2")]
52 #[unsafe(method(rowActionWithStyle:title:handler:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn rowActionWithStyle_title_handler(
55 style: NSTableViewRowActionStyle,
56 title: &NSString,
57 handler: &block2::DynBlock<dyn Fn(NonNull<NSTableViewRowAction>, NSInteger)>,
58 ) -> Retained<Self>;
59
60 #[unsafe(method(style))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn style(&self) -> NSTableViewRowActionStyle;
63
64 #[unsafe(method(title))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn title(&self) -> Retained<NSString>;
67
68 #[unsafe(method(setTitle:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn setTitle(&self, title: &NSString);
72
73 #[cfg(feature = "NSColor")]
74 #[unsafe(method(backgroundColor))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
77
78 #[cfg(feature = "NSColor")]
79 #[unsafe(method(setBackgroundColor:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setBackgroundColor(&self, background_color: Option<&NSColor>);
83
84 #[cfg(feature = "NSImage")]
85 #[unsafe(method(image))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
88
89 #[cfg(feature = "NSImage")]
90 #[unsafe(method(setImage:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setImage(&self, image: Option<&NSImage>);
94 );
95}
96
97impl NSTableViewRowAction {
99 extern_methods!(
100 #[unsafe(method(init))]
101 #[unsafe(method_family = init)]
102 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
103
104 #[unsafe(method(new))]
105 #[unsafe(method_family = new)]
106 pub unsafe fn new() -> Retained<Self>;
107 );
108}