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
263
//! 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_app_kit::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-io-bluetooth")]
use objc2_io_bluetooth::*;
use crate::*;
extern_class!(
/// An NSWindowController subclass that supports the creation of an IOBluetoothObjectPushUIController object.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/iobluetoothobjectpushuicontroller?language=objc)
#[unsafe(super(NSWindowController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct IOBluetoothObjectPushUIController;
);
extern_conformance!(
unsafe impl NSCoding for IOBluetoothObjectPushUIController {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for IOBluetoothObjectPushUIController {}
);
extern_conformance!(
unsafe impl NSSeguePerforming for IOBluetoothObjectPushUIController {}
);
impl IOBluetoothObjectPushUIController {
extern_methods!(
#[cfg(feature = "objc2-io-bluetooth")]
/// Creates and returns a new IOBluetoothObjectPush object
///
/// The event delegate should implement a single delegate method:
///
/// - (void) objectPushComplete: (IOBluetoothObjectPushUIController*) inPusher
///
/// The method will be called when the transaction is complete and
/// should be used to release the push object by the delegate. If no delegate is set
/// the object will release itself when the transfer is finished.
///
/// Parameter `inDevice`: The remote device to send the files to
///
/// Parameter `inFiles`: An array of file paths to send
///
/// Parameter `inDelegate`: A delegate object that implements the single method above. If no delegate
/// is specified this object will release itself when the transaction is complete.
///
/// Returns: An IOBluetoothObjectPushUIController object on success, nil on fail.
///
/// # Safety
///
/// - `in_device` might not allow `None`.
/// - `in_files` generic should be of the correct type.
/// - `in_files` might not allow `None`.
/// - `in_delegate` should be of the correct type.
/// - `in_delegate` might not allow `None`.
#[unsafe(method(initObjectPushWithBluetoothDevice:withFiles:delegate:))]
#[unsafe(method_family = init)]
pub unsafe fn initObjectPushWithBluetoothDevice_withFiles_delegate(
this: Allocated<Self>,
in_device: Option<&IOBluetoothDevice>,
in_files: Option<&NSArray>,
in_delegate: Option<&AnyObject>,
) -> Option<Retained<IOBluetoothObjectPushUIController>>;
/// Runs the transfer UI panel in a modal session
///
/// Returns when the modal session has ended. This object will call back over the
/// delegate method (above) when the transfer is complete. Users should release
/// the object then. If no delegate is set the object will release itself.
///
/// Returns: The call will stall in this method until the modal session is complete.
#[unsafe(method(runModal))]
#[unsafe(method_family = none)]
pub unsafe fn runModal(&self);
/// Runs the transfer UI as a panel with no modal session
///
/// Returns immediately. The object will callback over the delegate method (above)
/// when the transfer is completed. If no delegate is set the object will release itself.
///
/// Returns: The method will return immediately.
#[unsafe(method(runPanel))]
#[unsafe(method_family = none)]
pub unsafe fn runPanel(&self);
/// Runs the transfer UI as a sheet on the target window.
///
/// This function works the same way as -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:].
/// The didEndSelector has a similar prototype as in NSApplication except that the first argument is the
/// IOBluetoothDeviceSelectorController object instead of the window:
///
/// -(void)sheetDidEnd:(IOBluetoothDeviceSelectorController *)controller returnCode:(int)returnCode contextInfo:(void *)contextInfo.
/// The returnCode parameter will either be kIOBluetoothUISuccess or kIOBluetoothUIUserCancelledErr as described in
/// -runModal.
///
///
/// Parameter `sheetWindow`: NSWindow to attach the device selector panel to as a sheet.
///
/// Parameter `modalDelegate`: Delegate object that gets sent the didEndSelector when the sheet modal session is finished.
///
/// Parameter `didEndSelector`: Selector sent to the modalDelegate when the sheet modal session is finished.
///
/// Parameter `contextInfo`: User-definied value passed to the modalDelegate in the didEndSelector.
///
/// Returns: Returns kIOReturnSuccess if the sheet modal session was started.
///
/// # Safety
///
/// - `sheet_window` might not allow `None`.
/// - `modal_delegate` should be of the correct type.
/// - `modal_delegate` might not allow `None`.
/// - `did_end_selector` must be a valid selector.
/// - `context_info` must be a valid pointer.
#[unsafe(method(beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo(
&self,
sheet_window: Option<&NSWindow>,
modal_delegate: Option<&AnyObject>,
did_end_selector: Option<Sel>,
context_info: *mut c_void,
) -> IOReturn;
/// Stops the transfer UI
///
/// Returns immediately. The object will callback over the delegate method (above)
/// when the transfer is completed, or will release itself if no delegate is set.
///
/// Returns: The method will return immediately.
#[unsafe(method(stop))]
#[unsafe(method_family = none)]
pub unsafe fn stop(&self);
/// Sets the title of the panel when not run as a sheet.
///
/// The panel title should be localized for best user experience.
///
/// Parameter `windowTitle`: Title of the device selector panel.
///
/// # Safety
///
/// `window_title` might not allow `None`.
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub unsafe fn setTitle(&self, window_title: Option<&NSString>);
/// Returns the title of the transfer panel (i.e. what was set in -setTitle:).
///
///
/// Returns: Returns the title of the transfer panel.
#[unsafe(method(getTitle))]
#[unsafe(method_family = none)]
pub unsafe fn getTitle(&self) -> Option<Retained<NSString>>;
/// Manually sets the icon used in the panel.
///
/// The panel icon should be set to the icon of the calling application. If not set, the panel
/// will try to load up the correct icon for the target device, and will default to the icon of
/// the running application on fail.
///
/// Parameter `image`: Image to use as the icon.
///
/// # Safety
///
/// `image` might not allow `None`.
#[unsafe(method(setIconImage:))]
#[unsafe(method_family = none)]
pub unsafe fn setIconImage(&self, image: Option<&NSImage>);
#[cfg(feature = "objc2-io-bluetooth")]
/// Gets the object representing the remote target device in the transfer.
///
///
/// Returns: The remote device of the transfer.
#[unsafe(method(getDevice))]
#[unsafe(method_family = none)]
pub unsafe fn getDevice(&self) -> Option<Retained<IOBluetoothDevice>>;
/// Gets state of the transfer
///
///
/// Returns: The state of the transfer
#[unsafe(method(isTransferInProgress))]
#[unsafe(method_family = none)]
pub unsafe fn isTransferInProgress(&self) -> bool;
);
}
/// Methods declared on superclass `NSWindowController`.
impl IOBluetoothObjectPushUIController {
extern_methods!(
#[unsafe(method(initWithWindow:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithWindow(
this: Allocated<Self>,
window: Option<&NSWindow>,
) -> Retained<Self>;
/// # Safety
///
/// `coder` possibly has further requirements.
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(initWithWindowNibName:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithWindowNibName(
this: Allocated<Self>,
window_nib_name: &NSNibName,
) -> Retained<Self>;
/// # Safety
///
/// `owner` should be of the correct type.
#[unsafe(method(initWithWindowNibName:owner:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithWindowNibName_owner(
this: Allocated<Self>,
window_nib_name: &NSNibName,
owner: &AnyObject,
) -> Retained<Self>;
/// # Safety
///
/// `owner` should be of the correct type.
#[unsafe(method(initWithWindowNibPath:owner:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithWindowNibPath_owner(
this: Allocated<Self>,
window_nib_path: &NSString,
owner: &AnyObject,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSResponder`.
impl IOBluetoothObjectPushUIController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl IOBluetoothObjectPushUIController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}