Mac Developer Library

Developer

IOBluetoothObjectPushUIController Class Reference

Options
Deployment Target:

On This Page

IOBluetoothObjectPushUIController

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

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

    Declaration

    - (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.

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

    Declaration

    - (IOBluetoothDevice*) getDevice;

    Return Value

    The remote device of the transfer.

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

    Declaration

    - (NSString *) getTitle;

    Return Value

    Returns the title of the transfer panel.

  • Creates and returns a new IOBluetoothObjectPush object

    Declaration

    - (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.

    See Also

    initObjectPushWithBluetoothDevice:withFiles:andEventDelegate:

  • Gets state of the transfer

    Declaration

    - (BOOL) isTransferInProgress;

    Return Value

    The state of the transfer

  • Runs the transfer UI panel in a modal session

    Declaration

    - (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.

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

    Declaration

    - (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.

  • Manually sets the icon used in the panel.

    Declaration

    - (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.

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

    Declaration

    - (void) setTitle: (NSString *) windowTitle;

    Parameters

    windowTitle

    Title of the device selector panel.

    Discussion

    The panel title should be localized for best user experience.

  • Stops the transfer UI

    Declaration

    - (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.