use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static CSSearchableItemActionType: &'static NSString;
}
extern "C" {
pub static CSSearchableItemActivityIdentifier: &'static NSString;
}
extern "C" {
pub static CSActionIdentifier: &'static NSString;
}
extern "C" {
pub static CSQueryContinuationActionType: &'static NSString;
}
extern "C" {
pub static CSSearchQueryString: &'static NSString;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CSSearchableItemUpdateListenerOptions(pub NSUInteger);
bitflags::bitflags! {
impl CSSearchableItemUpdateListenerOptions: NSUInteger {
#[doc(alias = "CSSearchableItemUpdateListenerOptionDefault")]
const Default = 0;
#[doc(alias = "CSSearchableItemUpdateListenerOptionSummarization")]
const Summarization = 1<<1;
#[doc(alias = "CSSearchableItemUpdateListenerOptionPriority")]
const Priority = 1<<2;
}
}
unsafe impl Encode for CSSearchableItemUpdateListenerOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for CSSearchableItemUpdateListenerOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CSSearchableItem;
);
extern_conformance!(
unsafe impl NSCoding for CSSearchableItem {}
);
extern_conformance!(
unsafe impl NSCopying for CSSearchableItem {}
);
unsafe impl CopyingHelper for CSSearchableItem {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CSSearchableItem {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CSSearchableItem {}
);
impl CSSearchableItem {
extern_methods!(
#[cfg(feature = "CSSearchableItemAttributeSet")]
#[unsafe(method(initWithUniqueIdentifier:domainIdentifier:attributeSet:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithUniqueIdentifier_domainIdentifier_attributeSet(
this: Allocated<Self>,
unique_identifier: Option<&NSString>,
domain_identifier: Option<&NSString>,
attribute_set: &CSSearchableItemAttributeSet,
) -> Retained<Self>;
#[unsafe(method(compareByRank:))]
#[unsafe(method_family = none)]
pub unsafe fn compareByRank(&self, other: &CSSearchableItem) -> NSComparisonResult;
#[unsafe(method(uniqueIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn uniqueIdentifier(&self) -> Retained<NSString>;
#[unsafe(method(setUniqueIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setUniqueIdentifier(&self, unique_identifier: &NSString);
#[unsafe(method(domainIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn domainIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setDomainIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setDomainIdentifier(&self, domain_identifier: Option<&NSString>);
#[unsafe(method(expirationDate))]
#[unsafe(method_family = none)]
pub unsafe fn expirationDate(&self) -> Retained<NSDate>;
#[unsafe(method(setExpirationDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setExpirationDate(&self, expiration_date: Option<&NSDate>);
#[cfg(feature = "CSSearchableItemAttributeSet")]
#[unsafe(method(attributeSet))]
#[unsafe(method_family = none)]
pub unsafe fn attributeSet(&self) -> Retained<CSSearchableItemAttributeSet>;
#[cfg(feature = "CSSearchableItemAttributeSet")]
#[unsafe(method(setAttributeSet:))]
#[unsafe(method_family = none)]
pub unsafe fn setAttributeSet(&self, attribute_set: &CSSearchableItemAttributeSet);
#[unsafe(method(isUpdate))]
#[unsafe(method_family = none)]
pub unsafe fn isUpdate(&self) -> bool;
#[unsafe(method(setIsUpdate:))]
#[unsafe(method_family = none)]
pub unsafe fn setIsUpdate(&self, is_update: bool);
#[unsafe(method(updateListenerOptions))]
#[unsafe(method_family = none)]
pub unsafe fn updateListenerOptions(&self) -> CSSearchableItemUpdateListenerOptions;
#[unsafe(method(setUpdateListenerOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn setUpdateListenerOptions(
&self,
update_listener_options: CSSearchableItemUpdateListenerOptions,
);
);
}
impl CSSearchableItem {
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>;
);
}