objc2_file_provider/generated/NSFileProviderThumbnailing.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// NSFileProviderThumbnailing.
13#[cfg(feature = "Extension")]
14impl NSFileProviderExtension {
15 extern_methods!(
16 #[cfg(all(
17 feature = "NSFileProviderItem",
18 feature = "block2",
19 feature = "objc2-core-foundation"
20 ))]
21 /// The system calls this method to fetch thumbnails.
22 ///
23 /// The
24 /// `perThumbnailCompletionHandler`should be called for each thumbnail, and
25 /// `completionHandler`only after all the per thumbnail completion blocks.
26 ///
27 /// In the event of a global error, the implementation is allowed to skip calling
28 /// the
29 /// `perThumbnailCompletionHandler`for individual thumbnails. In that case,
30 /// the
31 /// `completionHandler's`error parameter would apply to all item identifiers
32 /// for which
33 /// `perThumbnailCompletionHandler`had not been called.
34 ///
35 /// If there is no thumbnail for a given item, the
36 /// `perThumbnailCompletionHandler`should be called with its
37 /// `imageData`and
38 /// `error`parameters both
39 /// set to nil.
40 ///
41 /// If the system decides that an in-flight thumbnail request is not needed anymore,
42 /// it will call the returned
43 /// `NSProgress`object's
44 /// `-cancel`method,
45 /// at which time the implementation should clean up any held resources.
46 ///
47 /// The system will cache the thumbnail for the item, and the cache will be
48 /// invalidated when itemVersion.contentVersion changes.
49 #[unsafe(method(fetchThumbnailsForItemIdentifiers:requestedSize:perThumbnailCompletionHandler:completionHandler:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn fetchThumbnailsForItemIdentifiers_requestedSize_perThumbnailCompletionHandler_completionHandler(
52 &self,
53 item_identifiers: &NSArray<NSFileProviderItemIdentifier>,
54 size: CGSize,
55 per_thumbnail_completion_handler: &block2::DynBlock<
56 dyn Fn(NonNull<NSFileProviderItemIdentifier>, *mut NSData, *mut NSError),
57 >,
58 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
59 ) -> Retained<NSProgress>;
60 );
61}