objc2_map_kit/generated/
MKPinAnnotationView.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::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkpinannotationcolor?language=objc)
14// NS_ENUM
15#[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct MKPinAnnotationColor(pub NSUInteger);
19impl MKPinAnnotationColor {
20    #[doc(alias = "MKPinAnnotationColorRed")]
21    #[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
22    pub const Red: Self = Self(0);
23    #[doc(alias = "MKPinAnnotationColorGreen")]
24    #[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
25    pub const Green: Self = Self(1);
26    #[doc(alias = "MKPinAnnotationColorPurple")]
27    #[deprecated = "Use MKPinAnnotationView's pinTintColor instead"]
28    pub const Purple: Self = Self(2);
29}
30
31unsafe impl Encode for MKPinAnnotationColor {
32    const ENCODING: Encoding = NSUInteger::ENCODING;
33}
34
35unsafe impl RefEncode for MKPinAnnotationColor {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkpinannotationview?language=objc)
41    #[unsafe(super(MKAnnotationView, NSView, NSResponder, NSObject))]
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    #[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
44    #[cfg(target_os = "macos")]
45    #[deprecated]
46    pub struct MKPinAnnotationView;
47);
48
49#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
50#[cfg(target_os = "macos")]
51extern_conformance!(
52    unsafe impl NSAccessibility for MKPinAnnotationView {}
53);
54
55#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
56#[cfg(target_os = "macos")]
57extern_conformance!(
58    unsafe impl NSAccessibilityElementProtocol for MKPinAnnotationView {}
59);
60
61#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
62#[cfg(target_os = "macos")]
63extern_conformance!(
64    unsafe impl NSAnimatablePropertyContainer for MKPinAnnotationView {}
65);
66
67#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
68#[cfg(target_os = "macos")]
69extern_conformance!(
70    unsafe impl NSAppearanceCustomization for MKPinAnnotationView {}
71);
72
73#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
74#[cfg(target_os = "macos")]
75extern_conformance!(
76    unsafe impl NSCoding for MKPinAnnotationView {}
77);
78
79#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
80#[cfg(target_os = "macos")]
81extern_conformance!(
82    unsafe impl NSDraggingDestination for MKPinAnnotationView {}
83);
84
85#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
86#[cfg(target_os = "macos")]
87extern_conformance!(
88    unsafe impl NSObjectProtocol for MKPinAnnotationView {}
89);
90
91#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
92#[cfg(target_os = "macos")]
93extern_conformance!(
94    unsafe impl NSUserInterfaceItemIdentification for MKPinAnnotationView {}
95);
96
97#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
98#[cfg(target_os = "macos")]
99impl MKPinAnnotationView {
100    extern_methods!(
101        #[unsafe(method(redPinColor))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn redPinColor(mtm: MainThreadMarker) -> Retained<NSColor>;
104
105        #[unsafe(method(greenPinColor))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn greenPinColor(mtm: MainThreadMarker) -> Retained<NSColor>;
108
109        #[unsafe(method(purplePinColor))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn purplePinColor(mtm: MainThreadMarker) -> Retained<NSColor>;
112
113        #[unsafe(method(pinTintColor))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn pinTintColor(&self) -> Option<Retained<NSColor>>;
116
117        /// Setter for [`pinTintColor`][Self::pinTintColor].
118        ///
119        /// # Safety
120        ///
121        /// `pin_tint_color` might not allow `None`.
122        #[unsafe(method(setPinTintColor:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setPinTintColor(&self, pin_tint_color: Option<&NSColor>);
125
126        #[deprecated]
127        #[unsafe(method(animatesDrop))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn animatesDrop(&self) -> bool;
130
131        /// Setter for [`animatesDrop`][Self::animatesDrop].
132        #[deprecated]
133        #[unsafe(method(setAnimatesDrop:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn setAnimatesDrop(&self, animates_drop: bool);
136
137        #[deprecated = "Use pinTintColor instead"]
138        #[unsafe(method(pinColor))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn pinColor(&self) -> MKPinAnnotationColor;
141
142        /// Setter for [`pinColor`][Self::pinColor].
143        #[deprecated = "Use pinTintColor instead"]
144        #[unsafe(method(setPinColor:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setPinColor(&self, pin_color: MKPinAnnotationColor);
147    );
148}
149
150/// Methods declared on superclass `MKAnnotationView`.
151#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
152#[cfg(target_os = "macos")]
153impl MKPinAnnotationView {
154    extern_methods!(
155        #[cfg(feature = "MKAnnotation")]
156        #[unsafe(method(initWithAnnotation:reuseIdentifier:))]
157        #[unsafe(method_family = init)]
158        pub unsafe fn initWithAnnotation_reuseIdentifier(
159            this: Allocated<Self>,
160            annotation: Option<&ProtocolObject<dyn MKAnnotation>>,
161            reuse_identifier: Option<&NSString>,
162        ) -> Retained<Self>;
163
164        /// # Safety
165        ///
166        /// `a_decoder` possibly has further requirements.
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}
175
176/// Methods declared on superclass `NSView`.
177#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
178#[cfg(target_os = "macos")]
179impl MKPinAnnotationView {
180    extern_methods!(
181        #[unsafe(method(initWithFrame:))]
182        #[unsafe(method_family = init)]
183        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
184    );
185}
186
187/// Methods declared on superclass `NSResponder`.
188#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
189#[cfg(target_os = "macos")]
190impl MKPinAnnotationView {
191    extern_methods!(
192        #[unsafe(method(init))]
193        #[unsafe(method_family = init)]
194        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
195    );
196}
197
198/// Methods declared on superclass `NSObject`.
199#[cfg(all(feature = "MKAnnotationView", feature = "objc2-app-kit"))]
200#[cfg(target_os = "macos")]
201impl MKPinAnnotationView {
202    extern_methods!(
203        #[unsafe(method(new))]
204        #[unsafe(method_family = new)]
205        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
206    );
207}