objc2_map_kit/generated/
MKAnnotationView.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::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationcalloutinfodidchangenotification?language=objc)
17    pub static MKAnnotationCalloutInfoDidChangeNotification: &'static NSString;
18}
19
20/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewdragstate?language=objc)
21// NS_ENUM
22#[repr(transparent)]
23#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
24pub struct MKAnnotationViewDragState(pub NSUInteger);
25impl MKAnnotationViewDragState {
26    #[doc(alias = "MKAnnotationViewDragStateNone")]
27    pub const None: Self = Self(0);
28    #[doc(alias = "MKAnnotationViewDragStateStarting")]
29    pub const Starting: Self = Self(1);
30    #[doc(alias = "MKAnnotationViewDragStateDragging")]
31    pub const Dragging: Self = Self(2);
32    #[doc(alias = "MKAnnotationViewDragStateCanceling")]
33    pub const Canceling: Self = Self(3);
34    #[doc(alias = "MKAnnotationViewDragStateEnding")]
35    pub const Ending: Self = Self(4);
36}
37
38unsafe impl Encode for MKAnnotationViewDragState {
39    const ENCODING: Encoding = NSUInteger::ENCODING;
40}
41
42unsafe impl RefEncode for MKAnnotationViewDragState {
43    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
44}
45
46/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkfeaturedisplaypriority?language=objc)
47// NS_TYPED_EXTENSIBLE_ENUM
48pub type MKFeatureDisplayPriority = c_float;
49
50/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkfeaturedisplaypriorityrequired?language=objc)
51pub static MKFeatureDisplayPriorityRequired: MKFeatureDisplayPriority = 1000 as _;
52
53/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkfeaturedisplayprioritydefaulthigh?language=objc)
54pub static MKFeatureDisplayPriorityDefaultHigh: MKFeatureDisplayPriority = 750 as _;
55
56/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkfeaturedisplayprioritydefaultlow?language=objc)
57pub static MKFeatureDisplayPriorityDefaultLow: MKFeatureDisplayPriority = 250 as _;
58
59/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewzpriority?language=objc)
60// NS_TYPED_EXTENSIBLE_ENUM
61pub type MKAnnotationViewZPriority = c_float;
62
63/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewzprioritymax?language=objc)
64pub static MKAnnotationViewZPriorityMax: MKAnnotationViewZPriority = 1000 as _;
65
66/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewzprioritydefaultselected?language=objc)
67pub static MKAnnotationViewZPriorityDefaultSelected: MKAnnotationViewZPriority = 1000 as _;
68
69/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewzprioritydefaultunselected?language=objc)
70pub static MKAnnotationViewZPriorityDefaultUnselected: MKAnnotationViewZPriority = 500 as _;
71
72/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewzprioritymin?language=objc)
73pub static MKAnnotationViewZPriorityMin: MKAnnotationViewZPriority = 0 as _;
74
75/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationviewcollisionmode?language=objc)
76// NS_ENUM
77#[repr(transparent)]
78#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
79pub struct MKAnnotationViewCollisionMode(pub NSInteger);
80impl MKAnnotationViewCollisionMode {
81    #[doc(alias = "MKAnnotationViewCollisionModeRectangle")]
82    pub const Rectangle: Self = Self(0);
83    #[doc(alias = "MKAnnotationViewCollisionModeCircle")]
84    pub const Circle: Self = Self(1);
85    #[doc(alias = "MKAnnotationViewCollisionModeNone")]
86    pub const None: Self = Self(2);
87}
88
89unsafe impl Encode for MKAnnotationViewCollisionMode {
90    const ENCODING: Encoding = NSInteger::ENCODING;
91}
92
93unsafe impl RefEncode for MKAnnotationViewCollisionMode {
94    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
95}
96
97extern_class!(
98    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkannotationview?language=objc)
99    #[unsafe(super(NSView, NSResponder, NSObject))]
100    #[derive(Debug, PartialEq, Eq, Hash)]
101    #[cfg(feature = "objc2-app-kit")]
102    #[cfg(target_os = "macos")]
103    pub struct MKAnnotationView;
104);
105
106#[cfg(feature = "objc2-app-kit")]
107#[cfg(target_os = "macos")]
108extern_conformance!(
109    unsafe impl NSAccessibility for MKAnnotationView {}
110);
111
112#[cfg(feature = "objc2-app-kit")]
113#[cfg(target_os = "macos")]
114extern_conformance!(
115    unsafe impl NSAccessibilityElementProtocol for MKAnnotationView {}
116);
117
118#[cfg(feature = "objc2-app-kit")]
119#[cfg(target_os = "macos")]
120extern_conformance!(
121    unsafe impl NSAnimatablePropertyContainer for MKAnnotationView {}
122);
123
124#[cfg(feature = "objc2-app-kit")]
125#[cfg(target_os = "macos")]
126extern_conformance!(
127    unsafe impl NSAppearanceCustomization for MKAnnotationView {}
128);
129
130#[cfg(feature = "objc2-app-kit")]
131#[cfg(target_os = "macos")]
132extern_conformance!(
133    unsafe impl NSCoding for MKAnnotationView {}
134);
135
136#[cfg(feature = "objc2-app-kit")]
137#[cfg(target_os = "macos")]
138extern_conformance!(
139    unsafe impl NSDraggingDestination for MKAnnotationView {}
140);
141
142#[cfg(feature = "objc2-app-kit")]
143#[cfg(target_os = "macos")]
144extern_conformance!(
145    unsafe impl NSObjectProtocol for MKAnnotationView {}
146);
147
148#[cfg(feature = "objc2-app-kit")]
149#[cfg(target_os = "macos")]
150extern_conformance!(
151    unsafe impl NSUserInterfaceItemIdentification for MKAnnotationView {}
152);
153
154#[cfg(feature = "objc2-app-kit")]
155#[cfg(target_os = "macos")]
156impl MKAnnotationView {
157    extern_methods!(
158        #[cfg(feature = "MKAnnotation")]
159        #[unsafe(method(initWithAnnotation:reuseIdentifier:))]
160        #[unsafe(method_family = init)]
161        pub unsafe fn initWithAnnotation_reuseIdentifier(
162            this: Allocated<Self>,
163            annotation: Option<&ProtocolObject<dyn MKAnnotation>>,
164            reuse_identifier: Option<&NSString>,
165        ) -> Retained<Self>;
166
167        #[unsafe(method(initWithCoder:))]
168        #[unsafe(method_family = init)]
169        pub unsafe fn initWithCoder(
170            this: Allocated<Self>,
171            a_decoder: &NSCoder,
172        ) -> Option<Retained<Self>>;
173
174        #[unsafe(method(reuseIdentifier))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn reuseIdentifier(&self) -> Option<Retained<NSString>>;
177
178        #[unsafe(method(prepareForReuse))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn prepareForReuse(&self);
181
182        #[unsafe(method(prepareForDisplay))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn prepareForDisplay(&self);
185
186        #[cfg(feature = "MKAnnotation")]
187        #[unsafe(method(annotation))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn annotation(&self) -> Option<Retained<ProtocolObject<dyn MKAnnotation>>>;
190
191        #[cfg(feature = "MKAnnotation")]
192        /// Setter for [`annotation`][Self::annotation].
193        #[unsafe(method(setAnnotation:))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn setAnnotation(&self, annotation: Option<&ProtocolObject<dyn MKAnnotation>>);
196
197        #[unsafe(method(image))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
200
201        /// Setter for [`image`][Self::image].
202        #[unsafe(method(setImage:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn setImage(&self, image: Option<&NSImage>);
205
206        #[cfg(feature = "objc2-core-foundation")]
207        #[unsafe(method(centerOffset))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn centerOffset(&self) -> CGPoint;
210
211        #[cfg(feature = "objc2-core-foundation")]
212        /// Setter for [`centerOffset`][Self::centerOffset].
213        #[unsafe(method(setCenterOffset:))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn setCenterOffset(&self, center_offset: CGPoint);
216
217        #[cfg(feature = "objc2-core-foundation")]
218        #[unsafe(method(accessoryOffset))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn accessoryOffset(&self) -> CGPoint;
221
222        #[cfg(feature = "objc2-core-foundation")]
223        /// Setter for [`accessoryOffset`][Self::accessoryOffset].
224        #[unsafe(method(setAccessoryOffset:))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn setAccessoryOffset(&self, accessory_offset: CGPoint);
227
228        #[cfg(feature = "objc2-core-foundation")]
229        #[unsafe(method(calloutOffset))]
230        #[unsafe(method_family = none)]
231        pub unsafe fn calloutOffset(&self) -> CGPoint;
232
233        #[cfg(feature = "objc2-core-foundation")]
234        /// Setter for [`calloutOffset`][Self::calloutOffset].
235        #[unsafe(method(setCalloutOffset:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn setCalloutOffset(&self, callout_offset: CGPoint);
238
239        #[cfg(feature = "objc2-core-foundation")]
240        #[unsafe(method(leftCalloutOffset))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn leftCalloutOffset(&self) -> CGPoint;
243
244        #[cfg(feature = "objc2-core-foundation")]
245        /// Setter for [`leftCalloutOffset`][Self::leftCalloutOffset].
246        #[unsafe(method(setLeftCalloutOffset:))]
247        #[unsafe(method_family = none)]
248        pub unsafe fn setLeftCalloutOffset(&self, left_callout_offset: CGPoint);
249
250        #[cfg(feature = "objc2-core-foundation")]
251        #[unsafe(method(rightCalloutOffset))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn rightCalloutOffset(&self) -> CGPoint;
254
255        #[cfg(feature = "objc2-core-foundation")]
256        /// Setter for [`rightCalloutOffset`][Self::rightCalloutOffset].
257        #[unsafe(method(setRightCalloutOffset:))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn setRightCalloutOffset(&self, right_callout_offset: CGPoint);
260
261        #[unsafe(method(isEnabled))]
262        #[unsafe(method_family = none)]
263        pub unsafe fn isEnabled(&self) -> bool;
264
265        /// Setter for [`isEnabled`][Self::isEnabled].
266        #[unsafe(method(setEnabled:))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn setEnabled(&self, enabled: bool);
269
270        #[unsafe(method(isHighlighted))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn isHighlighted(&self) -> bool;
273
274        /// Setter for [`isHighlighted`][Self::isHighlighted].
275        #[unsafe(method(setHighlighted:))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn setHighlighted(&self, highlighted: bool);
278
279        #[unsafe(method(isSelected))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn isSelected(&self) -> bool;
282
283        /// Setter for [`isSelected`][Self::isSelected].
284        #[unsafe(method(setSelected:))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn setSelected(&self, selected: bool);
287
288        #[unsafe(method(setSelected:animated:))]
289        #[unsafe(method_family = none)]
290        pub unsafe fn setSelected_animated(&self, selected: bool, animated: bool);
291
292        #[unsafe(method(canShowCallout))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn canShowCallout(&self) -> bool;
295
296        /// Setter for [`canShowCallout`][Self::canShowCallout].
297        #[unsafe(method(setCanShowCallout:))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn setCanShowCallout(&self, can_show_callout: bool);
300
301        #[unsafe(method(leftCalloutAccessoryView))]
302        #[unsafe(method_family = none)]
303        pub unsafe fn leftCalloutAccessoryView(&self) -> Option<Retained<NSView>>;
304
305        /// Setter for [`leftCalloutAccessoryView`][Self::leftCalloutAccessoryView].
306        #[unsafe(method(setLeftCalloutAccessoryView:))]
307        #[unsafe(method_family = none)]
308        pub unsafe fn setLeftCalloutAccessoryView(
309            &self,
310            left_callout_accessory_view: Option<&NSView>,
311        );
312
313        #[unsafe(method(rightCalloutAccessoryView))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn rightCalloutAccessoryView(&self) -> Option<Retained<NSView>>;
316
317        /// Setter for [`rightCalloutAccessoryView`][Self::rightCalloutAccessoryView].
318        #[unsafe(method(setRightCalloutAccessoryView:))]
319        #[unsafe(method_family = none)]
320        pub unsafe fn setRightCalloutAccessoryView(
321            &self,
322            right_callout_accessory_view: Option<&NSView>,
323        );
324
325        #[unsafe(method(detailCalloutAccessoryView))]
326        #[unsafe(method_family = none)]
327        pub unsafe fn detailCalloutAccessoryView(&self) -> Option<Retained<NSView>>;
328
329        /// Setter for [`detailCalloutAccessoryView`][Self::detailCalloutAccessoryView].
330        #[unsafe(method(setDetailCalloutAccessoryView:))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn setDetailCalloutAccessoryView(
333            &self,
334            detail_callout_accessory_view: Option<&NSView>,
335        );
336
337        #[unsafe(method(isDraggable))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn isDraggable(&self) -> bool;
340
341        /// Setter for [`isDraggable`][Self::isDraggable].
342        #[unsafe(method(setDraggable:))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn setDraggable(&self, draggable: bool);
345
346        #[unsafe(method(dragState))]
347        #[unsafe(method_family = none)]
348        pub unsafe fn dragState(&self) -> MKAnnotationViewDragState;
349
350        /// Setter for [`dragState`][Self::dragState].
351        #[unsafe(method(setDragState:))]
352        #[unsafe(method_family = none)]
353        pub unsafe fn setDragState(&self, drag_state: MKAnnotationViewDragState);
354
355        #[unsafe(method(setDragState:animated:))]
356        #[unsafe(method_family = none)]
357        pub unsafe fn setDragState_animated(
358            &self,
359            new_drag_state: MKAnnotationViewDragState,
360            animated: bool,
361        );
362
363        #[unsafe(method(clusteringIdentifier))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn clusteringIdentifier(&self) -> Option<Retained<NSString>>;
366
367        /// Setter for [`clusteringIdentifier`][Self::clusteringIdentifier].
368        #[unsafe(method(setClusteringIdentifier:))]
369        #[unsafe(method_family = none)]
370        pub unsafe fn setClusteringIdentifier(&self, clustering_identifier: Option<&NSString>);
371
372        #[unsafe(method(clusterAnnotationView))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn clusterAnnotationView(&self) -> Option<Retained<MKAnnotationView>>;
375
376        #[unsafe(method(displayPriority))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn displayPriority(&self) -> MKFeatureDisplayPriority;
379
380        /// Setter for [`displayPriority`][Self::displayPriority].
381        #[unsafe(method(setDisplayPriority:))]
382        #[unsafe(method_family = none)]
383        pub unsafe fn setDisplayPriority(&self, display_priority: MKFeatureDisplayPriority);
384
385        #[unsafe(method(zPriority))]
386        #[unsafe(method_family = none)]
387        pub unsafe fn zPriority(&self) -> MKAnnotationViewZPriority;
388
389        /// Setter for [`zPriority`][Self::zPriority].
390        #[unsafe(method(setZPriority:))]
391        #[unsafe(method_family = none)]
392        pub unsafe fn setZPriority(&self, z_priority: MKAnnotationViewZPriority);
393
394        #[unsafe(method(selectedZPriority))]
395        #[unsafe(method_family = none)]
396        pub unsafe fn selectedZPriority(&self) -> MKAnnotationViewZPriority;
397
398        /// Setter for [`selectedZPriority`][Self::selectedZPriority].
399        #[unsafe(method(setSelectedZPriority:))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn setSelectedZPriority(&self, selected_z_priority: MKAnnotationViewZPriority);
402
403        #[unsafe(method(collisionMode))]
404        #[unsafe(method_family = none)]
405        pub unsafe fn collisionMode(&self) -> MKAnnotationViewCollisionMode;
406
407        /// Setter for [`collisionMode`][Self::collisionMode].
408        #[unsafe(method(setCollisionMode:))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn setCollisionMode(&self, collision_mode: MKAnnotationViewCollisionMode);
411    );
412}
413
414/// Methods declared on superclass `NSView`.
415#[cfg(feature = "objc2-app-kit")]
416#[cfg(target_os = "macos")]
417impl MKAnnotationView {
418    extern_methods!(
419        #[unsafe(method(initWithFrame:))]
420        #[unsafe(method_family = init)]
421        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
422    );
423}
424
425/// Methods declared on superclass `NSResponder`.
426#[cfg(feature = "objc2-app-kit")]
427#[cfg(target_os = "macos")]
428impl MKAnnotationView {
429    extern_methods!(
430        #[unsafe(method(init))]
431        #[unsafe(method_family = init)]
432        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
433    );
434}
435
436/// Methods declared on superclass `NSObject`.
437#[cfg(feature = "objc2-app-kit")]
438#[cfg(target_os = "macos")]
439impl MKAnnotationView {
440    extern_methods!(
441        #[unsafe(method(new))]
442        #[unsafe(method_family = new)]
443        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
444    );
445}