use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[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!(
#[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>>;
#[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"))]
#[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")]
#[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;
#[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")]
#[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")]
#[unsafe(method(setAddressFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setAddressFilter(&self, address_filter: Option<&MKAddressFilter>);
);
}
impl MKLocalSearchRequest {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}