objc2_map_kit/generated/
MKLocalSearchRequest.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearchresulttype?language=objc)
11// NS_OPTIONS
12#[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    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearchrequest?language=objc)
36    #[unsafe(super(NSObject))]
37    #[derive(Debug, PartialEq, Eq, Hash)]
38    pub struct MKLocalSearchRequest;
39);
40
41extern_conformance!(
42    unsafe impl NSCopying for MKLocalSearchRequest {}
43);
44
45unsafe impl CopyingHelper for MKLocalSearchRequest {
46    type Result = Self;
47}
48
49extern_conformance!(
50    unsafe impl NSObjectProtocol for MKLocalSearchRequest {}
51);
52
53impl MKLocalSearchRequest {
54    extern_methods!(
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[unsafe(method(initWithNaturalLanguageQuery:))]
60        #[unsafe(method_family = init)]
61        pub unsafe fn initWithNaturalLanguageQuery(
62            this: Allocated<Self>,
63            natural_language_query: &NSString,
64        ) -> Retained<Self>;
65
66        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
67        #[unsafe(method(initWithNaturalLanguageQuery:region:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithNaturalLanguageQuery_region(
70            this: Allocated<Self>,
71            natural_language_query: &NSString,
72            region: MKCoordinateRegion,
73        ) -> Retained<Self>;
74
75        #[unsafe(method(naturalLanguageQuery))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn naturalLanguageQuery(&self) -> Option<Retained<NSString>>;
78
79        /// Setter for [`naturalLanguageQuery`][Self::naturalLanguageQuery].
80        ///
81        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
82        #[unsafe(method(setNaturalLanguageQuery:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setNaturalLanguageQuery(&self, natural_language_query: Option<&NSString>);
85
86        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
87        #[unsafe(method(region))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn region(&self) -> MKCoordinateRegion;
90
91        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
92        /// Setter for [`region`][Self::region].
93        #[unsafe(method(setRegion:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setRegion(&self, region: MKCoordinateRegion);
96
97        #[cfg(feature = "MKTypes")]
98        #[unsafe(method(regionPriority))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn regionPriority(&self) -> MKLocalSearchRegionPriority;
101
102        #[cfg(feature = "MKTypes")]
103        /// Setter for [`regionPriority`][Self::regionPriority].
104        #[unsafe(method(setRegionPriority:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setRegionPriority(&self, region_priority: MKLocalSearchRegionPriority);
107
108        #[unsafe(method(resultTypes))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn resultTypes(&self) -> MKLocalSearchResultType;
111
112        /// Setter for [`resultTypes`][Self::resultTypes].
113        #[unsafe(method(setResultTypes:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setResultTypes(&self, result_types: MKLocalSearchResultType);
116
117        #[cfg(feature = "MKPointOfInterestFilter")]
118        #[unsafe(method(pointOfInterestFilter))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn pointOfInterestFilter(&self) -> Option<Retained<MKPointOfInterestFilter>>;
121
122        #[cfg(feature = "MKPointOfInterestFilter")]
123        /// Setter for [`pointOfInterestFilter`][Self::pointOfInterestFilter].
124        ///
125        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
126        #[unsafe(method(setPointOfInterestFilter:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setPointOfInterestFilter(
129            &self,
130            point_of_interest_filter: Option<&MKPointOfInterestFilter>,
131        );
132
133        #[cfg(feature = "MKAddressFilter")]
134        #[unsafe(method(addressFilter))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn addressFilter(&self) -> Option<Retained<MKAddressFilter>>;
137
138        #[cfg(feature = "MKAddressFilter")]
139        /// Setter for [`addressFilter`][Self::addressFilter].
140        ///
141        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
142        #[unsafe(method(setAddressFilter:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn setAddressFilter(&self, address_filter: Option<&MKAddressFilter>);
145    );
146}
147
148/// Methods declared on superclass `NSObject`.
149impl MKLocalSearchRequest {
150    extern_methods!(
151        #[unsafe(method(new))]
152        #[unsafe(method_family = new)]
153        pub unsafe fn new() -> Retained<Self>;
154    );
155}