objc2-core-data 0.3.2

Bindings to the CoreData 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::*;
#[cfg(feature = "objc2-core-spotlight")]
#[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
use objc2_core_spotlight::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nscoredatacorespotlightdelegateindexdidupdatenotification?language=objc)
    pub static NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification:
        &'static NSNotificationName;
}

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

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

impl NSCoreDataCoreSpotlightDelegate {
    extern_methods!(
        #[unsafe(method(isIndexingEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isIndexingEnabled(&self) -> bool;

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

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

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

        #[cfg(all(
            feature = "NSPersistentStoreCoordinator",
            feature = "NSPersistentStoreDescription"
        ))]
        #[unsafe(method(initForStoreWithDescription:coordinator:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initForStoreWithDescription_coordinator(
            this: Allocated<Self>,
            description: &NSPersistentStoreDescription,
            psc: &NSPersistentStoreCoordinator,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "NSManagedObjectModel",
            feature = "NSPersistentStoreDescription"
        ))]
        #[deprecated]
        #[unsafe(method(initForStoreWithDescription:model:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initForStoreWithDescription_model(
            this: Allocated<Self>,
            description: &NSPersistentStoreDescription,
            model: &NSManagedObjectModel,
        ) -> Retained<Self>;

        #[unsafe(method(startSpotlightIndexing))]
        #[unsafe(method_family = none)]
        pub unsafe fn startSpotlightIndexing(&self);

        #[unsafe(method(stopSpotlightIndexing))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopSpotlightIndexing(&self);

        #[cfg(feature = "block2")]
        #[unsafe(method(deleteSpotlightIndexWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn deleteSpotlightIndexWithCompletionHandler(
            &self,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "NSManagedObject", feature = "objc2-core-spotlight"))]
        #[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
        #[unsafe(method(attributeSetForObject:))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributeSetForObject(
            &self,
            object: &NSManagedObject,
        ) -> Option<Retained<CSSearchableItemAttributeSet>>;

        #[cfg(all(feature = "block2", feature = "objc2-core-spotlight"))]
        #[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
        #[unsafe(method(searchableIndex:reindexAllSearchableItemsWithAcknowledgementHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn searchableIndex_reindexAllSearchableItemsWithAcknowledgementHandler(
            &self,
            searchable_index: &CSSearchableIndex,
            acknowledgement_handler: &block2::DynBlock<dyn Fn()>,
        );

        #[cfg(all(feature = "block2", feature = "objc2-core-spotlight"))]
        #[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
        #[unsafe(method(searchableIndex:reindexSearchableItemsWithIdentifiers:acknowledgementHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn searchableIndex_reindexSearchableItemsWithIdentifiers_acknowledgementHandler(
            &self,
            searchable_index: &CSSearchableIndex,
            identifiers: &NSArray<NSString>,
            acknowledgement_handler: &block2::DynBlock<dyn Fn()>,
        );
    );
}

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