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