objc2_map_kit/generated/
MKAddressFilter.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkaddressfilteroption?language=objc)
10// NS_OPTIONS
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct MKAddressFilterOption(pub NSUInteger);
14bitflags::bitflags! {
15    impl MKAddressFilterOption: NSUInteger {
16        #[doc(alias = "MKAddressFilterOptionCountry")]
17        const Country = 1<<0;
18        #[doc(alias = "MKAddressFilterOptionAdministrativeArea")]
19        const AdministrativeArea = 1<<1;
20        #[doc(alias = "MKAddressFilterOptionSubAdministrativeArea")]
21        const SubAdministrativeArea = 1<<2;
22        #[doc(alias = "MKAddressFilterOptionLocality")]
23        const Locality = 1<<3;
24        #[doc(alias = "MKAddressFilterOptionSubLocality")]
25        const SubLocality = 1<<4;
26        #[doc(alias = "MKAddressFilterOptionPostalCode")]
27        const PostalCode = 1<<5;
28    }
29}
30
31unsafe impl Encode for MKAddressFilterOption {
32    const ENCODING: Encoding = NSUInteger::ENCODING;
33}
34
35unsafe impl RefEncode for MKAddressFilterOption {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkaddressfilter?language=objc)
41    #[unsafe(super(NSObject))]
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    pub struct MKAddressFilter;
44);
45
46extern_conformance!(
47    unsafe impl NSCoding for MKAddressFilter {}
48);
49
50extern_conformance!(
51    unsafe impl NSCopying for MKAddressFilter {}
52);
53
54unsafe impl CopyingHelper for MKAddressFilter {
55    type Result = Self;
56}
57
58extern_conformance!(
59    unsafe impl NSObjectProtocol for MKAddressFilter {}
60);
61
62extern_conformance!(
63    unsafe impl NSSecureCoding for MKAddressFilter {}
64);
65
66impl MKAddressFilter {
67    extern_methods!(
68        #[unsafe(method(filterIncludingAll))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn filterIncludingAll() -> Retained<MKAddressFilter>;
71
72        #[unsafe(method(filterExcludingAll))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn filterExcludingAll() -> Retained<MKAddressFilter>;
75
76        #[unsafe(method(initIncludingOptions:))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn initIncludingOptions(
79            this: Allocated<Self>,
80            options: MKAddressFilterOption,
81        ) -> Retained<Self>;
82
83        #[unsafe(method(initExcludingOptions:))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn initExcludingOptions(
86            this: Allocated<Self>,
87            options: MKAddressFilterOption,
88        ) -> Retained<Self>;
89
90        #[unsafe(method(includesOptions:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn includesOptions(&self, options: MKAddressFilterOption) -> bool;
93
94        #[unsafe(method(excludesOptions:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn excludesOptions(&self, options: MKAddressFilterOption) -> bool;
97    );
98}
99
100/// Methods declared on superclass `NSObject`.
101impl MKAddressFilter {
102    extern_methods!(
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107        #[unsafe(method(new))]
108        #[unsafe(method_family = new)]
109        pub unsafe fn new() -> Retained<Self>;
110    );
111}