objc2-map-kit 0.3.2

Bindings to the MapKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkaddressfilteroption?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MKAddressFilterOption(pub NSUInteger);
bitflags::bitflags! {
    impl MKAddressFilterOption: NSUInteger {
        #[doc(alias = "MKAddressFilterOptionCountry")]
        const Country = 1<<0;
        #[doc(alias = "MKAddressFilterOptionAdministrativeArea")]
        const AdministrativeArea = 1<<1;
        #[doc(alias = "MKAddressFilterOptionSubAdministrativeArea")]
        const SubAdministrativeArea = 1<<2;
        #[doc(alias = "MKAddressFilterOptionLocality")]
        const Locality = 1<<3;
        #[doc(alias = "MKAddressFilterOptionSubLocality")]
        const SubLocality = 1<<4;
        #[doc(alias = "MKAddressFilterOptionPostalCode")]
        const PostalCode = 1<<5;
    }
}

unsafe impl Encode for MKAddressFilterOption {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MKAddressFilterOption {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkaddressfilter?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MKAddressFilter;
);

extern_conformance!(
    unsafe impl NSCoding for MKAddressFilter {}
);

extern_conformance!(
    unsafe impl NSCopying for MKAddressFilter {}
);

unsafe impl CopyingHelper for MKAddressFilter {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MKAddressFilter {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for MKAddressFilter {}
);

impl MKAddressFilter {
    extern_methods!(
        #[unsafe(method(filterIncludingAll))]
        #[unsafe(method_family = none)]
        pub unsafe fn filterIncludingAll() -> Retained<MKAddressFilter>;

        #[unsafe(method(filterExcludingAll))]
        #[unsafe(method_family = none)]
        pub unsafe fn filterExcludingAll() -> Retained<MKAddressFilter>;

        #[unsafe(method(initIncludingOptions:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initIncludingOptions(
            this: Allocated<Self>,
            options: MKAddressFilterOption,
        ) -> Retained<Self>;

        #[unsafe(method(initExcludingOptions:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initExcludingOptions(
            this: Allocated<Self>,
            options: MKAddressFilterOption,
        ) -> Retained<Self>;

        #[unsafe(method(includesOptions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn includesOptions(&self, options: MKAddressFilterOption) -> bool;

        #[unsafe(method(excludesOptions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn excludesOptions(&self, options: MKAddressFilterOption) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl MKAddressFilter {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}