use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-ui-kit")]
#[cfg(any(target_os = "ios", target_os = "visionos"))]
use objc2_ui_kit::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct QLThumbnailRepresentationType(pub NSInteger);
impl QLThumbnailRepresentationType {
#[doc(alias = "QLThumbnailRepresentationTypeIcon")]
pub const Icon: Self = Self(0);
#[doc(alias = "QLThumbnailRepresentationTypeLowQualityThumbnail")]
pub const LowQualityThumbnail: Self = Self(1);
#[doc(alias = "QLThumbnailRepresentationTypeThumbnail")]
pub const Thumbnail: Self = Self(2);
}
unsafe impl Encode for QLThumbnailRepresentationType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for QLThumbnailRepresentationType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct QLThumbnailRepresentation;
);
extern_conformance!(
unsafe impl NSObjectProtocol for QLThumbnailRepresentation {}
);
impl QLThumbnailRepresentation {
extern_methods!(
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> QLThumbnailRepresentationType;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(CGImage))]
#[unsafe(method_family = none)]
pub unsafe fn CGImage(&self) -> Retained<CGImage>;
#[cfg(feature = "objc2-ui-kit")]
#[cfg(any(target_os = "ios", target_os = "visionos"))]
#[unsafe(method(UIImage))]
#[unsafe(method_family = none)]
pub unsafe fn UIImage(&self) -> Retained<UIImage>;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(NSImage))]
#[unsafe(method_family = none)]
pub unsafe fn NSImage(&self) -> Retained<NSImage>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(contentRect))]
#[unsafe(method_family = none)]
pub unsafe fn contentRect(&self) -> CGRect;
);
}
impl QLThumbnailRepresentation {
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>;
);
}