objc2_map_kit/generated/
MKLocalSearchRequest.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct MKLocalSearchResultType(pub NSUInteger);
15bitflags::bitflags! {
16 impl MKLocalSearchResultType: NSUInteger {
17 #[doc(alias = "MKLocalSearchResultTypeAddress")]
18 const Address = 1<<0;
19 #[doc(alias = "MKLocalSearchResultTypePointOfInterest")]
20 const PointOfInterest = 1<<1;
21 #[doc(alias = "MKLocalSearchResultTypePhysicalFeature")]
22 const PhysicalFeature = 1<<2;
23 }
24}
25
26unsafe impl Encode for MKLocalSearchResultType {
27 const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for MKLocalSearchResultType {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35 #[unsafe(super(NSObject))]
37 #[derive(Debug, PartialEq, Eq, Hash)]
38 pub struct MKLocalSearchRequest;
39);
40
41unsafe impl NSCopying for MKLocalSearchRequest {}
42
43unsafe impl CopyingHelper for MKLocalSearchRequest {
44 type Result = Self;
45}
46
47unsafe impl NSObjectProtocol for MKLocalSearchRequest {}
48
49impl MKLocalSearchRequest {
50 extern_methods!(
51 #[unsafe(method(init))]
52 #[unsafe(method_family = init)]
53 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55 #[unsafe(method(initWithNaturalLanguageQuery:))]
56 #[unsafe(method_family = init)]
57 pub unsafe fn initWithNaturalLanguageQuery(
58 this: Allocated<Self>,
59 natural_language_query: &NSString,
60 ) -> Retained<Self>;
61
62 #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
63 #[unsafe(method(initWithNaturalLanguageQuery:region:))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn initWithNaturalLanguageQuery_region(
66 this: Allocated<Self>,
67 natural_language_query: &NSString,
68 region: MKCoordinateRegion,
69 ) -> Retained<Self>;
70
71 #[unsafe(method(naturalLanguageQuery))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn naturalLanguageQuery(&self) -> Option<Retained<NSString>>;
74
75 #[unsafe(method(setNaturalLanguageQuery:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn setNaturalLanguageQuery(&self, natural_language_query: Option<&NSString>);
79
80 #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
81 #[unsafe(method(region))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn region(&self) -> MKCoordinateRegion;
84
85 #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
86 #[unsafe(method(setRegion:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn setRegion(&self, region: MKCoordinateRegion);
90
91 #[cfg(feature = "MKTypes")]
92 #[unsafe(method(regionPriority))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn regionPriority(&self) -> MKLocalSearchRegionPriority;
95
96 #[cfg(feature = "MKTypes")]
97 #[unsafe(method(setRegionPriority:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setRegionPriority(&self, region_priority: MKLocalSearchRegionPriority);
101
102 #[unsafe(method(resultTypes))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn resultTypes(&self) -> MKLocalSearchResultType;
105
106 #[unsafe(method(setResultTypes:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setResultTypes(&self, result_types: MKLocalSearchResultType);
110
111 #[cfg(feature = "MKPointOfInterestFilter")]
112 #[unsafe(method(pointOfInterestFilter))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn pointOfInterestFilter(&self) -> Option<Retained<MKPointOfInterestFilter>>;
115
116 #[cfg(feature = "MKPointOfInterestFilter")]
117 #[unsafe(method(setPointOfInterestFilter:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn setPointOfInterestFilter(
121 &self,
122 point_of_interest_filter: Option<&MKPointOfInterestFilter>,
123 );
124
125 #[cfg(feature = "MKAddressFilter")]
126 #[unsafe(method(addressFilter))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn addressFilter(&self) -> Option<Retained<MKAddressFilter>>;
129
130 #[cfg(feature = "MKAddressFilter")]
131 #[unsafe(method(setAddressFilter:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setAddressFilter(&self, address_filter: Option<&MKAddressFilter>);
135 );
136}
137
138impl MKLocalSearchRequest {
140 extern_methods!(
141 #[unsafe(method(new))]
142 #[unsafe(method_family = new)]
143 pub unsafe fn new() -> Retained<Self>;
144 );
145}