objc2_app_kit/generated/
NSTextAttachmentCell.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 #[doc(alias = "NSTextAttachmentCell")]
13 #[name = "NSTextAttachmentCell"]
14 pub unsafe trait NSTextAttachmentCellProtocol: NSObjectProtocol {
15 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
16 #[unsafe(method(drawWithFrame:inView:))]
17 #[unsafe(method_family = none)]
18 unsafe fn drawWithFrame_inView(
19 &self,
20 cell_frame: NSRect,
21 control_view: Option<&NSView>,
22 mtm: MainThreadMarker,
23 );
24
25 #[unsafe(method(wantsToTrackMouse))]
26 #[unsafe(method_family = none)]
27 unsafe fn wantsToTrackMouse(&self, mtm: MainThreadMarker) -> bool;
28
29 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
30 #[unsafe(method(highlight:withFrame:inView:))]
31 #[unsafe(method_family = none)]
32 unsafe fn highlight_withFrame_inView(
33 &self,
34 flag: bool,
35 cell_frame: NSRect,
36 control_view: Option<&NSView>,
37 mtm: MainThreadMarker,
38 );
39
40 #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
41 #[unsafe(method(trackMouse:inRect:ofView:untilMouseUp:))]
42 #[unsafe(method_family = none)]
43 unsafe fn trackMouse_inRect_ofView_untilMouseUp(
44 &self,
45 the_event: &NSEvent,
46 cell_frame: NSRect,
47 control_view: Option<&NSView>,
48 flag: bool,
49 mtm: MainThreadMarker,
50 ) -> bool;
51
52 #[unsafe(method(cellSize))]
53 #[unsafe(method_family = none)]
54 unsafe fn cellSize(&self) -> NSSize;
55
56 #[unsafe(method(cellBaselineOffset))]
57 #[unsafe(method_family = none)]
58 unsafe fn cellBaselineOffset(&self) -> NSPoint;
59
60 #[cfg(feature = "NSTextAttachment")]
61 #[unsafe(method(attachment))]
62 #[unsafe(method_family = none)]
63 unsafe fn attachment(&self) -> Option<Retained<NSTextAttachment>>;
64
65 #[cfg(feature = "NSTextAttachment")]
66 #[unsafe(method(setAttachment:))]
68 #[unsafe(method_family = none)]
69 unsafe fn setAttachment(&self, attachment: Option<&NSTextAttachment>);
70
71 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
72 #[unsafe(method(drawWithFrame:inView:characterIndex:))]
73 #[unsafe(method_family = none)]
74 unsafe fn drawWithFrame_inView_characterIndex(
75 &self,
76 cell_frame: NSRect,
77 control_view: Option<&NSView>,
78 char_index: NSUInteger,
79 mtm: MainThreadMarker,
80 );
81
82 #[cfg(all(
83 feature = "NSLayoutManager",
84 feature = "NSResponder",
85 feature = "NSView"
86 ))]
87 #[unsafe(method(drawWithFrame:inView:characterIndex:layoutManager:))]
88 #[unsafe(method_family = none)]
89 unsafe fn drawWithFrame_inView_characterIndex_layoutManager(
90 &self,
91 cell_frame: NSRect,
92 control_view: Option<&NSView>,
93 char_index: NSUInteger,
94 layout_manager: &NSLayoutManager,
95 mtm: MainThreadMarker,
96 );
97
98 #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
99 #[unsafe(method(wantsToTrackMouseForEvent:inRect:ofView:atCharacterIndex:))]
100 #[unsafe(method_family = none)]
101 unsafe fn wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex(
102 &self,
103 the_event: &NSEvent,
104 cell_frame: NSRect,
105 control_view: Option<&NSView>,
106 char_index: NSUInteger,
107 mtm: MainThreadMarker,
108 ) -> bool;
109
110 #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
111 #[unsafe(method(trackMouse:inRect:ofView:atCharacterIndex:untilMouseUp:))]
112 #[unsafe(method_family = none)]
113 unsafe fn trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp(
114 &self,
115 the_event: &NSEvent,
116 cell_frame: NSRect,
117 control_view: Option<&NSView>,
118 char_index: NSUInteger,
119 flag: bool,
120 mtm: MainThreadMarker,
121 ) -> bool;
122
123 #[cfg(feature = "NSTextContainer")]
124 #[unsafe(method(cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:))]
125 #[unsafe(method_family = none)]
126 unsafe fn cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex(
127 &self,
128 text_container: &NSTextContainer,
129 line_frag: NSRect,
130 position: NSPoint,
131 char_index: NSUInteger,
132 ) -> NSRect;
133 }
134);
135
136extern_class!(
137 #[unsafe(super(NSCell, NSObject))]
139 #[derive(Debug, PartialEq, Eq, Hash)]
140 #[cfg(feature = "NSCell")]
141 pub struct NSTextAttachmentCell;
142);
143
144#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
145extern_conformance!(
146 unsafe impl NSAccessibility for NSTextAttachmentCell {}
147);
148
149#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
150extern_conformance!(
151 unsafe impl NSAccessibilityElementProtocol for NSTextAttachmentCell {}
152);
153
154#[cfg(feature = "NSCell")]
155extern_conformance!(
156 unsafe impl NSCoding for NSTextAttachmentCell {}
157);
158
159#[cfg(feature = "NSCell")]
160extern_conformance!(
161 unsafe impl NSCopying for NSTextAttachmentCell {}
162);
163
164#[cfg(feature = "NSCell")]
165unsafe impl CopyingHelper for NSTextAttachmentCell {
166 type Result = Self;
167}
168
169#[cfg(feature = "NSCell")]
170extern_conformance!(
171 unsafe impl NSObjectProtocol for NSTextAttachmentCell {}
172);
173
174#[cfg(feature = "NSCell")]
175extern_conformance!(
176 unsafe impl NSTextAttachmentCellProtocol for NSTextAttachmentCell {}
177);
178
179#[cfg(all(feature = "NSCell", feature = "NSUserInterfaceItemIdentification"))]
180extern_conformance!(
181 unsafe impl NSUserInterfaceItemIdentification for NSTextAttachmentCell {}
182);
183
184#[cfg(feature = "NSCell")]
185impl NSTextAttachmentCell {
186 extern_methods!();
187}
188
189#[cfg(feature = "NSCell")]
191impl NSTextAttachmentCell {
192 extern_methods!(
193 #[unsafe(method(init))]
194 #[unsafe(method_family = init)]
195 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
196
197 #[unsafe(method(initTextCell:))]
198 #[unsafe(method_family = init)]
199 pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
200
201 #[cfg(feature = "NSImage")]
202 #[unsafe(method(initImageCell:))]
203 #[unsafe(method_family = init)]
204 pub unsafe fn initImageCell(
205 this: Allocated<Self>,
206 image: Option<&NSImage>,
207 ) -> Retained<Self>;
208
209 #[unsafe(method(initWithCoder:))]
210 #[unsafe(method_family = init)]
211 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
212 );
213}
214
215#[cfg(feature = "NSCell")]
217impl NSTextAttachmentCell {
218 extern_methods!(
219 #[unsafe(method(new))]
220 #[unsafe(method_family = new)]
221 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
222 );
223}