Mac Developer Library

Developer

IOBluetoothObjectPushUIController Class Reference

Options
Deployment Target:

On This Page
Language:

IOBluetoothObjectPushUIController

Inheritance


Import Statement


Swift

import IOBluetoothUI

Objective-C

@import IOBluetoothUI;

Availability


Available in OS X v10.4 and later.

An NSWindowController subclass that supports the creation of an IOBluetoothObjectPushUIController object.

  • Runs the transfer UI as a sheet on the target window.

    Declaration

    Swift

    func beginSheetModalForWindow(_ sheetWindow: NSWindow!, modalDelegate modalDelegate: AnyObject!, didEndSelector didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>) -> IOReturn

    Objective-C

    - (IOReturn)beginSheetModalForWindow:(NSWindow *)sheetWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo

    Parameters

    sheetWindow

    NSWindow to attach the device selector panel to as a sheet.

    modalDelegate

    Delegate object that gets sent the didEndSelector when the sheet modal session is finished.

    didEndSelector

    Selector sent to the modalDelegate when the sheet modal session is finished.

    contextInfo

    User-definied value passed to the modalDelegate in the didEndSelector.

    Return Value

    Returns kIOReturnSuccess if the sheet modal session was started.

    Discussion

    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.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Gets the object representing the remote target device in the transfer.

    Declaration

    Swift

    func getDevice() -> IOBluetoothDevice!

    Objective-C

    - (IOBluetoothDevice *)getDevice

    Return Value

    The remote device of the transfer.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Returns the title of the transfer panel (i.e. what was set in -setTitle:).

    Declaration

    Swift

    func getTitle() -> String!

    Objective-C

    - (NSString *)getTitle

    Return Value

    Returns the title of the transfer panel.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Creates and returns a new IOBluetoothObjectPush object

    Declaration

    Swift

    init!(objectPushWithBluetoothDevice inDevice: IOBluetoothDevice!, withFiles inFiles: [AnyObject]!, delegate inDelegate: AnyObject!)

    Objective-C

    - (IOBluetoothObjectPushUIController *)initObjectPushWithBluetoothDevice:(IOBluetoothDevice *)inDevice withFiles:(NSArray *)inFiles delegate:(id)inDelegate

    Parameters

    inDevice

    The remote device to send the files to

    inFiles

    An array of file paths to send

    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.

    Discussion

    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.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

    See Also

    initObjectPushWithBluetoothDevice:withFiles:andEventDelegate:

  • Gets state of the transfer

    Declaration

    Swift

    func isTransferInProgress() -> Bool

    Objective-C

    - (BOOL)isTransferInProgress

    Return Value

    The state of the transfer

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.5 and later.

  • Runs the transfer UI panel in a modal session

    Declaration

    Swift

    func runModal()

    Objective-C

    - (void)runModal

    Return Value

    The call will stall in this method until the modal session is complete.

    Discussion

    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.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Runs the transfer UI as a panel with no modal session

    Declaration

    Swift

    func runPanel()

    Objective-C

    - (void)runPanel

    Return Value

    The method will return immediately.

    Discussion

    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.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Manually sets the icon used in the panel.

    Declaration

    Swift

    func setIconImage(_ image: NSImage!)

    Objective-C

    - (void)setIconImage:(NSImage *)image

    Parameters

    image

    Image to use as the icon.

    Discussion

    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.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Sets the title of the panel when not run as a sheet.

    Declaration

    Swift

    func setTitle(_ windowTitle: String!)

    Objective-C

    - (void)setTitle:(NSString *)windowTitle

    Parameters

    windowTitle

    Title of the device selector panel.

    Discussion

    The panel title should be localized for best user experience.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.

  • Stops the transfer UI

    Declaration

    Swift

    func stop()

    Objective-C

    - (void)stop

    Return Value

    The method will return immediately.

    Discussion

    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.

    Import Statement

    Objective-C

    @import IOBluetoothUI;

    Swift

    import IOBluetoothUI

    Availability

    Available in OS X v10.4 and later.