icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Contacts::*;
use crate::CoreLocation::*;
use crate::Foundation::*;
use crate::MapKit::*;

ns_enum!(
    #[underlying(NSInteger)]
    #[deprecated = "Use MKLocalSearchCompleterResultType"]
    pub enum MKSearchCompletionFilterType {
        #[deprecated = "Use MKLocalSearchCompleterResultType"]
        MKSearchCompletionFilterTypeLocationsAndQueries = 0,
        #[deprecated = "Use MKLocalSearchCompleterResultType"]
        MKSearchCompletionFilterTypeLocationsOnly = 1,
    }
);

ns_options!(
    #[underlying(NSUInteger)]
    pub enum MKLocalSearchCompleterResultType {
        MKLocalSearchCompleterResultTypeAddress = 1 << 0,
        MKLocalSearchCompleterResultTypePointOfInterest = 1 << 1,
        MKLocalSearchCompleterResultTypeQuery = 1 << 2,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MapKit_MKLocalSearchCompleter")]
    pub struct MKLocalSearchCompleter;

    #[cfg(feature = "MapKit_MKLocalSearchCompleter")]
    unsafe impl ClassType for MKLocalSearchCompleter {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "MapKit_MKLocalSearchCompleter")]
unsafe impl NSObjectProtocol for MKLocalSearchCompleter {}

extern_methods!(
    #[cfg(feature = "MapKit_MKLocalSearchCompleter")]
    unsafe impl MKLocalSearchCompleter {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other queryFragment)]
        pub unsafe fn queryFragment(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setQueryFragment:)]
        pub unsafe fn setQueryFragment(&self, query_fragment: &NSString);

        #[method(region)]
        pub unsafe fn region(&self) -> MKCoordinateRegion;

        #[method(setRegion:)]
        pub unsafe fn setRegion(&self, region: MKCoordinateRegion);

        #[deprecated = "Use resultTypes"]
        #[method(filterType)]
        pub unsafe fn filterType(&self) -> MKSearchCompletionFilterType;

        #[deprecated = "Use resultTypes"]
        #[method(setFilterType:)]
        pub unsafe fn setFilterType(&self, filter_type: MKSearchCompletionFilterType);

        #[method(resultTypes)]
        pub unsafe fn resultTypes(&self) -> MKLocalSearchCompleterResultType;

        #[method(setResultTypes:)]
        pub unsafe fn setResultTypes(&self, result_types: MKLocalSearchCompleterResultType);

        #[cfg(feature = "MapKit_MKPointOfInterestFilter")]
        #[method_id(@__retain_semantics Other pointOfInterestFilter)]
        pub unsafe fn pointOfInterestFilter(&self) -> Option<Id<MKPointOfInterestFilter>>;

        #[cfg(feature = "MapKit_MKPointOfInterestFilter")]
        #[method(setPointOfInterestFilter:)]
        pub unsafe fn setPointOfInterestFilter(
            &self,
            point_of_interest_filter: Option<&MKPointOfInterestFilter>,
        );

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Id<ProtocolObject<dyn MKLocalSearchCompleterDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn MKLocalSearchCompleterDelegate>>,
        );

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "MapKit_MKLocalSearchCompletion"
        ))]
        #[method_id(@__retain_semantics Other results)]
        pub unsafe fn results(&self) -> Id<NSArray<MKLocalSearchCompletion>>;

        #[method(isSearching)]
        pub unsafe fn isSearching(&self) -> bool;

        #[method(cancel)]
        pub unsafe fn cancel(&self);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "MapKit_MKLocalSearchCompleter")]
    unsafe impl MKLocalSearchCompleter {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_protocol!(
    pub unsafe trait MKLocalSearchCompleterDelegate: NSObjectProtocol {
        #[cfg(feature = "MapKit_MKLocalSearchCompleter")]
        #[optional]
        #[method(completerDidUpdateResults:)]
        unsafe fn completerDidUpdateResults(&self, completer: &MKLocalSearchCompleter);

        #[cfg(all(
            feature = "Foundation_NSError",
            feature = "MapKit_MKLocalSearchCompleter"
        ))]
        #[optional]
        #[method(completer:didFailWithError:)]
        unsafe fn completer_didFailWithError(
            &self,
            completer: &MKLocalSearchCompleter,
            error: &NSError,
        );
    }

    unsafe impl ProtocolType for dyn MKLocalSearchCompleterDelegate {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MapKit_MKLocalSearchCompletion")]
    pub struct MKLocalSearchCompletion;

    #[cfg(feature = "MapKit_MKLocalSearchCompletion")]
    unsafe impl ClassType for MKLocalSearchCompletion {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "MapKit_MKLocalSearchCompletion")]
unsafe impl NSObjectProtocol for MKLocalSearchCompletion {}

extern_methods!(
    #[cfg(feature = "MapKit_MKLocalSearchCompletion")]
    unsafe impl MKLocalSearchCompletion {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other title)]
        pub unsafe fn title(&self) -> Id<NSString>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSValue"))]
        #[method_id(@__retain_semantics Other titleHighlightRanges)]
        pub unsafe fn titleHighlightRanges(&self) -> Id<NSArray<NSValue>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other subtitle)]
        pub unsafe fn subtitle(&self) -> Id<NSString>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSValue"))]
        #[method_id(@__retain_semantics Other subtitleHighlightRanges)]
        pub unsafe fn subtitleHighlightRanges(&self) -> Id<NSArray<NSValue>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "MapKit_MKLocalSearchCompletion")]
    unsafe impl MKLocalSearchCompletion {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    #[cfg(feature = "MapKit_MKLocalSearchRequest")]
    unsafe impl MKLocalSearchRequest {
        #[cfg(feature = "MapKit_MKLocalSearchCompletion")]
        #[method_id(@__retain_semantics Init initWithCompletion:)]
        pub unsafe fn initWithCompletion(
            this: Allocated<Self>,
            completion: &MKLocalSearchCompletion,
        ) -> Id<Self>;
    }
);