objc2-file-provider 0.3.2

Bindings to the FileProvider 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-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// NSFileProviderThumbnailing.
#[cfg(feature = "Extension")]
impl NSFileProviderExtension {
    extern_methods!(
        #[cfg(all(
            feature = "NSFileProviderItem",
            feature = "block2",
            feature = "objc2-core-foundation"
        ))]
        /// The system calls this method to fetch thumbnails.
        ///
        /// The
        /// `perThumbnailCompletionHandler`should be called for each thumbnail, and
        /// `completionHandler`only after all the per thumbnail completion blocks.
        ///
        /// In the event of a global error, the implementation is allowed to skip calling
        /// the
        /// `perThumbnailCompletionHandler`for individual thumbnails. In that case,
        /// the
        /// `completionHandler's`error parameter would apply to all item identifiers
        /// for which
        /// `perThumbnailCompletionHandler`had not been called.
        ///
        /// If there is no thumbnail for a given item, the
        /// `perThumbnailCompletionHandler`should be called with its
        /// `imageData`and
        /// `error`parameters both
        /// set to nil.
        ///
        /// If the system decides that an in-flight thumbnail request is not needed anymore,
        /// it will call the returned
        /// `NSProgress`object's
        /// `-cancel`method,
        /// at which time the implementation should clean up any held resources.
        ///
        /// The system will cache the thumbnail for the item, and the cache will be
        /// invalidated when itemVersion.contentVersion changes.
        #[unsafe(method(fetchThumbnailsForItemIdentifiers:requestedSize:perThumbnailCompletionHandler:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fetchThumbnailsForItemIdentifiers_requestedSize_perThumbnailCompletionHandler_completionHandler(
            &self,
            item_identifiers: &NSArray<NSFileProviderItemIdentifier>,
            size: CGSize,
            per_thumbnail_completion_handler: &block2::DynBlock<
                dyn Fn(NonNull<NSFileProviderItemIdentifier>, *mut NSData, *mut NSError),
            >,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        ) -> Retained<NSProgress>;
    );
}