objc2_watch_kit/generated/
WKInterfaceMap.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-location")]
9use objc2_core_location::*;
10use objc2_foundation::*;
11#[cfg(feature = "objc2-map-kit")]
12use objc2_map_kit::*;
13#[cfg(feature = "objc2-ui-kit")]
14use objc2_ui_kit::*;
15
16use crate::*;
17
18#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct WKInterfaceMapPinColor(pub NSInteger);
23impl WKInterfaceMapPinColor {
24 #[doc(alias = "WKInterfaceMapPinColorRed")]
25 pub const Red: Self = Self(0);
26 #[doc(alias = "WKInterfaceMapPinColorGreen")]
27 pub const Green: Self = Self(1);
28 #[doc(alias = "WKInterfaceMapPinColorPurple")]
29 pub const Purple: Self = Self(2);
30}
31
32unsafe impl Encode for WKInterfaceMapPinColor {
33 const ENCODING: Encoding = NSInteger::ENCODING;
34}
35
36unsafe impl RefEncode for WKInterfaceMapPinColor {
37 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct WKInterfaceMapUserTrackingMode(pub NSInteger);
45impl WKInterfaceMapUserTrackingMode {
46 #[doc(alias = "WKInterfaceMapUserTrackingModeNone")]
47 pub const None: Self = Self(0);
48 #[doc(alias = "WKInterfaceMapUserTrackingModeFollow")]
49 pub const Follow: Self = Self(1);
50}
51
52unsafe impl Encode for WKInterfaceMapUserTrackingMode {
53 const ENCODING: Encoding = NSInteger::ENCODING;
54}
55
56unsafe impl RefEncode for WKInterfaceMapUserTrackingMode {
57 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60extern_class!(
61 #[unsafe(super(WKInterfaceObject, NSObject))]
63 #[derive(Debug, PartialEq, Eq, Hash)]
64 #[cfg(feature = "WKInterfaceObject")]
65 pub struct WKInterfaceMap;
66);
67
68#[cfg(feature = "WKInterfaceObject")]
69extern_conformance!(
70 unsafe impl NSObjectProtocol for WKInterfaceMap {}
71);
72
73#[cfg(feature = "WKInterfaceObject")]
74impl WKInterfaceMap {
75 extern_methods!(
76 #[deprecated = "Use MapKit.MapView instead."]
77 #[unsafe(method(init))]
78 #[unsafe(method_family = init)]
79 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81 #[unsafe(method(setShowsUserLocation:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setShowsUserLocation(&self, shows_user_location: bool);
84
85 #[unsafe(method(setShowsUserHeading:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setShowsUserHeading(&self, shows_user_heading: bool);
88
89 #[unsafe(method(setUserTrackingMode:animated:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setUserTrackingMode_animated(
92 &self,
93 mode: WKInterfaceMapUserTrackingMode,
94 animated: bool,
95 );
96
97 #[cfg(feature = "objc2-map-kit")]
98 #[unsafe(method(setVisibleMapRect:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setVisibleMapRect(&self, map_rect: MKMapRect);
101
102 #[cfg(feature = "objc2-map-kit")]
103 #[unsafe(method(setRegion:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn setRegion(&self, coordinate_region: MKCoordinateRegion);
106
107 #[cfg(all(
108 feature = "objc2-core-foundation",
109 feature = "objc2-core-location",
110 feature = "objc2-ui-kit"
111 ))]
112 #[unsafe(method(addAnnotation:withImage:centerOffset:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn addAnnotation_withImage_centerOffset(
115 &self,
116 location: CLLocationCoordinate2D,
117 image: Option<&UIImage>,
118 offset: CGPoint,
119 );
120
121 #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-location"))]
122 #[unsafe(method(addAnnotation:withImageNamed:centerOffset:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn addAnnotation_withImageNamed_centerOffset(
125 &self,
126 location: CLLocationCoordinate2D,
127 name: Option<&NSString>,
128 offset: CGPoint,
129 );
130
131 #[cfg(feature = "objc2-core-location")]
132 #[unsafe(method(addAnnotation:withPinColor:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn addAnnotation_withPinColor(
135 &self,
136 location: CLLocationCoordinate2D,
137 pin_color: WKInterfaceMapPinColor,
138 );
139
140 #[unsafe(method(removeAllAnnotations))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn removeAllAnnotations(&self);
143 );
144}
145
146#[cfg(feature = "WKInterfaceObject")]
148impl WKInterfaceMap {
149 extern_methods!(
150 #[unsafe(method(new))]
151 #[unsafe(method_family = new)]
152 pub unsafe fn new() -> Retained<Self>;
153 );
154}