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