objc2_quick_look/generated/
QLGenerator.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10#[cfg(feature = "objc2-core-graphics")]
11use objc2_core_graphics::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlreturnmask?language=objc)
16pub const kQLReturnMask: c_uint = 0xaf00;
17/// [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlreturnhasmore?language=objc)
18pub const kQLReturnHasMore: c_uint = kQLReturnMask | 10;
19/// This is the type of a reference to Thumbnail requests.
20///
21/// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/qlthumbnailrequest?language=objc)
22#[doc(alias = "QLThumbnailRequestRef")]
23#[repr(C)]
24pub struct QLThumbnailRequest {
25    inner: [u8; 0],
26    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
27}
28
29cf_type!(
30    unsafe impl QLThumbnailRequest {}
31);
32#[cfg(feature = "objc2")]
33cf_objc2_type!(
34    unsafe impl RefEncode<"__QLThumbnailRequest"> for QLThumbnailRequest {}
35);
36
37unsafe impl ConcreteType for QLThumbnailRequest {
38    /// Returns the CoreFoundation type ID for QLThumbnailRequests.
39    #[doc(alias = "QLThumbnailRequestGetTypeID")]
40    #[inline]
41    fn type_id() -> CFTypeID {
42        extern "C-unwind" {
43            fn QLThumbnailRequestGetTypeID() -> CFTypeID;
44        }
45        unsafe { QLThumbnailRequestGetTypeID() }
46    }
47}
48
49impl QLThumbnailRequest {
50    /// Returns the url of the file for the thumbnail request.
51    ///
52    /// Parameter `thumbnail`: The thumbnail request.
53    ///
54    /// Returns: The url of the file for the thumbnail request.
55    #[doc(alias = "QLThumbnailRequestCopyURL")]
56    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
57    #[inline]
58    pub unsafe fn url(&self) -> Option<CFRetained<CFURL>> {
59        extern "C-unwind" {
60            fn QLThumbnailRequestCopyURL(thumbnail: &QLThumbnailRequest) -> Option<NonNull<CFURL>>;
61        }
62        let ret = unsafe { QLThumbnailRequestCopyURL(self) };
63        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
64    }
65
66    /// Returns the desired options for the thumbnail request.
67    ///
68    /// Parameter `thumbnail`: The thumbnail request.
69    ///
70    /// Returns: The desired options for the thumbnail request.
71    #[doc(alias = "QLThumbnailRequestCopyOptions")]
72    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
73    #[inline]
74    pub unsafe fn options(&self) -> Option<CFRetained<CFDictionary>> {
75        extern "C-unwind" {
76            fn QLThumbnailRequestCopyOptions(
77                thumbnail: &QLThumbnailRequest,
78            ) -> Option<NonNull<CFDictionary>>;
79        }
80        let ret = unsafe { QLThumbnailRequestCopyOptions(self) };
81        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
82    }
83
84    /// Returns the UTI for the thumbnail request.
85    ///
86    /// Parameter `thumbnail`: The thumbnail request.
87    ///
88    /// Returns: The UTI of the content being thumbnailed, NULL if not available.
89    #[doc(alias = "QLThumbnailRequestCopyContentUTI")]
90    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
91    #[inline]
92    pub unsafe fn content_uti(&self) -> Option<CFRetained<CFString>> {
93        extern "C-unwind" {
94            fn QLThumbnailRequestCopyContentUTI(
95                thumbnail: &QLThumbnailRequest,
96            ) -> Option<NonNull<CFString>>;
97        }
98        let ret = unsafe { QLThumbnailRequestCopyContentUTI(self) };
99        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
100    }
101
102    /// Returns the maximum desired size (in points) for the thumbnail request.
103    ///
104    /// Parameter `thumbnail`: The thumbnail request.
105    ///
106    /// Returns: The maximum desired size (in points) for the thumbnail request.
107    #[doc(alias = "QLThumbnailRequestGetMaximumSize")]
108    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
109    #[inline]
110    pub unsafe fn maximum_size(&self) -> CGSize {
111        extern "C-unwind" {
112            fn QLThumbnailRequestGetMaximumSize(thumbnail: &QLThumbnailRequest) -> CGSize;
113        }
114        unsafe { QLThumbnailRequestGetMaximumSize(self) }
115    }
116
117    /// Get the thumbnail request generator bundle.
118    ///
119    /// Parameter `thumbnail`: The thumbnail request.
120    #[doc(alias = "QLThumbnailRequestGetGeneratorBundle")]
121    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
122    #[inline]
123    pub unsafe fn generator_bundle(&self) -> Option<CFRetained<CFBundle>> {
124        extern "C-unwind" {
125            fn QLThumbnailRequestGetGeneratorBundle(
126                thumbnail: &QLThumbnailRequest,
127            ) -> Option<NonNull<CFBundle>>;
128        }
129        let ret = unsafe { QLThumbnailRequestGetGeneratorBundle(self) };
130        ret.map(|ret| unsafe { CFRetained::retain(ret) })
131    }
132
133    /// Store some object in thumbnail request.
134    ///
135    /// Parameter `thumbnail`: The thumbnail request.
136    ///
137    /// Parameter `object`: The object representing the document
138    ///
139    /// Parameter `callbacks`: Callbacks to retain/release/etc. the object.
140    ///
141    /// You can only call this function once per request.
142    ///
143    /// # Safety
144    ///
145    /// - `object` must be a valid pointer.
146    /// - `callbacks` must be a valid pointer.
147    #[doc(alias = "QLThumbnailRequestSetDocumentObject")]
148    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
149    #[inline]
150    pub unsafe fn set_document_object(
151        &self,
152        object: *const c_void,
153        callbacks: *const CFArrayCallBacks,
154    ) {
155        extern "C-unwind" {
156            fn QLThumbnailRequestSetDocumentObject(
157                thumbnail: &QLThumbnailRequest,
158                object: *const c_void,
159                callbacks: *const CFArrayCallBacks,
160            );
161        }
162        unsafe { QLThumbnailRequestSetDocumentObject(self, object, callbacks) }
163    }
164
165    /// Get the object previously stored with QLThumbnailRequestSetDocumentObject.
166    ///
167    /// Parameter `thumbnail`: The thumbnail request.
168    ///
169    /// Returns: The object representing the document
170    #[doc(alias = "QLThumbnailRequestGetDocumentObject")]
171    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
172    #[inline]
173    pub unsafe fn document_object(&self) -> *const c_void {
174        extern "C-unwind" {
175            fn QLThumbnailRequestGetDocumentObject(thumbnail: &QLThumbnailRequest)
176                -> *const c_void;
177        }
178        unsafe { QLThumbnailRequestGetDocumentObject(self) }
179    }
180
181    /// Sets the thumbnail request response to image.
182    ///
183    /// Parameter `thumbnail`: The thumbnail request.
184    ///
185    /// Parameter `image`: The thumbnail image response.
186    ///
187    /// Parameter `properties`: See possible properties below.
188    ///
189    /// # Safety
190    ///
191    /// - `image` might not allow `None`.
192    /// - `properties` generics must be of the correct type.
193    /// - `properties` might not allow `None`.
194    #[doc(alias = "QLThumbnailRequestSetImage")]
195    #[cfg(feature = "objc2-core-graphics")]
196    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types"]
197    #[inline]
198    pub unsafe fn set_image(&self, image: Option<&CGImage>, properties: Option<&CFDictionary>) {
199        extern "C-unwind" {
200            fn QLThumbnailRequestSetImage(
201                thumbnail: &QLThumbnailRequest,
202                image: Option<&CGImage>,
203                properties: Option<&CFDictionary>,
204            );
205        }
206        unsafe { QLThumbnailRequestSetImage(self, image, properties) }
207    }
208
209    /// Sets the thumbnail request response to image data.
210    ///
211    /// Parameter `thumbnail`: The thumbnail request.
212    ///
213    /// Parameter `data`: The thumbnail image response as data. The image format should be supported by ImageIO
214    ///
215    /// Parameter `properties`: See possible properties below. Additional useful properties: kCGImageSourceTypeIdentifierHint (see ImageIO documentation).
216    ///
217    /// # Safety
218    ///
219    /// - `data` might not allow `None`.
220    /// - `properties` generics must be of the correct type.
221    /// - `properties` might not allow `None`.
222    #[doc(alias = "QLThumbnailRequestSetImageWithData")]
223    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
224    #[inline]
225    pub unsafe fn set_image_with_data(
226        &self,
227        data: Option<&CFData>,
228        properties: Option<&CFDictionary>,
229    ) {
230        extern "C-unwind" {
231            fn QLThumbnailRequestSetImageWithData(
232                thumbnail: &QLThumbnailRequest,
233                data: Option<&CFData>,
234                properties: Option<&CFDictionary>,
235            );
236        }
237        unsafe { QLThumbnailRequestSetImageWithData(self, data, properties) }
238    }
239
240    /// Creates a graphic context to draw the thumbnail response in.
241    ///
242    /// Parameter `thumbnail`: The thumbnail request.
243    ///
244    /// Parameter `size`: Size in points of the context for the thumbnail response.
245    ///
246    /// Parameter `isBitmap`: True if thumbnail contents is based on bitmap. size will then be interpreted as pixels, not points.
247    ///
248    /// Parameter `properties`: See possible properties below.
249    ///
250    /// Returns: A graphic context to draw to.
251    ///
252    /// Once the thumbnail is fully drawn, you should call QLThumbnailRequestFlushContext().
253    ///
254    /// # Safety
255    ///
256    /// - `properties` generics must be of the correct type.
257    /// - `properties` might not allow `None`.
258    #[doc(alias = "QLThumbnailRequestCreateContext")]
259    #[cfg(feature = "objc2-core-graphics")]
260    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
261    #[inline]
262    pub unsafe fn context(
263        &self,
264        size: CGSize,
265        is_bitmap: bool,
266        properties: Option<&CFDictionary>,
267    ) -> Option<CFRetained<CGContext>> {
268        extern "C-unwind" {
269            fn QLThumbnailRequestCreateContext(
270                thumbnail: &QLThumbnailRequest,
271                size: CGSize,
272                is_bitmap: Boolean,
273                properties: Option<&CFDictionary>,
274            ) -> Option<NonNull<CGContext>>;
275        }
276        let ret =
277            unsafe { QLThumbnailRequestCreateContext(self, size, is_bitmap as _, properties) };
278        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
279    }
280
281    /// Flushes the graphic context and creates the thumbnail image response.
282    ///
283    /// Parameter `thumbnail`: The thumbnail request.
284    ///
285    /// Parameter `context`: The graphic context created by QLThumbnailRequestCreateContext().
286    ///
287    /// # Safety
288    ///
289    /// `context` might not allow `None`.
290    #[doc(alias = "QLThumbnailRequestFlushContext")]
291    #[cfg(feature = "objc2-core-graphics")]
292    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
293    #[inline]
294    pub unsafe fn flush_context(&self, context: Option<&CGContext>) {
295        extern "C-unwind" {
296            fn QLThumbnailRequestFlushContext(
297                thumbnail: &QLThumbnailRequest,
298                context: Option<&CGContext>,
299            );
300        }
301        unsafe { QLThumbnailRequestFlushContext(self, context) }
302    }
303
304    /// Sets the thumbnail request response to the image contained at url.
305    ///
306    /// Parameter `thumbnail`: The thumbnail request.
307    ///
308    /// Parameter `url`: The url to the thumbnail image response.
309    ///
310    /// Parameter `properties`: Currently unused.
311    ///
312    /// # Safety
313    ///
314    /// - `url` might not allow `None`.
315    /// - `properties` generics must be of the correct type.
316    /// - `properties` might not allow `None`.
317    #[doc(alias = "QLThumbnailRequestSetImageAtURL")]
318    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
319    #[inline]
320    pub unsafe fn set_image_at_url(&self, url: Option<&CFURL>, properties: Option<&CFDictionary>) {
321        extern "C-unwind" {
322            fn QLThumbnailRequestSetImageAtURL(
323                thumbnail: &QLThumbnailRequest,
324                url: Option<&CFURL>,
325                properties: Option<&CFDictionary>,
326            );
327        }
328        unsafe { QLThumbnailRequestSetImageAtURL(self, url, properties) }
329    }
330
331    /// Sets the thumbnail request response to the image produced by the equivalent preview representation.
332    ///
333    /// Parameter `thumbnail`: The thumbnail request.
334    ///
335    /// Parameter `data`: The content data.
336    ///
337    /// Parameter `contentTypeUTI`: The contentTypeUTI for the preview representation.
338    ///
339    /// Parameter `previewProperties`: Additional properties for the preview response.
340    ///
341    /// Parameter `properties`: Currently unused.
342    ///
343    /// Currently supported UTIs are: none. This call only works if your generator is set to be run in the main thread
344    ///
345    /// # Safety
346    ///
347    /// - `data` might not allow `None`.
348    /// - `content_type_uti` might not allow `None`.
349    /// - `preview_properties` generics must be of the correct type.
350    /// - `preview_properties` might not allow `None`.
351    /// - `properties` generics must be of the correct type.
352    /// - `properties` might not allow `None`.
353    #[doc(alias = "QLThumbnailRequestSetThumbnailWithDataRepresentation")]
354    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
355    #[inline]
356    pub unsafe fn set_thumbnail_with_data_representation(
357        &self,
358        data: Option<&CFData>,
359        content_type_uti: Option<&CFString>,
360        preview_properties: Option<&CFDictionary>,
361        properties: Option<&CFDictionary>,
362    ) {
363        extern "C-unwind" {
364            fn QLThumbnailRequestSetThumbnailWithDataRepresentation(
365                thumbnail: &QLThumbnailRequest,
366                data: Option<&CFData>,
367                content_type_uti: Option<&CFString>,
368                preview_properties: Option<&CFDictionary>,
369                properties: Option<&CFDictionary>,
370            );
371        }
372        unsafe {
373            QLThumbnailRequestSetThumbnailWithDataRepresentation(
374                self,
375                data,
376                content_type_uti,
377                preview_properties,
378                properties,
379            )
380        }
381    }
382
383    /// Sets the thumbnail request response to the image produced by the equivalent preview representation.
384    ///
385    /// Parameter `thumbnail`: The thumbnail request.
386    ///
387    /// Parameter `url`: The url to the preview response.
388    ///
389    /// Parameter `contentTypeUTI`: The contentTypeUTI for the preview representation.
390    ///
391    /// Parameter `properties`: Additional properties for the preview response.
392    ///
393    /// Currently supported UTIs are: none. This call only works if your generator is set to be run in the main thread
394    ///
395    /// # Safety
396    ///
397    /// - `url` might not allow `None`.
398    /// - `content_type_uti` might not allow `None`.
399    /// - `preview_properties` generics must be of the correct type.
400    /// - `preview_properties` might not allow `None`.
401    /// - `properties` generics must be of the correct type.
402    /// - `properties` might not allow `None`.
403    #[doc(alias = "QLThumbnailRequestSetThumbnailWithURLRepresentation")]
404    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
405    #[inline]
406    pub unsafe fn set_thumbnail_with_url_representation(
407        &self,
408        url: Option<&CFURL>,
409        content_type_uti: Option<&CFString>,
410        preview_properties: Option<&CFDictionary>,
411        properties: Option<&CFDictionary>,
412    ) {
413        extern "C-unwind" {
414            fn QLThumbnailRequestSetThumbnailWithURLRepresentation(
415                thumbnail: &QLThumbnailRequest,
416                url: Option<&CFURL>,
417                content_type_uti: Option<&CFString>,
418                preview_properties: Option<&CFDictionary>,
419                properties: Option<&CFDictionary>,
420            );
421        }
422        unsafe {
423            QLThumbnailRequestSetThumbnailWithURLRepresentation(
424                self,
425                url,
426                content_type_uti,
427                preview_properties,
428                properties,
429            )
430        }
431    }
432
433    /// Returns wether the thumbnail request was cancelled or not.
434    ///
435    /// Parameter `thumbnail`: The thumbnail request.
436    ///
437    /// Returns: true if the request was cancelled.
438    #[doc(alias = "QLThumbnailRequestIsCancelled")]
439    #[deprecated = "Use a QLFileThumbnailRequest in a Thumbnail Extension to provide thumbnails for your file types."]
440    #[inline]
441    pub unsafe fn is_cancelled(&self) -> bool {
442        extern "C-unwind" {
443            fn QLThumbnailRequestIsCancelled(thumbnail: &QLThumbnailRequest) -> Boolean;
444        }
445        let ret = unsafe { QLThumbnailRequestIsCancelled(self) };
446        ret != 0
447    }
448}
449
450extern "C" {
451    /// Value should be a CFString. The extension is used as a badge when producing an icon.
452    ///
453    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlthumbnailpropertyextensionkey?language=objc)
454    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
455    pub static kQLThumbnailPropertyExtensionKey: Option<&'static CFString>;
456}
457
458extern "C" {
459    /// Value should be a CGImage. The badge is used when producing an icon.
460    ///
461    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlthumbnailpropertybadgeimagekey?language=objc)
462    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
463    pub static kQLThumbnailPropertyBadgeImageKey: Option<&'static CFString>;
464}
465
466extern "C" {
467    /// Extends the security scope where Quick Look will accept to look at a file. Value is a path as CFString.
468    ///
469    /// Only useful when using QLThumbnailRequestSetImageAtURL() or QLThumbnailRequestSetThumbnailWithURLRepresentation().
470    /// By default, Quick Look will only accept files within the current document bundle.
471    ///
472    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlthumbnailpropertybasebundlepathkey?language=objc)
473    #[deprecated = "Use a QLThumbnailReply in a Thumbnail Extension to provide thumbnails for your file types."]
474    pub static kQLThumbnailPropertyBaseBundlePathKey: Option<&'static CFString>;
475}
476
477/// This is the type of a reference to Preview requests.
478///
479/// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/qlpreviewrequest?language=objc)
480#[doc(alias = "QLPreviewRequestRef")]
481#[repr(C)]
482pub struct QLPreviewRequest {
483    inner: [u8; 0],
484    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
485}
486
487cf_type!(
488    unsafe impl QLPreviewRequest {}
489);
490#[cfg(feature = "objc2")]
491cf_objc2_type!(
492    unsafe impl RefEncode<"__QLPreviewRequest"> for QLPreviewRequest {}
493);
494
495unsafe impl ConcreteType for QLPreviewRequest {
496    /// Returns the CoreFoundation type ID for QLPreviewRequests.
497    #[doc(alias = "QLPreviewRequestGetTypeID")]
498    #[inline]
499    fn type_id() -> CFTypeID {
500        extern "C-unwind" {
501            fn QLPreviewRequestGetTypeID() -> CFTypeID;
502        }
503        unsafe { QLPreviewRequestGetTypeID() }
504    }
505}
506
507extern "C" {
508    /// Customizes Displayed name in the preview panel. This replaces the document's display name. Value is a CFString.
509    ///
510    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertydisplaynamekey?language=objc)
511    #[deprecated = "Use the title property of your QLPreviewingController in a Preview Extension."]
512    pub static kQLPreviewPropertyDisplayNameKey: Option<&'static CFString>;
513}
514
515extern "C" {
516    /// Gives the width (in points) of the preview. Value is a CFNumber.
517    ///
518    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertywidthkey?language=objc)
519    #[deprecated = "Use the preferredContentSize property of your QLPreviewingController in a Preview Extension."]
520    pub static kQLPreviewPropertyWidthKey: Option<&'static CFString>;
521}
522
523extern "C" {
524    /// Gives the height (in points) of the preview. Value is a CFNumber.
525    ///
526    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertyheightkey?language=objc)
527    #[deprecated = "Use the preferredContentSize property of your QLPreviewingController in a Preview Extension."]
528    pub static kQLPreviewPropertyHeightKey: Option<&'static CFString>;
529}
530
531extern "C" {
532    /// Extends the security scope where Quick Look will accept to look at a file. Value is a path as CFString.
533    ///
534    /// Only useful when using QLPreviewRequestSetURLRepresentation().
535    /// By default, Quick Look will only accept files within the current document bundle.
536    ///
537    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertybasebundlepathkey?language=objc)
538    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
539    pub static kQLPreviewPropertyBaseBundlePathKey: Option<&'static CFString>;
540}
541
542extern "C" {
543    /// Gives the CFStringEncoding of the preview data if the preview type is plain text. Value is a CFNumber.
544    ///
545    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertystringencodingkey?language=objc)
546    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
547    pub static kQLPreviewPropertyStringEncodingKey: Option<&'static CFString>;
548}
549
550/// [Apple's documentation](https://developer.apple.com/documentation/quicklook/qlpreviewpdfstyle?language=objc)
551#[repr(transparent)]
552#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
553pub struct QLPreviewPDFStyle(pub c_uint);
554impl QLPreviewPDFStyle {
555    #[doc(alias = "kQLPreviewPDFStandardStyle")]
556    pub const StandardStyle: Self = Self(0);
557    #[doc(alias = "kQLPreviewPDFPagesWithThumbnailsOnRightStyle")]
558    pub const PagesWithThumbnailsOnRightStyle: Self = Self(3);
559    #[doc(alias = "kQLPreviewPDFPagesWithThumbnailsOnLeftStyle")]
560    pub const PagesWithThumbnailsOnLeftStyle: Self = Self(4);
561}
562
563#[cfg(feature = "objc2")]
564unsafe impl Encode for QLPreviewPDFStyle {
565    const ENCODING: Encoding = c_uint::ENCODING;
566}
567
568#[cfg(feature = "objc2")]
569unsafe impl RefEncode for QLPreviewPDFStyle {
570    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
571}
572
573extern "C" {
574    /// Specify the preferred way to display PDF content. Value is a CFNumber using QLPreviewPDFStyle values.
575    ///
576    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertypdfstylekey?language=objc)
577    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
578    pub static kQLPreviewPropertyPDFStyleKey: Option<&'static CFString>;
579}
580
581extern "C" {
582    /// Value is the same CFNumber passed by potential previous calls to generator's preview callback for the same document with kQLPreviewPropertyCursorKey.
583    ///
584    /// Use this value to provide more of the preview content.
585    ///
586    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewoptioncursorkey?language=objc)
587    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
588    pub static kQLPreviewOptionCursorKey: Option<&'static CFString>;
589}
590
591extern "C" {
592    /// Value should be a CFNumber. This value will be used to get more of the document's preview if necessary
593    /// (and if the preview genererator returns kQLReturnHasMore)
594    ///
595    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertycursorkey?language=objc)
596    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
597    pub static kQLPreviewPropertyCursorKey: Option<&'static CFString>;
598}
599
600impl QLPreviewRequest {
601    /// Returns the url of the file for the preview request.
602    ///
603    /// Parameter `preview`: The preview request.
604    ///
605    /// Returns: The url of the file for the preview request.
606    #[doc(alias = "QLPreviewRequestCopyURL")]
607    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
608    #[inline]
609    pub unsafe fn url(&self) -> Option<CFRetained<CFURL>> {
610        extern "C-unwind" {
611            fn QLPreviewRequestCopyURL(preview: &QLPreviewRequest) -> Option<NonNull<CFURL>>;
612        }
613        let ret = unsafe { QLPreviewRequestCopyURL(self) };
614        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
615    }
616
617    /// Returns the desired options for the preview request.
618    ///
619    /// Parameter `preview`: The preview request.
620    ///
621    /// Returns: The desired options for the preview request.
622    #[doc(alias = "QLPreviewRequestCopyOptions")]
623    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
624    #[inline]
625    pub unsafe fn options(&self) -> Option<CFRetained<CFDictionary>> {
626        extern "C-unwind" {
627            fn QLPreviewRequestCopyOptions(
628                preview: &QLPreviewRequest,
629            ) -> Option<NonNull<CFDictionary>>;
630        }
631        let ret = unsafe { QLPreviewRequestCopyOptions(self) };
632        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
633    }
634
635    /// Returns the UTI for the preview request.
636    ///
637    /// Parameter `preview`: The preview request.
638    ///
639    /// Returns: The UTI of the content being previewed, NULL if not available.
640    #[doc(alias = "QLPreviewRequestCopyContentUTI")]
641    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
642    #[inline]
643    pub unsafe fn content_uti(&self) -> Option<CFRetained<CFString>> {
644        extern "C-unwind" {
645            fn QLPreviewRequestCopyContentUTI(
646                preview: &QLPreviewRequest,
647            ) -> Option<NonNull<CFString>>;
648        }
649        let ret = unsafe { QLPreviewRequestCopyContentUTI(self) };
650        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
651    }
652
653    /// Gets the preview request generator bundle.
654    ///
655    /// Parameter `preview`: The preview request.
656    #[doc(alias = "QLPreviewRequestGetGeneratorBundle")]
657    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
658    #[inline]
659    pub unsafe fn generator_bundle(&self) -> Option<CFRetained<CFBundle>> {
660        extern "C-unwind" {
661            fn QLPreviewRequestGetGeneratorBundle(
662                preview: &QLPreviewRequest,
663            ) -> Option<NonNull<CFBundle>>;
664        }
665        let ret = unsafe { QLPreviewRequestGetGeneratorBundle(self) };
666        ret.map(|ret| unsafe { CFRetained::retain(ret) })
667    }
668
669    /// Store some object in preview request.
670    ///
671    /// Parameter `preview`: The preview request.
672    ///
673    /// Parameter `object`: The object representing the document
674    ///
675    /// Parameter `callbacks`: Callbacks to retain/release/etc. the object.
676    ///
677    /// You can only call this function once per request.
678    ///
679    /// # Safety
680    ///
681    /// - `object` must be a valid pointer.
682    /// - `callbacks` must be a valid pointer.
683    #[doc(alias = "QLPreviewRequestSetDocumentObject")]
684    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
685    #[inline]
686    pub unsafe fn set_document_object(
687        &self,
688        object: *const c_void,
689        callbacks: *const CFArrayCallBacks,
690    ) {
691        extern "C-unwind" {
692            fn QLPreviewRequestSetDocumentObject(
693                preview: &QLPreviewRequest,
694                object: *const c_void,
695                callbacks: *const CFArrayCallBacks,
696            );
697        }
698        unsafe { QLPreviewRequestSetDocumentObject(self, object, callbacks) }
699    }
700
701    /// Get the object previously stored with QLPreviewRequestSetDocumentObject.
702    ///
703    /// Parameter `preview`: The preview request.
704    ///
705    /// Returns: The object representing the document
706    #[doc(alias = "QLPreviewRequestGetDocumentObject")]
707    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
708    #[inline]
709    pub unsafe fn document_object(&self) -> *const c_void {
710        extern "C-unwind" {
711            fn QLPreviewRequestGetDocumentObject(preview: &QLPreviewRequest) -> *const c_void;
712        }
713        unsafe { QLPreviewRequestGetDocumentObject(self) }
714    }
715
716    /// Returns wether the preview request was cancelled or not.
717    ///
718    /// Parameter `preview`: The preview request.
719    ///
720    /// Returns: true if the request was cancelled.
721    #[doc(alias = "QLPreviewRequestIsCancelled")]
722    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
723    #[inline]
724    pub unsafe fn is_cancelled(&self) -> bool {
725        extern "C-unwind" {
726            fn QLPreviewRequestIsCancelled(preview: &QLPreviewRequest) -> Boolean;
727        }
728        let ret = unsafe { QLPreviewRequestIsCancelled(self) };
729        ret != 0
730    }
731
732    /// Sets the preview response with the provided data.
733    ///
734    /// Parameter `preview`: The preview request.
735    ///
736    /// Parameter `data`: The content data.
737    ///
738    /// Parameter `contentTypeUTI`: The contentTypeUTI for the preview representation.
739    ///
740    /// Parameter `properties`: Additional properties for the preview response.
741    ///
742    /// Currently supported UTIs are: kUTTypeImage, kUTTypePDF, kUTTypeHTML,
743    /// kUTTypeXML, kUTTypePlainText, kUTTypeRTF, kUTTypeMovie, kUTTypeAudio,
744    /// and "org.khronos.collada.digital-asset-exchange" (from OSX 10.9)
745    ///
746    /// # Safety
747    ///
748    /// - `data` might not allow `None`.
749    /// - `content_type_uti` might not allow `None`.
750    /// - `properties` generics must be of the correct type.
751    /// - `properties` might not allow `None`.
752    #[doc(alias = "QLPreviewRequestSetDataRepresentation")]
753    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
754    #[inline]
755    pub unsafe fn set_data_representation(
756        &self,
757        data: Option<&CFData>,
758        content_type_uti: Option<&CFString>,
759        properties: Option<&CFDictionary>,
760    ) {
761        extern "C-unwind" {
762            fn QLPreviewRequestSetDataRepresentation(
763                preview: &QLPreviewRequest,
764                data: Option<&CFData>,
765                content_type_uti: Option<&CFString>,
766                properties: Option<&CFDictionary>,
767            );
768        }
769        unsafe { QLPreviewRequestSetDataRepresentation(self, data, content_type_uti, properties) }
770    }
771
772    /// Sets the preview request response with contents at url.
773    ///
774    /// Parameter `preview`: The preview request.
775    ///
776    /// Parameter `url`: The url to the preview response.
777    ///
778    /// Parameter `contentTypeUTI`: The contentTypeUTI for the preview representation.
779    ///
780    /// Parameter `properties`: Additional properties for the preview response.
781    ///
782    /// Currently supported UTIs are: kUTTypeImage, kUTTypePDF, kUTTypeHTML,
783    /// kUTTypeXML, kUTTypePlainText, kUTTypeRTF, kUTTypeRTFD, kUTTypeMovie, kUTTypeAudio,
784    /// and "org.khronos.collada.digital-asset-exchange" (from OSX 10.9)
785    ///
786    /// # Safety
787    ///
788    /// - `url` might not allow `None`.
789    /// - `content_type_uti` might not allow `None`.
790    /// - `properties` generics must be of the correct type.
791    /// - `properties` might not allow `None`.
792    #[doc(alias = "QLPreviewRequestSetURLRepresentation")]
793    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
794    #[inline]
795    pub unsafe fn set_url_representation(
796        &self,
797        url: Option<&CFURL>,
798        content_type_uti: Option<&CFString>,
799        properties: Option<&CFDictionary>,
800    ) {
801        extern "C-unwind" {
802            fn QLPreviewRequestSetURLRepresentation(
803                preview: &QLPreviewRequest,
804                url: Option<&CFURL>,
805                content_type_uti: Option<&CFString>,
806                properties: Option<&CFDictionary>,
807            );
808        }
809        unsafe { QLPreviewRequestSetURLRepresentation(self, url, content_type_uti, properties) }
810    }
811
812    /// Creates a context to draw the preview in. Context should be flushed with QLPreviewRequestFlushContext()
813    ///
814    /// Parameter `preview`: The preview request.
815    ///
816    /// Parameter `size`: The size of the context.
817    ///
818    /// Parameter `isBitmap`: true if preview is bitmap-based.
819    ///
820    /// Parameter `properties`: Additional properties for the preview response.
821    ///
822    /// # Safety
823    ///
824    /// - `properties` generics must be of the correct type.
825    /// - `properties` might not allow `None`.
826    #[doc(alias = "QLPreviewRequestCreateContext")]
827    #[cfg(feature = "objc2-core-graphics")]
828    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
829    #[inline]
830    pub unsafe fn context(
831        &self,
832        size: CGSize,
833        is_bitmap: bool,
834        properties: Option<&CFDictionary>,
835    ) -> Option<CFRetained<CGContext>> {
836        extern "C-unwind" {
837            fn QLPreviewRequestCreateContext(
838                preview: &QLPreviewRequest,
839                size: CGSize,
840                is_bitmap: Boolean,
841                properties: Option<&CFDictionary>,
842            ) -> Option<NonNull<CGContext>>;
843        }
844        let ret = unsafe { QLPreviewRequestCreateContext(self, size, is_bitmap as _, properties) };
845        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
846    }
847
848    /// Creates a PDF context to draw the preview in, likely to be multi-pages. Context should be flushed with QLPreviewRequestFlushContext()
849    ///
850    /// Parameter `preview`: The preview request.
851    ///
852    /// Parameter `mediaBox`: The media box of the context. see CGPDFContextCreate().
853    ///
854    /// Parameter `auxiliaryInfo`: The PDF auxiliary info. see CGPDFContextCreate().
855    ///
856    /// Parameter `properties`: Additional properties for the preview response.
857    ///
858    /// # Safety
859    ///
860    /// - `media_box` must be a valid pointer.
861    /// - `auxiliary_info` generics must be of the correct type.
862    /// - `auxiliary_info` might not allow `None`.
863    /// - `properties` generics must be of the correct type.
864    /// - `properties` might not allow `None`.
865    #[doc(alias = "QLPreviewRequestCreatePDFContext")]
866    #[cfg(feature = "objc2-core-graphics")]
867    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
868    #[inline]
869    pub unsafe fn pdf_context(
870        &self,
871        media_box: *const CGRect,
872        auxiliary_info: Option<&CFDictionary>,
873        properties: Option<&CFDictionary>,
874    ) -> Option<CFRetained<CGContext>> {
875        extern "C-unwind" {
876            fn QLPreviewRequestCreatePDFContext(
877                preview: &QLPreviewRequest,
878                media_box: *const CGRect,
879                auxiliary_info: Option<&CFDictionary>,
880                properties: Option<&CFDictionary>,
881            ) -> Option<NonNull<CGContext>>;
882        }
883        let ret = unsafe {
884            QLPreviewRequestCreatePDFContext(self, media_box, auxiliary_info, properties)
885        };
886        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
887    }
888
889    /// Flush the context and sets the preview response.
890    ///
891    /// Parameter `preview`: The preview request.
892    ///
893    /// Parameter `context`: context previously created by QLPreviewRequestCreateContext() or QLPreviewRequestCreatePDFContext().
894    ///
895    /// # Safety
896    ///
897    /// `context` might not allow `None`.
898    #[doc(alias = "QLPreviewRequestFlushContext")]
899    #[cfg(feature = "objc2-core-graphics")]
900    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
901    #[inline]
902    pub unsafe fn flush_context(&self, context: Option<&CGContext>) {
903        extern "C-unwind" {
904            fn QLPreviewRequestFlushContext(
905                preview: &QLPreviewRequest,
906                context: Option<&CGContext>,
907            );
908        }
909        unsafe { QLPreviewRequestFlushContext(self, context) }
910    }
911}
912
913extern "C" {
914    /// Gives the web content or attachment mime type. For the main data, default is text/html. Value is a CFString.
915    ///
916    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertymimetypekey?language=objc)
917    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
918    pub static kQLPreviewPropertyMIMETypeKey: Option<&'static CFString>;
919}
920
921extern "C" {
922    /// Gives the web content or attachment text encoding. Use IANA encodings like UTF-8. Value is a CFString.
923    ///
924    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertytextencodingnamekey?language=objc)
925    pub static kQLPreviewPropertyTextEncodingNameKey: Option<&'static CFString>;
926}
927
928extern "C" {
929    /// Gives the attachment data. Value is a CFData.
930    ///
931    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertyattachmentdatakey?language=objc)
932    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
933    pub static kQLPreviewPropertyAttachmentDataKey: Option<&'static CFString>;
934}
935
936extern "C" {
937    /// Gives the list of attachments (or sub-resources). Value is a CFDictionary.
938    ///
939    /// Keys are the attachment ids (CFStringRef) that can be referenced with "cid:id" URL and
940    /// Values are dictionaries using kQLPreviewPropertyAttachmentDataKey,
941    /// kQLPreviewPropertyMIMETypeKey and kQLPreviewPropertyTextEncodingNameKey keys.
942    ///
943    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewpropertyattachmentskey?language=objc)
944    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
945    pub static kQLPreviewPropertyAttachmentsKey: Option<&'static CFString>;
946}
947
948extern "C" {
949    /// Is the "cid" URL scheme.
950    ///
951    /// See also [Apple's documentation](https://developer.apple.com/documentation/quicklook/kqlpreviewcontentidscheme?language=objc)
952    #[deprecated = "Use a QLPreviewingController in a Preview Extension to provide previews for your file types."]
953    pub static kQLPreviewContentIDScheme: Option<&'static CFString>;
954}
955
956/// [Apple's documentation](https://developer.apple.com/documentation/quicklook/qlgeneratorinterfacestruct?language=objc)
957#[repr(C)]
958#[allow(unpredictable_function_pointer_comparisons)]
959#[derive(Clone, Copy, Debug, PartialEq)]
960pub struct QLGeneratorInterfaceStruct {
961    pub(crate) _reserved: *mut c_void,
962    pub QueryInterface:
963        Option<unsafe extern "C-unwind" fn(*mut c_void, REFIID, *mut LPVOID) -> HRESULT>,
964    pub AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>,
965    pub Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>,
966    pub GenerateThumbnailForURL: Option<
967        unsafe extern "C-unwind" fn(
968            *mut c_void,
969            *mut QLThumbnailRequest,
970            *const CFURL,
971            *const CFString,
972            *const CFDictionary,
973            CGSize,
974        ) -> OSStatus,
975    >,
976    pub CancelThumbnailGeneration:
977        Option<unsafe extern "C-unwind" fn(*mut c_void, *mut QLThumbnailRequest)>,
978    pub GeneratePreviewForURL: Option<
979        unsafe extern "C-unwind" fn(
980            *mut c_void,
981            *mut QLPreviewRequest,
982            *const CFURL,
983            *const CFString,
984            *const CFDictionary,
985        ) -> OSStatus,
986    >,
987    pub CancelPreviewGeneration:
988        Option<unsafe extern "C-unwind" fn(*mut c_void, *mut QLPreviewRequest)>,
989}
990
991#[cfg(feature = "objc2")]
992unsafe impl Encode for QLGeneratorInterfaceStruct {
993    const ENCODING: Encoding = Encoding::Struct("?", &[
994        <*mut c_void>::ENCODING,
995        <Option<unsafe extern "C-unwind" fn(*mut c_void,REFIID,*mut LPVOID,) -> HRESULT>>::ENCODING,
996        <Option<unsafe extern "C-unwind" fn(*mut c_void,) -> ULONG>>::ENCODING,
997        <Option<unsafe extern "C-unwind" fn(*mut c_void,) -> ULONG>>::ENCODING,
998        <Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLThumbnailRequest,*const CFURL,*const CFString,*const CFDictionary,CGSize,) -> OSStatus>>::ENCODING,
999        <Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLThumbnailRequest,)>>::ENCODING,
1000        <Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLPreviewRequest,*const CFURL,*const CFString,*const CFDictionary,) -> OSStatus>>::ENCODING,
1001        <Option<unsafe extern "C-unwind" fn(*mut c_void,*mut QLPreviewRequest,)>>::ENCODING,
1002    ]);
1003}
1004
1005#[cfg(feature = "objc2")]
1006unsafe impl RefEncode for QLGeneratorInterfaceStruct {
1007    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1008}
1009
1010#[deprecated = "renamed to `QLThumbnailRequest::url`"]
1011#[inline]
1012pub unsafe extern "C-unwind" fn QLThumbnailRequestCopyURL(
1013    thumbnail: &QLThumbnailRequest,
1014) -> Option<CFRetained<CFURL>> {
1015    extern "C-unwind" {
1016        fn QLThumbnailRequestCopyURL(thumbnail: &QLThumbnailRequest) -> Option<NonNull<CFURL>>;
1017    }
1018    let ret = unsafe { QLThumbnailRequestCopyURL(thumbnail) };
1019    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1020}
1021
1022#[deprecated = "renamed to `QLThumbnailRequest::options`"]
1023#[inline]
1024pub unsafe extern "C-unwind" fn QLThumbnailRequestCopyOptions(
1025    thumbnail: &QLThumbnailRequest,
1026) -> Option<CFRetained<CFDictionary>> {
1027    extern "C-unwind" {
1028        fn QLThumbnailRequestCopyOptions(
1029            thumbnail: &QLThumbnailRequest,
1030        ) -> Option<NonNull<CFDictionary>>;
1031    }
1032    let ret = unsafe { QLThumbnailRequestCopyOptions(thumbnail) };
1033    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1034}
1035
1036#[deprecated = "renamed to `QLThumbnailRequest::content_uti`"]
1037#[inline]
1038pub unsafe extern "C-unwind" fn QLThumbnailRequestCopyContentUTI(
1039    thumbnail: &QLThumbnailRequest,
1040) -> Option<CFRetained<CFString>> {
1041    extern "C-unwind" {
1042        fn QLThumbnailRequestCopyContentUTI(
1043            thumbnail: &QLThumbnailRequest,
1044        ) -> Option<NonNull<CFString>>;
1045    }
1046    let ret = unsafe { QLThumbnailRequestCopyContentUTI(thumbnail) };
1047    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1048}
1049
1050extern "C-unwind" {
1051    #[deprecated = "renamed to `QLThumbnailRequest::maximum_size`"]
1052    pub fn QLThumbnailRequestGetMaximumSize(thumbnail: &QLThumbnailRequest) -> CGSize;
1053}
1054
1055#[deprecated = "renamed to `QLThumbnailRequest::generator_bundle`"]
1056#[inline]
1057pub unsafe extern "C-unwind" fn QLThumbnailRequestGetGeneratorBundle(
1058    thumbnail: &QLThumbnailRequest,
1059) -> Option<CFRetained<CFBundle>> {
1060    extern "C-unwind" {
1061        fn QLThumbnailRequestGetGeneratorBundle(
1062            thumbnail: &QLThumbnailRequest,
1063        ) -> Option<NonNull<CFBundle>>;
1064    }
1065    let ret = unsafe { QLThumbnailRequestGetGeneratorBundle(thumbnail) };
1066    ret.map(|ret| unsafe { CFRetained::retain(ret) })
1067}
1068
1069extern "C-unwind" {
1070    #[deprecated = "renamed to `QLThumbnailRequest::set_document_object`"]
1071    pub fn QLThumbnailRequestSetDocumentObject(
1072        thumbnail: &QLThumbnailRequest,
1073        object: *const c_void,
1074        callbacks: *const CFArrayCallBacks,
1075    );
1076}
1077
1078extern "C-unwind" {
1079    #[deprecated = "renamed to `QLThumbnailRequest::document_object`"]
1080    pub fn QLThumbnailRequestGetDocumentObject(thumbnail: &QLThumbnailRequest) -> *const c_void;
1081}
1082
1083extern "C-unwind" {
1084    #[cfg(feature = "objc2-core-graphics")]
1085    #[deprecated = "renamed to `QLThumbnailRequest::set_image`"]
1086    pub fn QLThumbnailRequestSetImage(
1087        thumbnail: &QLThumbnailRequest,
1088        image: Option<&CGImage>,
1089        properties: Option<&CFDictionary>,
1090    );
1091}
1092
1093extern "C-unwind" {
1094    #[deprecated = "renamed to `QLThumbnailRequest::set_image_with_data`"]
1095    pub fn QLThumbnailRequestSetImageWithData(
1096        thumbnail: &QLThumbnailRequest,
1097        data: Option<&CFData>,
1098        properties: Option<&CFDictionary>,
1099    );
1100}
1101
1102#[cfg(feature = "objc2-core-graphics")]
1103#[deprecated = "renamed to `QLThumbnailRequest::context`"]
1104#[inline]
1105pub unsafe extern "C-unwind" fn QLThumbnailRequestCreateContext(
1106    thumbnail: &QLThumbnailRequest,
1107    size: CGSize,
1108    is_bitmap: bool,
1109    properties: Option<&CFDictionary>,
1110) -> Option<CFRetained<CGContext>> {
1111    extern "C-unwind" {
1112        fn QLThumbnailRequestCreateContext(
1113            thumbnail: &QLThumbnailRequest,
1114            size: CGSize,
1115            is_bitmap: Boolean,
1116            properties: Option<&CFDictionary>,
1117        ) -> Option<NonNull<CGContext>>;
1118    }
1119    let ret =
1120        unsafe { QLThumbnailRequestCreateContext(thumbnail, size, is_bitmap as _, properties) };
1121    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1122}
1123
1124extern "C-unwind" {
1125    #[cfg(feature = "objc2-core-graphics")]
1126    #[deprecated = "renamed to `QLThumbnailRequest::flush_context`"]
1127    pub fn QLThumbnailRequestFlushContext(
1128        thumbnail: &QLThumbnailRequest,
1129        context: Option<&CGContext>,
1130    );
1131}
1132
1133extern "C-unwind" {
1134    #[deprecated = "renamed to `QLThumbnailRequest::set_image_at_url`"]
1135    pub fn QLThumbnailRequestSetImageAtURL(
1136        thumbnail: &QLThumbnailRequest,
1137        url: Option<&CFURL>,
1138        properties: Option<&CFDictionary>,
1139    );
1140}
1141
1142extern "C-unwind" {
1143    #[deprecated = "renamed to `QLThumbnailRequest::set_thumbnail_with_data_representation`"]
1144    pub fn QLThumbnailRequestSetThumbnailWithDataRepresentation(
1145        thumbnail: &QLThumbnailRequest,
1146        data: Option<&CFData>,
1147        content_type_uti: Option<&CFString>,
1148        preview_properties: Option<&CFDictionary>,
1149        properties: Option<&CFDictionary>,
1150    );
1151}
1152
1153extern "C-unwind" {
1154    #[deprecated = "renamed to `QLThumbnailRequest::set_thumbnail_with_url_representation`"]
1155    pub fn QLThumbnailRequestSetThumbnailWithURLRepresentation(
1156        thumbnail: &QLThumbnailRequest,
1157        url: Option<&CFURL>,
1158        content_type_uti: Option<&CFString>,
1159        preview_properties: Option<&CFDictionary>,
1160        properties: Option<&CFDictionary>,
1161    );
1162}
1163
1164#[deprecated = "renamed to `QLThumbnailRequest::is_cancelled`"]
1165#[inline]
1166pub unsafe extern "C-unwind" fn QLThumbnailRequestIsCancelled(
1167    thumbnail: &QLThumbnailRequest,
1168) -> bool {
1169    extern "C-unwind" {
1170        fn QLThumbnailRequestIsCancelled(thumbnail: &QLThumbnailRequest) -> Boolean;
1171    }
1172    let ret = unsafe { QLThumbnailRequestIsCancelled(thumbnail) };
1173    ret != 0
1174}
1175
1176#[deprecated = "renamed to `QLPreviewRequest::url`"]
1177#[inline]
1178pub unsafe extern "C-unwind" fn QLPreviewRequestCopyURL(
1179    preview: &QLPreviewRequest,
1180) -> Option<CFRetained<CFURL>> {
1181    extern "C-unwind" {
1182        fn QLPreviewRequestCopyURL(preview: &QLPreviewRequest) -> Option<NonNull<CFURL>>;
1183    }
1184    let ret = unsafe { QLPreviewRequestCopyURL(preview) };
1185    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1186}
1187
1188#[deprecated = "renamed to `QLPreviewRequest::options`"]
1189#[inline]
1190pub unsafe extern "C-unwind" fn QLPreviewRequestCopyOptions(
1191    preview: &QLPreviewRequest,
1192) -> Option<CFRetained<CFDictionary>> {
1193    extern "C-unwind" {
1194        fn QLPreviewRequestCopyOptions(preview: &QLPreviewRequest)
1195            -> Option<NonNull<CFDictionary>>;
1196    }
1197    let ret = unsafe { QLPreviewRequestCopyOptions(preview) };
1198    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1199}
1200
1201#[deprecated = "renamed to `QLPreviewRequest::content_uti`"]
1202#[inline]
1203pub unsafe extern "C-unwind" fn QLPreviewRequestCopyContentUTI(
1204    preview: &QLPreviewRequest,
1205) -> Option<CFRetained<CFString>> {
1206    extern "C-unwind" {
1207        fn QLPreviewRequestCopyContentUTI(preview: &QLPreviewRequest) -> Option<NonNull<CFString>>;
1208    }
1209    let ret = unsafe { QLPreviewRequestCopyContentUTI(preview) };
1210    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1211}
1212
1213#[deprecated = "renamed to `QLPreviewRequest::generator_bundle`"]
1214#[inline]
1215pub unsafe extern "C-unwind" fn QLPreviewRequestGetGeneratorBundle(
1216    preview: &QLPreviewRequest,
1217) -> Option<CFRetained<CFBundle>> {
1218    extern "C-unwind" {
1219        fn QLPreviewRequestGetGeneratorBundle(
1220            preview: &QLPreviewRequest,
1221        ) -> Option<NonNull<CFBundle>>;
1222    }
1223    let ret = unsafe { QLPreviewRequestGetGeneratorBundle(preview) };
1224    ret.map(|ret| unsafe { CFRetained::retain(ret) })
1225}
1226
1227extern "C-unwind" {
1228    #[deprecated = "renamed to `QLPreviewRequest::set_document_object`"]
1229    pub fn QLPreviewRequestSetDocumentObject(
1230        preview: &QLPreviewRequest,
1231        object: *const c_void,
1232        callbacks: *const CFArrayCallBacks,
1233    );
1234}
1235
1236extern "C-unwind" {
1237    #[deprecated = "renamed to `QLPreviewRequest::document_object`"]
1238    pub fn QLPreviewRequestGetDocumentObject(preview: &QLPreviewRequest) -> *const c_void;
1239}
1240
1241#[deprecated = "renamed to `QLPreviewRequest::is_cancelled`"]
1242#[inline]
1243pub unsafe extern "C-unwind" fn QLPreviewRequestIsCancelled(preview: &QLPreviewRequest) -> bool {
1244    extern "C-unwind" {
1245        fn QLPreviewRequestIsCancelled(preview: &QLPreviewRequest) -> Boolean;
1246    }
1247    let ret = unsafe { QLPreviewRequestIsCancelled(preview) };
1248    ret != 0
1249}
1250
1251extern "C-unwind" {
1252    #[deprecated = "renamed to `QLPreviewRequest::set_data_representation`"]
1253    pub fn QLPreviewRequestSetDataRepresentation(
1254        preview: &QLPreviewRequest,
1255        data: Option<&CFData>,
1256        content_type_uti: Option<&CFString>,
1257        properties: Option<&CFDictionary>,
1258    );
1259}
1260
1261extern "C-unwind" {
1262    #[deprecated = "renamed to `QLPreviewRequest::set_url_representation`"]
1263    pub fn QLPreviewRequestSetURLRepresentation(
1264        preview: &QLPreviewRequest,
1265        url: Option<&CFURL>,
1266        content_type_uti: Option<&CFString>,
1267        properties: Option<&CFDictionary>,
1268    );
1269}
1270
1271#[cfg(feature = "objc2-core-graphics")]
1272#[deprecated = "renamed to `QLPreviewRequest::context`"]
1273#[inline]
1274pub unsafe extern "C-unwind" fn QLPreviewRequestCreateContext(
1275    preview: &QLPreviewRequest,
1276    size: CGSize,
1277    is_bitmap: bool,
1278    properties: Option<&CFDictionary>,
1279) -> Option<CFRetained<CGContext>> {
1280    extern "C-unwind" {
1281        fn QLPreviewRequestCreateContext(
1282            preview: &QLPreviewRequest,
1283            size: CGSize,
1284            is_bitmap: Boolean,
1285            properties: Option<&CFDictionary>,
1286        ) -> Option<NonNull<CGContext>>;
1287    }
1288    let ret = unsafe { QLPreviewRequestCreateContext(preview, size, is_bitmap as _, properties) };
1289    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1290}
1291
1292#[cfg(feature = "objc2-core-graphics")]
1293#[deprecated = "renamed to `QLPreviewRequest::pdf_context`"]
1294#[inline]
1295pub unsafe extern "C-unwind" fn QLPreviewRequestCreatePDFContext(
1296    preview: &QLPreviewRequest,
1297    media_box: *const CGRect,
1298    auxiliary_info: Option<&CFDictionary>,
1299    properties: Option<&CFDictionary>,
1300) -> Option<CFRetained<CGContext>> {
1301    extern "C-unwind" {
1302        fn QLPreviewRequestCreatePDFContext(
1303            preview: &QLPreviewRequest,
1304            media_box: *const CGRect,
1305            auxiliary_info: Option<&CFDictionary>,
1306            properties: Option<&CFDictionary>,
1307        ) -> Option<NonNull<CGContext>>;
1308    }
1309    let ret =
1310        unsafe { QLPreviewRequestCreatePDFContext(preview, media_box, auxiliary_info, properties) };
1311    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1312}
1313
1314extern "C-unwind" {
1315    #[cfg(feature = "objc2-core-graphics")]
1316    #[deprecated = "renamed to `QLPreviewRequest::flush_context`"]
1317    pub fn QLPreviewRequestFlushContext(preview: &QLPreviewRequest, context: Option<&CGContext>);
1318}