objc2_map_kit/generated/
MKTileOverlay.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct MKTileOverlay;
17);
18
19#[cfg(feature = "MKAnnotation")]
20extern_conformance!(
21 unsafe impl MKAnnotation for MKTileOverlay {}
22);
23
24#[cfg(all(feature = "MKAnnotation", feature = "MKOverlay"))]
25extern_conformance!(
26 unsafe impl MKOverlay for MKTileOverlay {}
27);
28
29extern_conformance!(
30 unsafe impl NSObjectProtocol for MKTileOverlay {}
31);
32
33impl MKTileOverlay {
34 extern_methods!(
35 #[unsafe(method(initWithURLTemplate:))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn initWithURLTemplate(
38 this: Allocated<Self>,
39 url_template: Option<&NSString>,
40 ) -> Retained<Self>;
41
42 #[cfg(feature = "objc2-core-foundation")]
43 #[unsafe(method(tileSize))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn tileSize(&self) -> CGSize;
46
47 #[cfg(feature = "objc2-core-foundation")]
48 #[unsafe(method(setTileSize:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn setTileSize(&self, tile_size: CGSize);
52
53 #[unsafe(method(isGeometryFlipped))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn isGeometryFlipped(&self) -> bool;
56
57 #[unsafe(method(setGeometryFlipped:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setGeometryFlipped(&self, geometry_flipped: bool);
61
62 #[unsafe(method(minimumZ))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn minimumZ(&self) -> NSInteger;
65
66 #[unsafe(method(setMinimumZ:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn setMinimumZ(&self, minimum_z: NSInteger);
70
71 #[unsafe(method(maximumZ))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn maximumZ(&self) -> NSInteger;
74
75 #[unsafe(method(setMaximumZ:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn setMaximumZ(&self, maximum_z: NSInteger);
79
80 #[unsafe(method(URLTemplate))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn URLTemplate(&self) -> Option<Retained<NSString>>;
83
84 #[unsafe(method(canReplaceMapContent))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn canReplaceMapContent(&self) -> bool;
87
88 #[unsafe(method(setCanReplaceMapContent:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setCanReplaceMapContent(&self, can_replace_map_content: bool);
92 );
93}
94
95impl MKTileOverlay {
97 extern_methods!(
98 #[unsafe(method(init))]
99 #[unsafe(method_family = init)]
100 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101
102 #[unsafe(method(new))]
103 #[unsafe(method_family = new)]
104 pub unsafe fn new() -> Retained<Self>;
105 );
106}
107
108#[cfg(feature = "objc2-core-foundation")]
110#[repr(C)]
111#[derive(Clone, Copy, Debug, PartialEq)]
112pub struct MKTileOverlayPath {
113 pub x: NSInteger,
114 pub y: NSInteger,
115 pub z: NSInteger,
116 pub contentScaleFactor: CGFloat,
117}
118
119#[cfg(feature = "objc2-core-foundation")]
120unsafe impl Encode for MKTileOverlayPath {
121 const ENCODING: Encoding = Encoding::Struct(
122 "?",
123 &[
124 <NSInteger>::ENCODING,
125 <NSInteger>::ENCODING,
126 <NSInteger>::ENCODING,
127 <CGFloat>::ENCODING,
128 ],
129 );
130}
131
132#[cfg(feature = "objc2-core-foundation")]
133unsafe impl RefEncode for MKTileOverlayPath {
134 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
135}
136
137impl MKTileOverlay {
139 extern_methods!(
140 #[cfg(feature = "objc2-core-foundation")]
141 #[unsafe(method(URLForTilePath:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn URLForTilePath(&self, path: MKTileOverlayPath) -> Retained<NSURL>;
144
145 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
146 #[unsafe(method(loadTileAtPath:result:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn loadTileAtPath_result(
149 &self,
150 path: MKTileOverlayPath,
151 result: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
152 );
153 );
154}