use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
use objc2_uniform_type_identifiers::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct QLThumbnailGenerationRequestRepresentationTypes(pub NSUInteger);
bitflags::bitflags! {
impl QLThumbnailGenerationRequestRepresentationTypes: NSUInteger {
#[doc(alias = "QLThumbnailGenerationRequestRepresentationTypeIcon")]
const Icon = 1<<0;
#[doc(alias = "QLThumbnailGenerationRequestRepresentationTypeLowQualityThumbnail")]
const LowQualityThumbnail = 1<<1;
#[doc(alias = "QLThumbnailGenerationRequestRepresentationTypeThumbnail")]
const Thumbnail = 1<<2;
#[doc(alias = "QLThumbnailGenerationRequestRepresentationTypeAll")]
const All = NSUIntegerMax as _;
}
}
unsafe impl Encode for QLThumbnailGenerationRequestRepresentationTypes {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for QLThumbnailGenerationRequestRepresentationTypes {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct QLThumbnailGenerationRequest;
);
extern_conformance!(
unsafe impl NSCoding for QLThumbnailGenerationRequest {}
);
extern_conformance!(
unsafe impl NSCopying for QLThumbnailGenerationRequest {}
);
unsafe impl CopyingHelper for QLThumbnailGenerationRequest {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for QLThumbnailGenerationRequest {}
);
extern_conformance!(
unsafe impl NSSecureCoding for QLThumbnailGenerationRequest {}
);
impl QLThumbnailGenerationRequest {
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>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFileAtURL:size:scale:representationTypes:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFileAtURL_size_scale_representationTypes(
this: Allocated<Self>,
url: &NSURL,
size: CGSize,
scale: CGFloat,
representation_types: QLThumbnailGenerationRequestRepresentationTypes,
) -> Retained<Self>;
#[cfg(feature = "objc2-uniform-type-identifiers")]
#[unsafe(method(contentType))]
#[unsafe(method_family = none)]
pub unsafe fn contentType(&self) -> Retained<UTType>;
#[cfg(feature = "objc2-uniform-type-identifiers")]
#[unsafe(method(setContentType:))]
#[unsafe(method_family = none)]
pub unsafe fn setContentType(&self, content_type: Option<&UTType>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(minimumDimension))]
#[unsafe(method_family = none)]
pub unsafe fn minimumDimension(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setMinimumDimension:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumDimension(&self, minimum_dimension: CGFloat);
#[unsafe(method(iconMode))]
#[unsafe(method_family = none)]
pub unsafe fn iconMode(&self) -> bool;
#[unsafe(method(setIconMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setIconMode(&self, icon_mode: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(size))]
#[unsafe(method_family = none)]
pub unsafe fn size(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(scale))]
#[unsafe(method_family = none)]
pub unsafe fn scale(&self) -> CGFloat;
#[unsafe(method(representationTypes))]
#[unsafe(method_family = none)]
pub unsafe fn representationTypes(&self)
-> QLThumbnailGenerationRequestRepresentationTypes;
);
}