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