1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! 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>;
);
}