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        #[optional]
41        #[unsafe(method(canExportSlideshowItemAtIndex:toApplication:))]
42        #[unsafe(method_family = none)]
43        unsafe fn canExportSlideshowItemAtIndex_toApplication(
44            &self,
45            index: NSUInteger,
46            application_bundle_identifier: Option<&NSString>,
47        ) -> bool;
48
49        /// Slideshow will start.
50        #[optional]
51        #[unsafe(method(slideshowWillStart))]
52        #[unsafe(method_family = none)]
53        unsafe fn slideshowWillStart(&self);
54
55        /// Slideshow did stop.
56        #[optional]
57        #[unsafe(method(slideshowDidStop))]
58        #[unsafe(method_family = none)]
59        unsafe fn slideshowDidStop(&self);
60
61        /// Slideshow did change current item index.
62        #[optional]
63        #[unsafe(method(slideshowDidChangeCurrentIndex:))]
64        #[unsafe(method_family = none)]
65        unsafe fn slideshowDidChangeCurrentIndex(&self, new_index: NSUInteger);
66    }
67);
68
69extern_class!(
70    /// IKSlideshow handles a slideshow with images, PDFs
71    /// &
72    /// more.
73    ///
74    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshow?language=objc)
75    #[unsafe(super(NSObject))]
76    #[derive(Debug, PartialEq, Eq, Hash)]
77    pub struct IKSlideshow;
78);
79
80extern_conformance!(
81    unsafe impl NSObjectProtocol for IKSlideshow {}
82);
83
84impl IKSlideshow {
85    extern_methods!(
86        /// Array of filters reflecting the current user adjustments in the adjust or effects tab.
87        #[unsafe(method(autoPlayDelay))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn autoPlayDelay(&self) -> NSTimeInterval;
90
91        /// Setter for [`autoPlayDelay`][Self::autoPlayDelay].
92        #[unsafe(method(setAutoPlayDelay:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setAutoPlayDelay(&self, auto_play_delay: NSTimeInterval);
95
96        /// shared instance of the IKSlideshow.
97        #[unsafe(method(sharedSlideshow))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn sharedSlideshow() -> Option<Retained<IKSlideshow>>;
100
101        /// start the slideshow (slideshowOptions can be NULL).
102        #[unsafe(method(runSlideshowWithDataSource:inMode:options:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn runSlideshowWithDataSource_inMode_options(
105            &self,
106            data_source: Option<&ProtocolObject<dyn IKSlideshowDataSource>>,
107            slideshow_mode: Option<&NSString>,
108            slideshow_options: Option<&NSDictionary>,
109        );
110
111        /// stop the slideshow.
112        #[unsafe(method(stopSlideshow:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn stopSlideshow(&self, sender: Option<&AnyObject>);
115
116        /// reloadData.
117        #[unsafe(method(reloadData))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn reloadData(&self);
120
121        /// reloadSlideshowItemAtIndex.
122        #[unsafe(method(reloadSlideshowItemAtIndex:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn reloadSlideshowItemAtIndex(&self, index: NSUInteger);
125
126        /// Returns index of current slideshow item.
127        #[unsafe(method(indexOfCurrentSlideshowItem))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn indexOfCurrentSlideshowItem(&self) -> NSUInteger;
130
131        /// Is exporting to a given application possible (application installed?, right version?, ...).
132        #[unsafe(method(canExportToApplication:))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn canExportToApplication(
135            application_bundle_identifier: Option<&NSString>,
136        ) -> bool;
137
138        /// export an item to the given application.
139        ///
140        /// The item can be either: NSImage, NSString, NSURL, or a NSArray of NSImage / NSString / NSURL.
141        #[unsafe(method(exportSlideshowItem:toApplication:))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn exportSlideshowItem_toApplication(
144            item: Option<&AnyObject>,
145            application_bundle_identifier: Option<&NSString>,
146        );
147    );
148}
149
150/// Methods declared on superclass `NSObject`.
151impl IKSlideshow {
152    extern_methods!(
153        #[unsafe(method(init))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
156
157        #[unsafe(method(new))]
158        #[unsafe(method_family = new)]
159        pub unsafe fn new() -> Retained<Self>;
160    );
161}
162
163extern "C" {
164    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowmodeimages?language=objc)
165    pub static IKSlideshowModeImages: Option<&'static NSString>;
166}
167
168extern "C" {
169    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowmodepdf?language=objc)
170    pub static IKSlideshowModePDF: Option<&'static NSString>;
171}
172
173extern "C" {
174    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowmodeother?language=objc)
175    pub static IKSlideshowModeOther: Option<&'static NSString>;
176}
177
178extern "C" {
179    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowwraparound?language=objc)
180    pub static IKSlideshowWrapAround: Option<&'static NSString>;
181}
182
183extern "C" {
184    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowstartpaused?language=objc)
185    pub static IKSlideshowStartPaused: Option<&'static NSString>;
186}
187
188extern "C" {
189    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowstartindex?language=objc)
190    pub static IKSlideshowStartIndex: Option<&'static NSString>;
191}
192
193extern "C" {
194    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowscreen?language=objc)
195    pub static IKSlideshowScreen: Option<&'static NSString>;
196}
197
198extern "C" {
199    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowaudiofile?language=objc)
200    pub static IKSlideshowAudioFile: Option<&'static NSString>;
201}
202
203extern "C" {
204    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowpdfdisplaybox?language=objc)
205    pub static IKSlideshowPDFDisplayBox: Option<&'static NSString>;
206}
207
208extern "C" {
209    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowpdfdisplaymode?language=objc)
210    pub static IKSlideshowPDFDisplayMode: Option<&'static NSString>;
211}
212
213extern "C" {
214    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowpdfdisplaysasbook?language=objc)
215    pub static IKSlideshowPDFDisplaysAsBook: Option<&'static NSString>;
216}
217
218extern "C" {
219    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_iphotobundleidentifier?language=objc)
220    pub static IK_iPhotoBundleIdentifier: Option<&'static NSString>;
221}
222
223extern "C" {
224    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_aperturebundleidentifier?language=objc)
225    pub static IK_ApertureBundleIdentifier: Option<&'static NSString>;
226}
227
228extern "C" {
229    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_mailbundleidentifier?language=objc)
230    pub static IK_MailBundleIdentifier: Option<&'static NSString>;
231}
232
233extern "C" {
234    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ik_photosbundleidentifier?language=objc)
235    pub static IK_PhotosBundleIdentifier: Option<&'static NSString>;
236}