use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use crate::*;
pub const kQLReturnMask: c_uint = 0xaf00;
pub const kQLReturnHasMore: c_uint = kQLReturnMask | 10;
#[doc(alias = "QLThumbnailRequestRef")]
#[repr(C)]
pub struct QLThumbnailRequest {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl QLThumbnailRequest {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__QLThumbnailRequest"> for QLThumbnailRequest {}
);
unsafe impl ConcreteType for QLThumbnailRequest {
#[doc(alias = "QLThumbnailRequestGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn QLThumbnailRequestGetTypeID() -> CFTypeID;
}
unsafe { QLThumbnailRequestGetTypeID() }
}
}
impl QLThumbnailRequest {
#[doc(alias = "QLThumbnailRequestCopyURL")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn url(&self) -> Option<CFRetained<CFURL>> {
extern "C-unwind" {
fn QLThumbnailRequestCopyURL(thumbnail: &QLThumbnailRequest) -> Option<NonNull<CFURL>>;
}
let ret = unsafe { QLThumbnailRequestCopyURL(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLThumbnailRequestCopyOptions")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn options(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn QLThumbnailRequestCopyOptions(
thumbnail: &QLThumbnailRequest,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { QLThumbnailRequestCopyOptions(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLThumbnailRequestCopyContentUTI")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn content_uti(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn QLThumbnailRequestCopyContentUTI(
thumbnail: &QLThumbnailRequest,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { QLThumbnailRequestCopyContentUTI(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLThumbnailRequestGetMaximumSize")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn maximum_size(&self) -> CGSize {
extern "C-unwind" {
fn QLThumbnailRequestGetMaximumSize(thumbnail: &QLThumbnailRequest) -> CGSize;
}
unsafe { QLThumbnailRequestGetMaximumSize(self) }
}
#[doc(alias = "QLThumbnailRequestGetGeneratorBundle")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn generator_bundle(&self) -> Option<CFRetained<CFBundle>> {
extern "C-unwind" {
fn QLThumbnailRequestGetGeneratorBundle(
thumbnail: &QLThumbnailRequest,
) -> Option<NonNull<CFBundle>>;
}
let ret = unsafe { QLThumbnailRequestGetGeneratorBundle(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "QLThumbnailRequestSetDocumentObject")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn set_document_object(
&self,
object: *const c_void,
callbacks: *const CFArrayCallBacks,
) {
extern "C-unwind" {
fn QLThumbnailRequestSetDocumentObject(
thumbnail: &QLThumbnailRequest,
object: *const c_void,
callbacks: *const CFArrayCallBacks,
);
}
unsafe { QLThumbnailRequestSetDocumentObject(self, object, callbacks) }
}
#[doc(alias = "QLThumbnailRequestGetDocumentObject")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn document_object(&self) -> *const c_void {
extern "C-unwind" {
fn QLThumbnailRequestGetDocumentObject(thumbnail: &QLThumbnailRequest)
-> *const c_void;
}
unsafe { QLThumbnailRequestGetDocumentObject(self) }
}
#[doc(alias = "QLThumbnailRequestSetImage")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types"]
#[inline]
pub unsafe fn set_image(&self, image: Option<&CGImage>, properties: Option<&CFDictionary>) {
extern "C-unwind" {
fn QLThumbnailRequestSetImage(
thumbnail: &QLThumbnailRequest,
image: Option<&CGImage>,
properties: Option<&CFDictionary>,
);
}
unsafe { QLThumbnailRequestSetImage(self, image, properties) }
}
#[doc(alias = "QLThumbnailRequestSetImageWithData")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn set_image_with_data(
&self,
data: Option<&CFData>,
properties: Option<&CFDictionary>,
) {
extern "C-unwind" {
fn QLThumbnailRequestSetImageWithData(
thumbnail: &QLThumbnailRequest,
data: Option<&CFData>,
properties: Option<&CFDictionary>,
);
}
unsafe { QLThumbnailRequestSetImageWithData(self, data, properties) }
}
#[doc(alias = "QLThumbnailRequestCreateContext")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn context(
&self,
size: CGSize,
is_bitmap: bool,
properties: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn QLThumbnailRequestCreateContext(
thumbnail: &QLThumbnailRequest,
size: CGSize,
is_bitmap: Boolean,
properties: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret =
unsafe { QLThumbnailRequestCreateContext(self, size, is_bitmap as _, properties) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLThumbnailRequestFlushContext")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn flush_context(&self, context: Option<&CGContext>) {
extern "C-unwind" {
fn QLThumbnailRequestFlushContext(
thumbnail: &QLThumbnailRequest,
context: Option<&CGContext>,
);
}
unsafe { QLThumbnailRequestFlushContext(self, context) }
}
#[doc(alias = "QLThumbnailRequestSetImageAtURL")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn set_image_at_url(&self, url: Option<&CFURL>, properties: Option<&CFDictionary>) {
extern "C-unwind" {
fn QLThumbnailRequestSetImageAtURL(
thumbnail: &QLThumbnailRequest,
url: Option<&CFURL>,
properties: Option<&CFDictionary>,
);
}
unsafe { QLThumbnailRequestSetImageAtURL(self, url, properties) }
}
#[doc(alias = "QLThumbnailRequestSetThumbnailWithDataRepresentation")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn set_thumbnail_with_data_representation(
&self,
data: Option<&CFData>,
content_type_uti: Option<&CFString>,
preview_properties: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
) {
extern "C-unwind" {
fn QLThumbnailRequestSetThumbnailWithDataRepresentation(
thumbnail: &QLThumbnailRequest,
data: Option<&CFData>,
content_type_uti: Option<&CFString>,
preview_properties: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
);
}
unsafe {
QLThumbnailRequestSetThumbnailWithDataRepresentation(
self,
data,
content_type_uti,
preview_properties,
properties,
)
}
}
#[doc(alias = "QLThumbnailRequestSetThumbnailWithURLRepresentation")]
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn set_thumbnail_with_url_representation(
&self,
url: Option<&CFURL>,
content_type_uti: Option<&CFString>,
preview_properties: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
) {
extern "C-unwind" {
fn QLThumbnailRequestSetThumbnailWithURLRepresentation(
thumbnail: &QLThumbnailRequest,
url: Option<&CFURL>,
content_type_uti: Option<&CFString>,
preview_properties: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
);
}
unsafe {
QLThumbnailRequestSetThumbnailWithURLRepresentation(
self,
url,
content_type_uti,
preview_properties,
properties,
)
}
}
#[doc(alias = "QLThumbnailRequestIsCancelled")]
#[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
#[inline]
pub unsafe fn is_cancelled(&self) -> bool {
extern "C-unwind" {
fn QLThumbnailRequestIsCancelled(thumbnail: &QLThumbnailRequest) -> Boolean;
}
let ret = unsafe { QLThumbnailRequestIsCancelled(self) };
ret != 0
}
}
extern "C" {
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
pub static kQLThumbnailPropertyExtensionKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
pub static kQLThumbnailPropertyBadgeImageKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
pub static kQLThumbnailPropertyBaseBundlePathKey: Option<&'static CFString>;
}
#[doc(alias = "QLPreviewRequestRef")]
#[repr(C)]
pub struct QLPreviewRequest {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl QLPreviewRequest {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__QLPreviewRequest"> for QLPreviewRequest {}
);
unsafe impl ConcreteType for QLPreviewRequest {
#[doc(alias = "QLPreviewRequestGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn QLPreviewRequestGetTypeID() -> CFTypeID;
}
unsafe { QLPreviewRequestGetTypeID() }
}
}
extern "C" {
#[deprecated = "Use the title property of your QLPreviewingController in a Preview Extension."]
pub static kQLPreviewPropertyDisplayNameKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use the preferredContentSize property of your QLPreviewingController in a Preview Extension."]
pub static kQLPreviewPropertyWidthKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use the preferredContentSize property of your QLPreviewingController in a Preview Extension."]
pub static kQLPreviewPropertyHeightKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyBaseBundlePathKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyStringEncodingKey: Option<&'static CFString>;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct QLPreviewPDFStyle(pub c_uint);
impl QLPreviewPDFStyle {
#[doc(alias = "kQLPreviewPDFStandardStyle")]
pub const StandardStyle: Self = Self(0);
#[doc(alias = "kQLPreviewPDFPagesWithThumbnailsOnRightStyle")]
pub const PagesWithThumbnailsOnRightStyle: Self = Self(3);
#[doc(alias = "kQLPreviewPDFPagesWithThumbnailsOnLeftStyle")]
pub const PagesWithThumbnailsOnLeftStyle: Self = Self(4);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for QLPreviewPDFStyle {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for QLPreviewPDFStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyPDFStyleKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewOptionCursorKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyCursorKey: Option<&'static CFString>;
}
impl QLPreviewRequest {
#[doc(alias = "QLPreviewRequestCopyURL")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn url(&self) -> Option<CFRetained<CFURL>> {
extern "C-unwind" {
fn QLPreviewRequestCopyURL(preview: &QLPreviewRequest) -> Option<NonNull<CFURL>>;
}
let ret = unsafe { QLPreviewRequestCopyURL(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLPreviewRequestCopyOptions")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn options(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn QLPreviewRequestCopyOptions(
preview: &QLPreviewRequest,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { QLPreviewRequestCopyOptions(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLPreviewRequestCopyContentUTI")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn content_uti(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn QLPreviewRequestCopyContentUTI(
preview: &QLPreviewRequest,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { QLPreviewRequestCopyContentUTI(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLPreviewRequestGetGeneratorBundle")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn generator_bundle(&self) -> Option<CFRetained<CFBundle>> {
extern "C-unwind" {
fn QLPreviewRequestGetGeneratorBundle(
preview: &QLPreviewRequest,
) -> Option<NonNull<CFBundle>>;
}
let ret = unsafe { QLPreviewRequestGetGeneratorBundle(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "QLPreviewRequestSetDocumentObject")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn set_document_object(
&self,
object: *const c_void,
callbacks: *const CFArrayCallBacks,
) {
extern "C-unwind" {
fn QLPreviewRequestSetDocumentObject(
preview: &QLPreviewRequest,
object: *const c_void,
callbacks: *const CFArrayCallBacks,
);
}
unsafe { QLPreviewRequestSetDocumentObject(self, object, callbacks) }
}
#[doc(alias = "QLPreviewRequestGetDocumentObject")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn document_object(&self) -> *const c_void {
extern "C-unwind" {
fn QLPreviewRequestGetDocumentObject(preview: &QLPreviewRequest) -> *const c_void;
}
unsafe { QLPreviewRequestGetDocumentObject(self) }
}
#[doc(alias = "QLPreviewRequestIsCancelled")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn is_cancelled(&self) -> bool {
extern "C-unwind" {
fn QLPreviewRequestIsCancelled(preview: &QLPreviewRequest) -> Boolean;
}
let ret = unsafe { QLPreviewRequestIsCancelled(self) };
ret != 0
}
#[doc(alias = "QLPreviewRequestSetDataRepresentation")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn set_data_representation(
&self,
data: Option<&CFData>,
content_type_uti: Option<&CFString>,
properties: Option<&CFDictionary>,
) {
extern "C-unwind" {
fn QLPreviewRequestSetDataRepresentation(
preview: &QLPreviewRequest,
data: Option<&CFData>,
content_type_uti: Option<&CFString>,
properties: Option<&CFDictionary>,
);
}
unsafe { QLPreviewRequestSetDataRepresentation(self, data, content_type_uti, properties) }
}
#[doc(alias = "QLPreviewRequestSetURLRepresentation")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn set_url_representation(
&self,
url: Option<&CFURL>,
content_type_uti: Option<&CFString>,
properties: Option<&CFDictionary>,
) {
extern "C-unwind" {
fn QLPreviewRequestSetURLRepresentation(
preview: &QLPreviewRequest,
url: Option<&CFURL>,
content_type_uti: Option<&CFString>,
properties: Option<&CFDictionary>,
);
}
unsafe { QLPreviewRequestSetURLRepresentation(self, url, content_type_uti, properties) }
}
#[doc(alias = "QLPreviewRequestCreateContext")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn context(
&self,
size: CGSize,
is_bitmap: bool,
properties: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn QLPreviewRequestCreateContext(
preview: &QLPreviewRequest,
size: CGSize,
is_bitmap: Boolean,
properties: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret = unsafe { QLPreviewRequestCreateContext(self, size, is_bitmap as _, properties) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLPreviewRequestCreatePDFContext")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn pdf_context(
&self,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn QLPreviewRequestCreatePDFContext(
preview: &QLPreviewRequest,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret = unsafe {
QLPreviewRequestCreatePDFContext(self, media_box, auxiliary_info, properties)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "QLPreviewRequestFlushContext")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
#[inline]
pub unsafe fn flush_context(&self, context: Option<&CGContext>) {
extern "C-unwind" {
fn QLPreviewRequestFlushContext(
preview: &QLPreviewRequest,
context: Option<&CGContext>,
);
}
unsafe { QLPreviewRequestFlushContext(self, context) }
}
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyMIMETypeKey: Option<&'static CFString>;
}
extern "C" {
pub static kQLPreviewPropertyTextEncodingNameKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyAttachmentDataKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewPropertyAttachmentsKey: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
pub static kQLPreviewContentIDScheme: Option<&'static CFString>;
}
#[repr(C)]
#[allow(unpredictable_function_pointer_comparisons)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct QLGeneratorInterfaceStruct {
pub(crate) _reserved: *mut c_void,
pub QueryInterface:
Option<unsafe extern "C-unwind" fn(*mut c_void, REFIID, *mut LPVOID) -> HRESULT>,
pub AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>,
pub Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>,
pub GenerateThumbnailForURL: Option<
unsafe extern "C-unwind" fn(
*mut c_void,
*mut QLThumbnailRequest,
*const CFURL,
*const CFString,
*const CFDictionary,
CGSize,
) -> OSStatus,
>,
pub CancelThumbnailGeneration:
Option<unsafe extern "C-unwind" fn(*mut c_void, *mut QLThumbnailRequest)>,
pub GeneratePreviewForURL: Option<
unsafe extern "C-unwind" fn(
*mut c_void,
*mut QLPreviewRequest,
*const CFURL,
*const CFString,
*const CFDictionary,
) -> OSStatus,
>,
pub CancelPreviewGeneration:
Option<unsafe extern "C-unwind" fn(*mut c_void, *mut QLPreviewRequest)>,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for QLGeneratorInterfaceStruct {
const ENCODING: Encoding = Encoding::Struct("?", &[
<*mut c_void>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,REFIID,*mut LPVOID,) -> HRESULT>>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,) -> ULONG>>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,) -> ULONG>>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLThumbnailRequest,*const CFURL,*const CFString,*const CFDictionary,CGSize,) -> OSStatus>>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLThumbnailRequest,)>>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLPreviewRequest,*const CFURL,*const CFString,*const CFDictionary,) -> OSStatus>>::ENCODING,
<Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLPreviewRequest,)>>::ENCODING,
]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for QLGeneratorInterfaceStruct {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated = "renamed to `QLThumbnailRequest::url`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailRequestCopyURL(
thumbnail: &QLThumbnailRequest,
) -> Option<CFRetained<CFURL>> {
extern "C-unwind" {
fn QLThumbnailRequestCopyURL(thumbnail: &QLThumbnailRequest) -> Option<NonNull<CFURL>>;
}
let ret = unsafe { QLThumbnailRequestCopyURL(thumbnail) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `QLThumbnailRequest::options`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailRequestCopyOptions(
thumbnail: &QLThumbnailRequest,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn QLThumbnailRequestCopyOptions(
thumbnail: &QLThumbnailRequest,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { QLThumbnailRequestCopyOptions(thumbnail) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `QLThumbnailRequest::content_uti`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailRequestCopyContentUTI(
thumbnail: &QLThumbnailRequest,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn QLThumbnailRequestCopyContentUTI(
thumbnail: &QLThumbnailRequest,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { QLThumbnailRequestCopyContentUTI(thumbnail) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::maximum_size`"]
pub fn QLThumbnailRequestGetMaximumSize(thumbnail: &QLThumbnailRequest) -> CGSize;
}
#[deprecated = "renamed to `QLThumbnailRequest::generator_bundle`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailRequestGetGeneratorBundle(
thumbnail: &QLThumbnailRequest,
) -> Option<CFRetained<CFBundle>> {
extern "C-unwind" {
fn QLThumbnailRequestGetGeneratorBundle(
thumbnail: &QLThumbnailRequest,
) -> Option<NonNull<CFBundle>>;
}
let ret = unsafe { QLThumbnailRequestGetGeneratorBundle(thumbnail) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::set_document_object`"]
pub fn QLThumbnailRequestSetDocumentObject(
thumbnail: &QLThumbnailRequest,
object: *const c_void,
callbacks: *const CFArrayCallBacks,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::document_object`"]
pub fn QLThumbnailRequestGetDocumentObject(thumbnail: &QLThumbnailRequest) -> *const c_void;
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLThumbnailRequest::set_image`"]
pub fn QLThumbnailRequestSetImage(
thumbnail: &QLThumbnailRequest,
image: Option<&CGImage>,
properties: Option<&CFDictionary>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::set_image_with_data`"]
pub fn QLThumbnailRequestSetImageWithData(
thumbnail: &QLThumbnailRequest,
data: Option<&CFData>,
properties: Option<&CFDictionary>,
);
}
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLThumbnailRequest::context`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailRequestCreateContext(
thumbnail: &QLThumbnailRequest,
size: CGSize,
is_bitmap: bool,
properties: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn QLThumbnailRequestCreateContext(
thumbnail: &QLThumbnailRequest,
size: CGSize,
is_bitmap: Boolean,
properties: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret =
unsafe { QLThumbnailRequestCreateContext(thumbnail, size, is_bitmap as _, properties) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLThumbnailRequest::flush_context`"]
pub fn QLThumbnailRequestFlushContext(
thumbnail: &QLThumbnailRequest,
context: Option<&CGContext>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::set_image_at_url`"]
pub fn QLThumbnailRequestSetImageAtURL(
thumbnail: &QLThumbnailRequest,
url: Option<&CFURL>,
properties: Option<&CFDictionary>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::set_thumbnail_with_data_representation`"]
pub fn QLThumbnailRequestSetThumbnailWithDataRepresentation(
thumbnail: &QLThumbnailRequest,
data: Option<&CFData>,
content_type_uti: Option<&CFString>,
preview_properties: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLThumbnailRequest::set_thumbnail_with_url_representation`"]
pub fn QLThumbnailRequestSetThumbnailWithURLRepresentation(
thumbnail: &QLThumbnailRequest,
url: Option<&CFURL>,
content_type_uti: Option<&CFString>,
preview_properties: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
);
}
#[deprecated = "renamed to `QLThumbnailRequest::is_cancelled`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailRequestIsCancelled(
thumbnail: &QLThumbnailRequest,
) -> bool {
extern "C-unwind" {
fn QLThumbnailRequestIsCancelled(thumbnail: &QLThumbnailRequest) -> Boolean;
}
let ret = unsafe { QLThumbnailRequestIsCancelled(thumbnail) };
ret != 0
}
#[deprecated = "renamed to `QLPreviewRequest::url`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestCopyURL(
preview: &QLPreviewRequest,
) -> Option<CFRetained<CFURL>> {
extern "C-unwind" {
fn QLPreviewRequestCopyURL(preview: &QLPreviewRequest) -> Option<NonNull<CFURL>>;
}
let ret = unsafe { QLPreviewRequestCopyURL(preview) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `QLPreviewRequest::options`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestCopyOptions(
preview: &QLPreviewRequest,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn QLPreviewRequestCopyOptions(preview: &QLPreviewRequest)
-> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { QLPreviewRequestCopyOptions(preview) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `QLPreviewRequest::content_uti`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestCopyContentUTI(
preview: &QLPreviewRequest,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn QLPreviewRequestCopyContentUTI(preview: &QLPreviewRequest) -> Option<NonNull<CFString>>;
}
let ret = unsafe { QLPreviewRequestCopyContentUTI(preview) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `QLPreviewRequest::generator_bundle`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestGetGeneratorBundle(
preview: &QLPreviewRequest,
) -> Option<CFRetained<CFBundle>> {
extern "C-unwind" {
fn QLPreviewRequestGetGeneratorBundle(
preview: &QLPreviewRequest,
) -> Option<NonNull<CFBundle>>;
}
let ret = unsafe { QLPreviewRequestGetGeneratorBundle(preview) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `QLPreviewRequest::set_document_object`"]
pub fn QLPreviewRequestSetDocumentObject(
preview: &QLPreviewRequest,
object: *const c_void,
callbacks: *const CFArrayCallBacks,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLPreviewRequest::document_object`"]
pub fn QLPreviewRequestGetDocumentObject(preview: &QLPreviewRequest) -> *const c_void;
}
#[deprecated = "renamed to `QLPreviewRequest::is_cancelled`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestIsCancelled(preview: &QLPreviewRequest) -> bool {
extern "C-unwind" {
fn QLPreviewRequestIsCancelled(preview: &QLPreviewRequest) -> Boolean;
}
let ret = unsafe { QLPreviewRequestIsCancelled(preview) };
ret != 0
}
extern "C-unwind" {
#[deprecated = "renamed to `QLPreviewRequest::set_data_representation`"]
pub fn QLPreviewRequestSetDataRepresentation(
preview: &QLPreviewRequest,
data: Option<&CFData>,
content_type_uti: Option<&CFString>,
properties: Option<&CFDictionary>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `QLPreviewRequest::set_url_representation`"]
pub fn QLPreviewRequestSetURLRepresentation(
preview: &QLPreviewRequest,
url: Option<&CFURL>,
content_type_uti: Option<&CFString>,
properties: Option<&CFDictionary>,
);
}
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLPreviewRequest::context`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestCreateContext(
preview: &QLPreviewRequest,
size: CGSize,
is_bitmap: bool,
properties: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn QLPreviewRequestCreateContext(
preview: &QLPreviewRequest,
size: CGSize,
is_bitmap: Boolean,
properties: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret = unsafe { QLPreviewRequestCreateContext(preview, size, is_bitmap as _, properties) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLPreviewRequest::pdf_context`"]
#[inline]
pub unsafe extern "C-unwind" fn QLPreviewRequestCreatePDFContext(
preview: &QLPreviewRequest,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn QLPreviewRequestCreatePDFContext(
preview: &QLPreviewRequest,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
properties: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret =
unsafe { QLPreviewRequestCreatePDFContext(preview, media_box, auxiliary_info, properties) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLPreviewRequest::flush_context`"]
pub fn QLPreviewRequestFlushContext(preview: &QLPreviewRequest, context: Option<&CGContext>);
}