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::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// This class contains information about the thumbnail that should be provided.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklookthumbnailing/qlfilethumbnailrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct QLFileThumbnailRequest;
);

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

impl QLFileThumbnailRequest {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        /// The maximum size of the generated thumbnail that will be accepted. This is also the preferred size, ideally either the width or the height will match the maximumSize's width or height respectively.
        #[unsafe(method(maximumSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumSize(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// The minimum size of the generated thumbnail that will be accepted.
        #[unsafe(method(minimumSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumSize(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// The scale of the requested thumbnail.
        #[unsafe(method(scale))]
        #[unsafe(method_family = none)]
        pub unsafe fn scale(&self) -> CGFloat;

        /// The url of the file for which a thumbnail is being requested.
        #[unsafe(method(fileURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn fileURL(&self) -> Retained<NSURL>;
    );
}

/// Methods declared on superclass `NSObject`.
impl QLFileThumbnailRequest {
    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>;
    );
}