objc2-quick-look-thumbnailing 0.3.2

Bindings to the QuickLookThumbnailing 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::*;
use objc2_foundation::*;

use crate::*;

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

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

impl QLThumbnailProvider {
    extern_methods!(
        #[cfg(all(
            feature = "QLThumbnailReply",
            feature = "QLThumbnailRequest",
            feature = "block2"
        ))]
        /// Subclass this method to provide a QLThumbnailReply that either contains a drawing block or an image file URL.
        ///
        ///
        /// 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.
        ///
        /// Parameter `handler`: Call the completion handler with a QLThumbnailReply if you can provide a thumbnail, or with an NSError if you cannot.
        /// If an error is passed or reply is nil, no thumbnail will be drawn.
        /// The handler can be called asynchronously after the method has returned.
        #[unsafe(method(provideThumbnailForFileRequest:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn provideThumbnailForFileRequest_completionHandler(
            &self,
            request: &QLFileThumbnailRequest,
            handler: &block2::DynBlock<dyn Fn(*mut QLThumbnailReply, *mut NSError)>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl QLThumbnailProvider {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}