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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklocalsearchresulttype?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MKLocalSearchResultType(pub NSUInteger);
bitflags::bitflags! {
    impl MKLocalSearchResultType: NSUInteger {
        #[doc(alias = "MKLocalSearchResultTypeAddress")]
        const Address = 1<<0;
        #[doc(alias = "MKLocalSearchResultTypePointOfInterest")]
        const PointOfInterest = 1<<1;
        #[doc(alias = "MKLocalSearchResultTypePhysicalFeature")]
        const PhysicalFeature = 1<<2;
    }
}

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

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

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

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

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

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

impl MKLocalSearchRequest {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initWithNaturalLanguageQuery:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNaturalLanguageQuery(
            this: Allocated<Self>,
            natural_language_query: &NSString,
        ) -> Retained<Self>;

        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
        #[unsafe(method(initWithNaturalLanguageQuery:region:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNaturalLanguageQuery_region(
            this: Allocated<Self>,
            natural_language_query: &NSString,
            region: MKCoordinateRegion,
        ) -> Retained<Self>;

        #[unsafe(method(naturalLanguageQuery))]
        #[unsafe(method_family = none)]
        pub unsafe fn naturalLanguageQuery(&self) -> Option<Retained<NSString>>;

        /// Setter for [`naturalLanguageQuery`][Self::naturalLanguageQuery].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setNaturalLanguageQuery:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNaturalLanguageQuery(&self, natural_language_query: Option<&NSString>);

        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
        #[unsafe(method(region))]
        #[unsafe(method_family = none)]
        pub unsafe fn region(&self) -> MKCoordinateRegion;

        #[cfg(all(feature = "MKGeometry", feature = "objc2-core-location"))]
        /// Setter for [`region`][Self::region].
        #[unsafe(method(setRegion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRegion(&self, region: MKCoordinateRegion);

        #[cfg(feature = "MKTypes")]
        #[unsafe(method(regionPriority))]
        #[unsafe(method_family = none)]
        pub unsafe fn regionPriority(&self) -> MKLocalSearchRegionPriority;

        #[cfg(feature = "MKTypes")]
        /// Setter for [`regionPriority`][Self::regionPriority].
        #[unsafe(method(setRegionPriority:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRegionPriority(&self, region_priority: MKLocalSearchRegionPriority);

        #[unsafe(method(resultTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn resultTypes(&self) -> MKLocalSearchResultType;

        /// Setter for [`resultTypes`][Self::resultTypes].
        #[unsafe(method(setResultTypes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setResultTypes(&self, result_types: MKLocalSearchResultType);

        #[cfg(feature = "MKPointOfInterestFilter")]
        #[unsafe(method(pointOfInterestFilter))]
        #[unsafe(method_family = none)]
        pub unsafe fn pointOfInterestFilter(&self) -> Option<Retained<MKPointOfInterestFilter>>;

        #[cfg(feature = "MKPointOfInterestFilter")]
        /// Setter for [`pointOfInterestFilter`][Self::pointOfInterestFilter].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPointOfInterestFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPointOfInterestFilter(
            &self,
            point_of_interest_filter: Option<&MKPointOfInterestFilter>,
        );

        #[cfg(feature = "MKAddressFilter")]
        #[unsafe(method(addressFilter))]
        #[unsafe(method_family = none)]
        pub unsafe fn addressFilter(&self) -> Option<Retained<MKAddressFilter>>;

        #[cfg(feature = "MKAddressFilter")]
        /// Setter for [`addressFilter`][Self::addressFilter].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAddressFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAddressFilter(&self, address_filter: Option<&MKAddressFilter>);
    );
}

/// Methods declared on superclass `NSObject`.
impl MKLocalSearchRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}