objc2_quick_look_thumbnailing/generated/
QLThumbnailProvider.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/quicklookthumbnailing/qlthumbnailprovider?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct QLThumbnailProvider;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for QLThumbnailProvider {}
19);
20
21impl QLThumbnailProvider {
22    extern_methods!(
23        #[cfg(all(
24            feature = "QLThumbnailReply",
25            feature = "QLThumbnailRequest",
26            feature = "block2"
27        ))]
28        /// Subclass this method to provide a QLThumbnailReply that either contains a drawing block or an image file URL.
29        ///
30        ///
31        /// Parameter `request`: An object which contains information about the thumbnail that should be provided. It contains the URL of the file to provide a thumbnail for.
32        ///
33        /// Parameter `handler`: Call the completion handler with a QLThumbnailReply if you can provide a thumbnail, or with an NSError if you cannot.
34        /// If an error is passed or reply is nil, no thumbnail will be drawn.
35        /// The handler can be called asynchronously after the method has returned.
36        #[unsafe(method(provideThumbnailForFileRequest:completionHandler:))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn provideThumbnailForFileRequest_completionHandler(
39            &self,
40            request: &QLFileThumbnailRequest,
41            handler: &block2::DynBlock<dyn Fn(*mut QLThumbnailReply, *mut NSError)>,
42        );
43    );
44}
45
46/// Methods declared on superclass `NSObject`.
47impl QLThumbnailProvider {
48    extern_methods!(
49        #[unsafe(method(init))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53        #[unsafe(method(new))]
54        #[unsafe(method_family = new)]
55        pub unsafe fn new() -> Retained<Self>;
56    );
57}