objc2_app_kit/generated/
NSImageCell.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 NSImageAlignment(pub NSUInteger);
15impl NSImageAlignment {
16 #[doc(alias = "NSImageAlignCenter")]
17 pub const AlignCenter: Self = Self(0);
18 #[doc(alias = "NSImageAlignTop")]
19 pub const AlignTop: Self = Self(1);
20 #[doc(alias = "NSImageAlignTopLeft")]
21 pub const AlignTopLeft: Self = Self(2);
22 #[doc(alias = "NSImageAlignTopRight")]
23 pub const AlignTopRight: Self = Self(3);
24 #[doc(alias = "NSImageAlignLeft")]
25 pub const AlignLeft: Self = Self(4);
26 #[doc(alias = "NSImageAlignBottom")]
27 pub const AlignBottom: Self = Self(5);
28 #[doc(alias = "NSImageAlignBottomLeft")]
29 pub const AlignBottomLeft: Self = Self(6);
30 #[doc(alias = "NSImageAlignBottomRight")]
31 pub const AlignBottomRight: Self = Self(7);
32 #[doc(alias = "NSImageAlignRight")]
33 pub const AlignRight: Self = Self(8);
34}
35
36unsafe impl Encode for NSImageAlignment {
37 const ENCODING: Encoding = NSUInteger::ENCODING;
38}
39
40unsafe impl RefEncode for NSImageAlignment {
41 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44#[repr(transparent)]
47#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
48pub struct NSImageFrameStyle(pub NSUInteger);
49impl NSImageFrameStyle {
50 #[doc(alias = "NSImageFrameNone")]
51 pub const None: Self = Self(0);
52 #[doc(alias = "NSImageFramePhoto")]
53 pub const Photo: Self = Self(1);
54 #[doc(alias = "NSImageFrameGrayBezel")]
55 pub const GrayBezel: Self = Self(2);
56 #[doc(alias = "NSImageFrameGroove")]
57 pub const Groove: Self = Self(3);
58 #[doc(alias = "NSImageFrameButton")]
59 pub const Button: Self = Self(4);
60}
61
62unsafe impl Encode for NSImageFrameStyle {
63 const ENCODING: Encoding = NSUInteger::ENCODING;
64}
65
66unsafe impl RefEncode for NSImageFrameStyle {
67 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
68}
69
70extern_class!(
71 #[unsafe(super(NSCell, NSObject))]
73 #[derive(Debug, PartialEq, Eq, Hash)]
74 #[cfg(feature = "NSCell")]
75 pub struct NSImageCell;
76);
77
78#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
79unsafe impl NSAccessibility for NSImageCell {}
80
81#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
82unsafe impl NSAccessibilityElementProtocol for NSImageCell {}
83
84#[cfg(feature = "NSCell")]
85unsafe impl NSCoding for NSImageCell {}
86
87#[cfg(feature = "NSCell")]
88unsafe impl NSCopying for NSImageCell {}
89
90#[cfg(feature = "NSCell")]
91unsafe impl CopyingHelper for NSImageCell {
92 type Result = Self;
93}
94
95#[cfg(feature = "NSCell")]
96unsafe impl NSObjectProtocol for NSImageCell {}
97
98#[cfg(all(feature = "NSCell", feature = "NSUserInterfaceItemIdentification"))]
99unsafe impl NSUserInterfaceItemIdentification for NSImageCell {}
100
101#[cfg(feature = "NSCell")]
102impl NSImageCell {
103 extern_methods!(
104 #[unsafe(method(imageAlignment))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn imageAlignment(&self) -> NSImageAlignment;
107
108 #[unsafe(method(setImageAlignment:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setImageAlignment(&self, image_alignment: NSImageAlignment);
112
113 #[unsafe(method(imageScaling))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn imageScaling(&self) -> NSImageScaling;
116
117 #[unsafe(method(setImageScaling:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn setImageScaling(&self, image_scaling: NSImageScaling);
121
122 #[unsafe(method(imageFrameStyle))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn imageFrameStyle(&self) -> NSImageFrameStyle;
125
126 #[unsafe(method(setImageFrameStyle:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn setImageFrameStyle(&self, image_frame_style: NSImageFrameStyle);
130 );
131}
132
133#[cfg(feature = "NSCell")]
135impl NSImageCell {
136 extern_methods!(
137 #[unsafe(method(init))]
138 #[unsafe(method_family = init)]
139 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140
141 #[unsafe(method(initTextCell:))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
144
145 #[cfg(feature = "NSImage")]
146 #[unsafe(method(initImageCell:))]
147 #[unsafe(method_family = init)]
148 pub unsafe fn initImageCell(
149 this: Allocated<Self>,
150 image: Option<&NSImage>,
151 ) -> Retained<Self>;
152
153 #[unsafe(method(initWithCoder:))]
154 #[unsafe(method_family = init)]
155 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
156 );
157}
158
159#[cfg(feature = "NSCell")]
161impl NSImageCell {
162 extern_methods!(
163 #[unsafe(method(new))]
164 #[unsafe(method_family = new)]
165 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
166 );
167}