objc2_io_bluetooth_ui/generated/objc2/
IOBluetoothObjectPushUIController.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_app_kit::*;
7use objc2_foundation::*;
8#[cfg(feature = "objc2-io-bluetooth")]
9use objc2_io_bluetooth::*;
10
11use crate::*;
12
13extern_class!(
14    /// An NSWindowController subclass that supports the creation of an IOBluetoothObjectPushUIController object.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/iobluetoothobjectpushuicontroller?language=objc)
17    #[unsafe(super(NSWindowController, NSResponder, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct IOBluetoothObjectPushUIController;
20);
21
22extern_conformance!(
23    unsafe impl NSCoding for IOBluetoothObjectPushUIController {}
24);
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for IOBluetoothObjectPushUIController {}
28);
29
30extern_conformance!(
31    unsafe impl NSSeguePerforming for IOBluetoothObjectPushUIController {}
32);
33
34impl IOBluetoothObjectPushUIController {
35    extern_methods!(
36        #[cfg(feature = "objc2-io-bluetooth")]
37        /// Creates and returns a new IOBluetoothObjectPush object
38        ///
39        /// The event delegate should implement a single delegate method:
40        ///
41        /// - (void) objectPushComplete: (IOBluetoothObjectPushUIController*) inPusher
42        ///
43        /// The method will be called when the transaction is complete and
44        /// should be used to release the push object by the delegate. If no delegate is set
45        /// the object will release itself when the transfer is finished.
46        ///
47        /// Parameter `inDevice`: The remote device to send the files to
48        ///
49        /// Parameter `inFiles`: An array of file paths to send
50        ///
51        /// Parameter `inDelegate`: A delegate object that implements the single method above.  If no delegate
52        /// is specified this object will release itself when the transaction is complete.
53        ///
54        /// Returns: An IOBluetoothObjectPushUIController object on success, nil on fail.
55        ///
56        /// # Safety
57        ///
58        /// - `in_device` might not allow `None`.
59        /// - `in_files` generic should be of the correct type.
60        /// - `in_files` might not allow `None`.
61        /// - `in_delegate` should be of the correct type.
62        /// - `in_delegate` might not allow `None`.
63        #[unsafe(method(initObjectPushWithBluetoothDevice:withFiles:delegate:))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn initObjectPushWithBluetoothDevice_withFiles_delegate(
66            this: Allocated<Self>,
67            in_device: Option<&IOBluetoothDevice>,
68            in_files: Option<&NSArray>,
69            in_delegate: Option<&AnyObject>,
70        ) -> Option<Retained<IOBluetoothObjectPushUIController>>;
71
72        /// Runs the transfer UI panel in a modal session
73        ///
74        /// Returns when the modal session has ended. This object will call back over the
75        /// delegate method (above) when the transfer is complete.  Users should release
76        /// the object then. If no delegate is set the object will release itself.
77        ///
78        /// Returns: The call will stall in this method until the modal session is complete.
79        #[unsafe(method(runModal))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn runModal(&self);
82
83        /// Runs the transfer UI as a panel with no modal session
84        ///
85        /// Returns immediately.  The object will callback over the delegate method (above)
86        /// when the transfer is completed.  If no delegate is set the object will release itself.
87        ///
88        /// Returns: The method will return immediately.
89        #[unsafe(method(runPanel))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn runPanel(&self);
92
93        /// Runs the  transfer UI as a sheet on the target window.
94        ///
95        /// This function works the same way as -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:].
96        /// The didEndSelector has a similar prototype as in NSApplication except that the first argument is the
97        /// IOBluetoothDeviceSelectorController object instead of the window:
98        ///
99        /// -(void)sheetDidEnd:(IOBluetoothDeviceSelectorController *)controller returnCode:(int)returnCode contextInfo:(void *)contextInfo.
100        /// The returnCode parameter will either be kIOBluetoothUISuccess or kIOBluetoothUIUserCancelledErr as described in
101        /// -runModal.
102        ///
103        ///
104        /// Parameter `sheetWindow`: NSWindow to attach the device selector panel to as a sheet.
105        ///
106        /// Parameter `modalDelegate`: Delegate object that gets sent the didEndSelector when the sheet modal session is finished.
107        ///
108        /// Parameter `didEndSelector`: Selector sent to the modalDelegate when the sheet modal session is finished.
109        ///
110        /// Parameter `contextInfo`: User-definied value passed to the modalDelegate in the didEndSelector.
111        ///
112        /// Returns: Returns kIOReturnSuccess if the sheet modal session was started.
113        ///
114        /// # Safety
115        ///
116        /// - `sheet_window` might not allow `None`.
117        /// - `modal_delegate` should be of the correct type.
118        /// - `modal_delegate` might not allow `None`.
119        /// - `did_end_selector` must be a valid selector.
120        /// - `context_info` must be a valid pointer.
121        #[unsafe(method(beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo(
124            &self,
125            sheet_window: Option<&NSWindow>,
126            modal_delegate: Option<&AnyObject>,
127            did_end_selector: Option<Sel>,
128            context_info: *mut c_void,
129        ) -> IOReturn;
130
131        /// Stops the transfer UI
132        ///
133        /// Returns immediately. The object will callback over the delegate method (above)
134        /// when the transfer is completed, or will release itself if no delegate is set.
135        ///
136        /// Returns: The method will return immediately.
137        #[unsafe(method(stop))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn stop(&self);
140
141        /// Sets the title of the panel when not run as a sheet.
142        ///
143        /// The panel title should be localized for best user experience.
144        ///
145        /// Parameter `windowTitle`: Title of the device selector panel.
146        ///
147        /// # Safety
148        ///
149        /// `window_title` might not allow `None`.
150        #[unsafe(method(setTitle:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn setTitle(&self, window_title: Option<&NSString>);
153
154        /// Returns the title of the transfer panel (i.e. what was set in -setTitle:).
155        ///
156        ///
157        /// Returns: Returns the title of the transfer panel.
158        #[unsafe(method(getTitle))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn getTitle(&self) -> Option<Retained<NSString>>;
161
162        /// Manually sets the icon used in the panel.
163        ///
164        /// The panel icon should be set to the icon of the calling application.  If not set, the panel
165        /// will try to load up the correct icon for the target device, and will default to the icon of
166        /// the running application on fail.
167        ///
168        /// Parameter `image`: Image to use as the icon.
169        ///
170        /// # Safety
171        ///
172        /// `image` might not allow `None`.
173        #[unsafe(method(setIconImage:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setIconImage(&self, image: Option<&NSImage>);
176
177        #[cfg(feature = "objc2-io-bluetooth")]
178        /// Gets the object representing the remote target device in the transfer.
179        ///
180        ///
181        /// Returns: The remote device of the transfer.
182        #[unsafe(method(getDevice))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn getDevice(&self) -> Option<Retained<IOBluetoothDevice>>;
185
186        /// Gets state of the transfer
187        ///
188        ///
189        /// Returns: The state of the transfer
190        #[unsafe(method(isTransferInProgress))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn isTransferInProgress(&self) -> bool;
193    );
194}
195
196/// Methods declared on superclass `NSWindowController`.
197impl IOBluetoothObjectPushUIController {
198    extern_methods!(
199        #[unsafe(method(initWithWindow:))]
200        #[unsafe(method_family = init)]
201        pub unsafe fn initWithWindow(
202            this: Allocated<Self>,
203            window: Option<&NSWindow>,
204        ) -> Retained<Self>;
205
206        /// # Safety
207        ///
208        /// `coder` possibly has further requirements.
209        #[unsafe(method(initWithCoder:))]
210        #[unsafe(method_family = init)]
211        pub unsafe fn initWithCoder(
212            this: Allocated<Self>,
213            coder: &NSCoder,
214        ) -> Option<Retained<Self>>;
215
216        #[unsafe(method(initWithWindowNibName:))]
217        #[unsafe(method_family = init)]
218        pub unsafe fn initWithWindowNibName(
219            this: Allocated<Self>,
220            window_nib_name: &NSNibName,
221        ) -> Retained<Self>;
222
223        /// # Safety
224        ///
225        /// `owner` should be of the correct type.
226        #[unsafe(method(initWithWindowNibName:owner:))]
227        #[unsafe(method_family = init)]
228        pub unsafe fn initWithWindowNibName_owner(
229            this: Allocated<Self>,
230            window_nib_name: &NSNibName,
231            owner: &AnyObject,
232        ) -> Retained<Self>;
233
234        /// # Safety
235        ///
236        /// `owner` should be of the correct type.
237        #[unsafe(method(initWithWindowNibPath:owner:))]
238        #[unsafe(method_family = init)]
239        pub unsafe fn initWithWindowNibPath_owner(
240            this: Allocated<Self>,
241            window_nib_path: &NSString,
242            owner: &AnyObject,
243        ) -> Retained<Self>;
244    );
245}
246
247/// Methods declared on superclass `NSResponder`.
248impl IOBluetoothObjectPushUIController {
249    extern_methods!(
250        #[unsafe(method(init))]
251        #[unsafe(method_family = init)]
252        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
253    );
254}
255
256/// Methods declared on superclass `NSObject`.
257impl IOBluetoothObjectPushUIController {
258    extern_methods!(
259        #[unsafe(method(new))]
260        #[unsafe(method_family = new)]
261        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
262    );
263}