objc2_quartz/generated/ImageKit/
IKSlideshow.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// The data source of IKSlideshow must conform to IKSlideshowDataSource protocol.
12    ///
13    /// The data source methods may be called one a non-main thread.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowdatasource?language=objc)
16    pub unsafe trait IKSlideshowDataSource {
17        /// return number of items in Slideshow.
18        #[unsafe(method(numberOfSlideshowItems))]
19        #[unsafe(method_family = none)]
20        unsafe fn numberOfSlideshowItems(&self) -> NSUInteger;
21
22        /// return the item for a given index.
23        ///
24        /// The item can be either: NSImage, NSString, NSURL, CGImageRef, or PDFPage.
25        /// Note: when using 'IKSlideshowModeOther' as slideshowMode, the item has to be a NSURL.
26        #[unsafe(method(slideshowItemAtIndex:))]
27        #[unsafe(method_family = none)]
28        unsafe fn slideshowItemAtIndex(&self, index: NSUInteger) -> Option<Retained<AnyObject>>;
29
30        /// Display name for item at index.
31        #[optional]
32        #[unsafe(method(nameOfSlideshowItemAtIndex:))]
33        #[unsafe(method_family = none)]
34        unsafe fn nameOfSlideshowItemAtIndex(
35            &self,
36            index: NSUInteger,
37        ) -> Option<Retained<NSString>>;
38
39        /// should the export button be enabled for a given item at index?
40        ///
41        /// # Safety
42        ///
43        /// `application_bundle_identifier` might not allow `None`.
44        #[optional]
45        #[unsafe(method(canExportSlideshowItemAtIndex:toApplication:))]
46        #[unsafe(method_family = none)]
47        unsafe fn canExportSlideshowItemAtIndex_toApplication(
48            &self,
49            index: NSUInteger,
50            application_bundle_identifier: Option<&NSString>,
51        ) -> bool;
52
53        /// Slideshow will start.
54        #[optional]
55        #[unsafe(method(slideshowWillStart))]
56        #[unsafe(method_family = none)]
57        unsafe fn slideshowWillStart(&self);
58
59        /// Slideshow did stop.
60        #[optional]
61        #[unsafe(method(slideshowDidStop))]
62        #[unsafe(method_family = none)]
63        unsafe fn slideshowDidStop(&self);
64
65        /// Slideshow did change current item index.
66        #[optional]
67        #[unsafe(method(slideshowDidChangeCurrentIndex:))]
68        #[unsafe(method_family = none)]
69        unsafe fn slideshowDidChangeCurrentIndex(&self, new_index: NSUInteger);
70    }
71);
72
73extern_class!(
74    /// IKSlideshow handles a slideshow with images, PDFs
75    /// &
76    /// more.
77    ///
78    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshow?language=objc)
79    #[unsafe(super(NSObject))]
80    #[derive(Debug, PartialEq, Eq, Hash)]
81    pub struct IKSlideshow;
82);
83
84extern_conformance!(
85    unsafe impl NSObjectProtocol for IKSlideshow {}
86);
87
88impl IKSlideshow {
89    extern_methods!(
90        /// Array of filters reflecting the current user adjustments in the adjust or effects tab.
91        #[unsafe(method(autoPlayDelay))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn autoPlayDelay(&self) -> NSTimeInterval;
94
95        /// Setter for [`autoPlayDelay`][Self::autoPlayDelay].
96        #[unsafe(method(setAutoPlayDelay:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn setAutoPlayDelay(&self, auto_play_delay: NSTimeInterval);
99
100        /// shared instance of the IKSlideshow.
101        #[unsafe(method(sharedSlideshow))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn sharedSlideshow() -> Option<Retained<IKSlideshow>>;
104
105        /// start the slideshow (slideshowOptions can be NULL).
106        ///
107        /// # Safety
108        ///
109        /// - `data_source` might not allow `None`.
110        /// - `slideshow_mode` might not allow `None`.
111        /// - `slideshow_options` generic should be of the correct type.
112        /// - `slideshow_options` might not allow `None`.
113        #[unsafe(method(runSlideshowWithDataSource:inMode:options:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn runSlideshowWithDataSource_inMode_options(
116            &self,
117            data_source: Option<&ProtocolObject<dyn IKSlideshowDataSource>>,
118            slideshow_mode: Option<&NSString>,
119            slideshow_options: Option<&NSDictionary>,
120        );
121
122        /// stop the slideshow.
123        ///
124        /// # Safety
125        ///
126        /// - `sender` should be of the correct type.
127        /// - `sender` might not allow `None`.
128        #[unsafe(method(stopSlideshow:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn stopSlideshow(&self, sender: Option<&AnyObject>);
131
132        /// reloadData.
133        #[unsafe(method(reloadData))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn reloadData(&self);
136
137        /// reloadSlideshowItemAtIndex.
138        #[unsafe(method(reloadSlideshowItemAtIndex:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn reloadSlideshowItemAtIndex(&self, index: NSUInteger);
141
142        /// Returns index of current slideshow item.
143        #[unsafe(method(indexOfCurrentSlideshowItem))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn indexOfCurrentSlideshowItem(&self) -> NSUInteger;
146
147        /// Is exporting to a given application possible (application installed?, right version?, ...).
148        ///
149        /// # Safety
150        ///
151        /// `application_bundle_identifier` might not allow `None`.
152        #[unsafe(method(canExportToApplication:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn canExportToApplication(
155            application_bundle_identifier: Option<&NSString>,
156        ) -> bool;
157
158        /// export an item to the given application.
159        ///
160        /// The item can be either: NSImage, NSString, NSURL, or a NSArray of NSImage / NSString / NSURL.
161        ///
162        /// # Safety
163        ///
164        /// - `item` should be of the correct type.
165        /// - `item` might not allow `None`.
166        /// - `application_bundle_identifier` might not allow `None`.
167        #[unsafe(method(exportSlideshowItem:toApplication:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn exportSlideshowItem_toApplication(
170            item: Option<&AnyObject>,
171            application_bundle_identifier: Option<&NSString>,
172        );
173    );
174}
175
176/// Methods declared on superclass `NSObject`.
177impl IKSlideshow {
178    extern_methods!(
179        #[unsafe(method(init))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
182
183        #[unsafe(method(new))]
184        #[unsafe(method_family = new)]
185        pub unsafe fn new() -> Retained<Self>;
186    );
187}
188
189extern "C" {
190    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowmodeimages?language=objc)
191    pub static IKSlideshowModeImages: Option<&'static NSString>;
192}
193
194extern "C" {
195    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowmodepdf?language=objc)
196    pub static IKSlideshowModePDF: Option<&'static NSString>;
197}
198
199extern "C" {
200    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowmodeother?language=objc)
201    pub static IKSlideshowModeOther: Option<&'static NSString>;
202}
203
204extern "C" {
205    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowwraparound?language=objc)
206    pub static IKSlideshowWrapAround: Option<&'static NSString>;
207}
208
209extern "C" {
210    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowstartpaused?language=objc)
211    pub static IKSlideshowStartPaused: Option<&'static NSString>;
212}
213
214extern "C" {
215    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowstartindex?language=objc)
216    pub static IKSlideshowStartIndex: Option<&'static NSString>;
217}
218
219extern "C" {
220    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowscreen?language=objc)
221    pub static IKSlideshowScreen: Option<&'static NSString>;
222}
223
224extern "C" {
225    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowaudiofile?language=objc)
226    pub static IKSlideshowAudioFile: Option<&'static NSString>;
227}
228
229extern "C" {
230    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowpdfdisplaybox?language=objc)
231    pub static IKSlideshowPDFDisplayBox: Option<&'static NSString>;
232}
233
234extern "C" {
235    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowpdfdisplaymode?language=objc)
236    pub static IKSlideshowPDFDisplayMode: Option<&'static NSString>;
237}
238
239extern "C" {
240    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowpdfdisplaysasbook?language=objc)
241    pub static IKSlideshowPDFDisplaysAsBook: Option<&'static NSString>;
242}
243
244extern "C" {
245    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_iphotobundleidentifier?language=objc)
246    pub static IK_iPhotoBundleIdentifier: Option<&'static NSString>;
247}
248
249extern "C" {
250    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_aperturebundleidentifier?language=objc)
251    pub static IK_ApertureBundleIdentifier: Option<&'static NSString>;
252}
253
254extern "C" {
255    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_mailbundleidentifier?language=objc)
256    pub static IK_MailBundleIdentifier: Option<&'static NSString>;
257}
258
259extern "C" {
260    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_photosbundleidentifier?language=objc)
261    pub static IK_PhotosBundleIdentifier: Option<&'static NSString>;
262}