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