icrate/generated/MapKit/
MKAnnotationView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::Contacts::*;
6use crate::CoreLocation::*;
7use crate::Foundation::*;
8use crate::MapKit::*;
9
10extern_static!(MKAnnotationCalloutInfoDidChangeNotification: &'static NSString);
11
12ns_enum!(
13    #[underlying(NSUInteger)]
14    pub enum MKAnnotationViewDragState {
15        MKAnnotationViewDragStateNone = 0,
16        MKAnnotationViewDragStateStarting = 1,
17        MKAnnotationViewDragStateDragging = 2,
18        MKAnnotationViewDragStateCanceling = 3,
19        MKAnnotationViewDragStateEnding = 4,
20    }
21);
22
23typed_extensible_enum!(
24    pub type MKFeatureDisplayPriority = c_float;
25);
26
27extern_static!(MKFeatureDisplayPriorityRequired: MKFeatureDisplayPriority = 1000);
28
29extern_static!(MKFeatureDisplayPriorityDefaultHigh: MKFeatureDisplayPriority = 750);
30
31extern_static!(MKFeatureDisplayPriorityDefaultLow: MKFeatureDisplayPriority = 250);
32
33typed_extensible_enum!(
34    pub type MKAnnotationViewZPriority = c_float;
35);
36
37extern_static!(MKAnnotationViewZPriorityMax: MKAnnotationViewZPriority = 1000);
38
39extern_static!(MKAnnotationViewZPriorityDefaultSelected: MKAnnotationViewZPriority = 1000);
40
41extern_static!(MKAnnotationViewZPriorityDefaultUnselected: MKAnnotationViewZPriority = 500);
42
43extern_static!(MKAnnotationViewZPriorityMin: MKAnnotationViewZPriority = 0);
44
45ns_enum!(
46    #[underlying(NSInteger)]
47    pub enum MKAnnotationViewCollisionMode {
48        MKAnnotationViewCollisionModeRectangle = 0,
49        MKAnnotationViewCollisionModeCircle = 1,
50        MKAnnotationViewCollisionModeNone = 2,
51    }
52);
53
54extern_class!(
55    #[derive(Debug, PartialEq, Eq, Hash)]
56    #[cfg(feature = "MapKit_MKAnnotationView")]
57    pub struct MKAnnotationView;
58
59    #[cfg(feature = "MapKit_MKAnnotationView")]
60    unsafe impl ClassType for MKAnnotationView {
61        #[inherits(NSResponder, NSObject)]
62        type Super = NSView;
63        type Mutability = MainThreadOnly;
64    }
65);
66
67#[cfg(feature = "MapKit_MKAnnotationView")]
68unsafe impl NSAccessibility for MKAnnotationView {}
69
70#[cfg(feature = "MapKit_MKAnnotationView")]
71unsafe impl NSAccessibilityElementProtocol for MKAnnotationView {}
72
73#[cfg(feature = "MapKit_MKAnnotationView")]
74unsafe impl NSAnimatablePropertyContainer for MKAnnotationView {}
75
76#[cfg(feature = "MapKit_MKAnnotationView")]
77unsafe impl NSAppearanceCustomization for MKAnnotationView {}
78
79#[cfg(feature = "MapKit_MKAnnotationView")]
80unsafe impl NSCoding for MKAnnotationView {}
81
82#[cfg(feature = "MapKit_MKAnnotationView")]
83unsafe impl NSDraggingDestination for MKAnnotationView {}
84
85#[cfg(feature = "MapKit_MKAnnotationView")]
86unsafe impl NSObjectProtocol for MKAnnotationView {}
87
88#[cfg(feature = "MapKit_MKAnnotationView")]
89unsafe impl NSUserInterfaceItemIdentification for MKAnnotationView {}
90
91extern_methods!(
92    #[cfg(feature = "MapKit_MKAnnotationView")]
93    unsafe impl MKAnnotationView {
94        #[cfg(feature = "Foundation_NSString")]
95        #[method_id(@__retain_semantics Init initWithAnnotation:reuseIdentifier:)]
96        pub unsafe fn initWithAnnotation_reuseIdentifier(
97            this: Allocated<Self>,
98            annotation: Option<&ProtocolObject<dyn MKAnnotation>>,
99            reuse_identifier: Option<&NSString>,
100        ) -> Id<Self>;
101
102        #[cfg(feature = "Foundation_NSCoder")]
103        #[method_id(@__retain_semantics Init initWithCoder:)]
104        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder)
105            -> Option<Id<Self>>;
106
107        #[cfg(feature = "Foundation_NSString")]
108        #[method_id(@__retain_semantics Other reuseIdentifier)]
109        pub unsafe fn reuseIdentifier(&self) -> Option<Id<NSString>>;
110
111        #[method(prepareForReuse)]
112        pub unsafe fn prepareForReuse(&self);
113
114        #[method(prepareForDisplay)]
115        pub unsafe fn prepareForDisplay(&self);
116
117        #[method_id(@__retain_semantics Other annotation)]
118        pub unsafe fn annotation(&self) -> Option<Id<ProtocolObject<dyn MKAnnotation>>>;
119
120        #[method(setAnnotation:)]
121        pub unsafe fn setAnnotation(&self, annotation: Option<&ProtocolObject<dyn MKAnnotation>>);
122
123        #[cfg(feature = "AppKit_NSImage")]
124        #[method_id(@__retain_semantics Other image)]
125        pub unsafe fn image(&self) -> Option<Id<NSImage>>;
126
127        #[cfg(feature = "AppKit_NSImage")]
128        #[method(setImage:)]
129        pub unsafe fn setImage(&self, image: Option<&NSImage>);
130
131        #[method(centerOffset)]
132        pub unsafe fn centerOffset(&self) -> CGPoint;
133
134        #[method(setCenterOffset:)]
135        pub unsafe fn setCenterOffset(&self, center_offset: CGPoint);
136
137        #[method(calloutOffset)]
138        pub unsafe fn calloutOffset(&self) -> CGPoint;
139
140        #[method(setCalloutOffset:)]
141        pub unsafe fn setCalloutOffset(&self, callout_offset: CGPoint);
142
143        #[method(leftCalloutOffset)]
144        pub unsafe fn leftCalloutOffset(&self) -> CGPoint;
145
146        #[method(setLeftCalloutOffset:)]
147        pub unsafe fn setLeftCalloutOffset(&self, left_callout_offset: CGPoint);
148
149        #[method(rightCalloutOffset)]
150        pub unsafe fn rightCalloutOffset(&self) -> CGPoint;
151
152        #[method(setRightCalloutOffset:)]
153        pub unsafe fn setRightCalloutOffset(&self, right_callout_offset: CGPoint);
154
155        #[method(isEnabled)]
156        pub unsafe fn isEnabled(&self) -> bool;
157
158        #[method(setEnabled:)]
159        pub unsafe fn setEnabled(&self, enabled: bool);
160
161        #[method(isHighlighted)]
162        pub unsafe fn isHighlighted(&self) -> bool;
163
164        #[method(setHighlighted:)]
165        pub unsafe fn setHighlighted(&self, highlighted: bool);
166
167        #[method(isSelected)]
168        pub unsafe fn isSelected(&self) -> bool;
169
170        #[method(setSelected:)]
171        pub unsafe fn setSelected(&self, selected: bool);
172
173        #[method(setSelected:animated:)]
174        pub unsafe fn setSelected_animated(&self, selected: bool, animated: bool);
175
176        #[method(canShowCallout)]
177        pub unsafe fn canShowCallout(&self) -> bool;
178
179        #[method(setCanShowCallout:)]
180        pub unsafe fn setCanShowCallout(&self, can_show_callout: bool);
181
182        #[method_id(@__retain_semantics Other leftCalloutAccessoryView)]
183        pub unsafe fn leftCalloutAccessoryView(&self) -> Option<Id<NSView>>;
184
185        #[method(setLeftCalloutAccessoryView:)]
186        pub unsafe fn setLeftCalloutAccessoryView(
187            &self,
188            left_callout_accessory_view: Option<&NSView>,
189        );
190
191        #[method_id(@__retain_semantics Other rightCalloutAccessoryView)]
192        pub unsafe fn rightCalloutAccessoryView(&self) -> Option<Id<NSView>>;
193
194        #[method(setRightCalloutAccessoryView:)]
195        pub unsafe fn setRightCalloutAccessoryView(
196            &self,
197            right_callout_accessory_view: Option<&NSView>,
198        );
199
200        #[method_id(@__retain_semantics Other detailCalloutAccessoryView)]
201        pub unsafe fn detailCalloutAccessoryView(&self) -> Option<Id<NSView>>;
202
203        #[method(setDetailCalloutAccessoryView:)]
204        pub unsafe fn setDetailCalloutAccessoryView(
205            &self,
206            detail_callout_accessory_view: Option<&NSView>,
207        );
208
209        #[method(isDraggable)]
210        pub unsafe fn isDraggable(&self) -> bool;
211
212        #[method(setDraggable:)]
213        pub unsafe fn setDraggable(&self, draggable: bool);
214
215        #[method(dragState)]
216        pub unsafe fn dragState(&self) -> MKAnnotationViewDragState;
217
218        #[method(setDragState:)]
219        pub unsafe fn setDragState(&self, drag_state: MKAnnotationViewDragState);
220
221        #[method(setDragState:animated:)]
222        pub unsafe fn setDragState_animated(
223            &self,
224            new_drag_state: MKAnnotationViewDragState,
225            animated: bool,
226        );
227
228        #[cfg(feature = "Foundation_NSString")]
229        #[method_id(@__retain_semantics Other clusteringIdentifier)]
230        pub unsafe fn clusteringIdentifier(&self) -> Option<Id<NSString>>;
231
232        #[cfg(feature = "Foundation_NSString")]
233        #[method(setClusteringIdentifier:)]
234        pub unsafe fn setClusteringIdentifier(&self, clustering_identifier: Option<&NSString>);
235
236        #[method_id(@__retain_semantics Other clusterAnnotationView)]
237        pub unsafe fn clusterAnnotationView(&self) -> Option<Id<MKAnnotationView>>;
238
239        #[method(displayPriority)]
240        pub unsafe fn displayPriority(&self) -> MKFeatureDisplayPriority;
241
242        #[method(setDisplayPriority:)]
243        pub unsafe fn setDisplayPriority(&self, display_priority: MKFeatureDisplayPriority);
244
245        #[method(zPriority)]
246        pub unsafe fn zPriority(&self) -> MKAnnotationViewZPriority;
247
248        #[method(setZPriority:)]
249        pub unsafe fn setZPriority(&self, z_priority: MKAnnotationViewZPriority);
250
251        #[method(selectedZPriority)]
252        pub unsafe fn selectedZPriority(&self) -> MKAnnotationViewZPriority;
253
254        #[method(setSelectedZPriority:)]
255        pub unsafe fn setSelectedZPriority(&self, selected_z_priority: MKAnnotationViewZPriority);
256
257        #[method(collisionMode)]
258        pub unsafe fn collisionMode(&self) -> MKAnnotationViewCollisionMode;
259
260        #[method(setCollisionMode:)]
261        pub unsafe fn setCollisionMode(&self, collision_mode: MKAnnotationViewCollisionMode);
262    }
263);
264
265extern_methods!(
266    /// Methods declared on superclass `NSView`
267    #[cfg(feature = "MapKit_MKAnnotationView")]
268    unsafe impl MKAnnotationView {
269        #[method_id(@__retain_semantics Init initWithFrame:)]
270        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Id<Self>;
271    }
272);
273
274extern_methods!(
275    /// Methods declared on superclass `NSResponder`
276    #[cfg(feature = "MapKit_MKAnnotationView")]
277    unsafe impl MKAnnotationView {
278        #[method_id(@__retain_semantics Init init)]
279        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
280    }
281);
282
283extern_methods!(
284    /// Methods declared on superclass `NSObject`
285    #[cfg(feature = "MapKit_MKAnnotationView")]
286    unsafe impl MKAnnotationView {
287        #[method_id(@__retain_semantics New new)]
288        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
289    }
290);