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"))]
79extern_conformance!(
80 unsafe impl NSAccessibility for NSImageCell {}
81);
82
83#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
84extern_conformance!(
85 unsafe impl NSAccessibilityElementProtocol for NSImageCell {}
86);
87
88#[cfg(feature = "NSCell")]
89extern_conformance!(
90 unsafe impl NSCoding for NSImageCell {}
91);
92
93#[cfg(feature = "NSCell")]
94extern_conformance!(
95 unsafe impl NSCopying for NSImageCell {}
96);
97
98#[cfg(feature = "NSCell")]
99unsafe impl CopyingHelper for NSImageCell {
100 type Result = Self;
101}
102
103#[cfg(feature = "NSCell")]
104extern_conformance!(
105 unsafe impl NSObjectProtocol for NSImageCell {}
106);
107
108#[cfg(all(feature = "NSCell", feature = "NSUserInterfaceItemIdentification"))]
109extern_conformance!(
110 unsafe impl NSUserInterfaceItemIdentification for NSImageCell {}
111);
112
113#[cfg(feature = "NSCell")]
114impl NSImageCell {
115 extern_methods!(
116 #[unsafe(method(imageAlignment))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn imageAlignment(&self) -> NSImageAlignment;
119
120 #[unsafe(method(setImageAlignment:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setImageAlignment(&self, image_alignment: NSImageAlignment);
124
125 #[unsafe(method(imageScaling))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn imageScaling(&self) -> NSImageScaling;
128
129 #[unsafe(method(setImageScaling:))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn setImageScaling(&self, image_scaling: NSImageScaling);
133
134 #[unsafe(method(imageFrameStyle))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn imageFrameStyle(&self) -> NSImageFrameStyle;
137
138 #[unsafe(method(setImageFrameStyle:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn setImageFrameStyle(&self, image_frame_style: NSImageFrameStyle);
142 );
143}
144
145#[cfg(feature = "NSCell")]
147impl NSImageCell {
148 extern_methods!(
149 #[unsafe(method(init))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
152
153 #[unsafe(method(initTextCell:))]
154 #[unsafe(method_family = init)]
155 pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
156
157 #[cfg(feature = "NSImage")]
158 #[unsafe(method(initImageCell:))]
159 #[unsafe(method_family = init)]
160 pub unsafe fn initImageCell(
161 this: Allocated<Self>,
162 image: Option<&NSImage>,
163 ) -> Retained<Self>;
164
165 #[unsafe(method(initWithCoder:))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
168 );
169}
170
171#[cfg(feature = "NSCell")]
173impl NSImageCell {
174 extern_methods!(
175 #[unsafe(method(new))]
176 #[unsafe(method_family = new)]
177 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
178 );
179}