Home · All Classes · Annotated · Functions

QBluetoothObexSender Class Reference

The QBluetoothObexSender class allows sending files over Bluetooth OBEX Push. More...

#include <QBluetoothObexSender>

Inherits QObject.

Public Types

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

The QBluetoothObexSender class allows sending files over Bluetooth OBEX Push.

The QBluetoothObexSender class can be used to send a single file to an OBEX Bluetooth Push server. The file sent can either be a business card (vCard), calendar (vCal), or any other file type.


Member Type Documentation

enum QBluetoothObexSender::Error

Defines the Errors states that the object can be in.

enum Error { NoError, ConnectionError, RequestError, LinkError, UnknownError };

ConstantValueDescription
QBluetoothObexSender::NoError0No error has occurred.
QBluetoothObexSender::ConnectionError1Error during the connection attempt.
QBluetoothObexSender::RequestError2Error during a request
QBluetoothObexSender::LinkError3A connection link has been interrupted.
QBluetoothObexSender::UnknownError4Something unknown happened that caused the connection to be terminated.

enum QBluetoothObexSender::State

Defines the States that the object can be in.

ConstantValueDescription
QBluetoothObexSender::Unconnected0The object is not connected to the server.
QBluetoothObexSender::Connecting1An OBEX CMD_CONNECT has been sent.
QBluetoothObexSender::Ready2CMD_CONNECT has been accepted by the server, ready to send.
QBluetoothObexSender::Streaming3Sending a file to the server.
QBluetoothObexSender::Disconnecting4Sending a CMD_DISCONNECT to the OBEX server.


Member Function Documentation

QBluetoothObexSender::QBluetoothObexSender ( const QBluetoothAddress & local, const QBluetoothAddress & remote, int rfcomm_channel, QObject * parent = 0 )

Constructs a new Bluetooth OBEX Sender object. The local argument is used to determine which local device will perform the request. This can be either a valid local bluetooth device address or the special value QBluetoothAddress::any. In which case the initiating device is chosen randomly. The remote argument specifies the address of the remote OBEX Push server. The rfcomm_channel argument specifies the channel number of the remote OBEX Push server. The parent parameter specifies the QObject parent of the sender.

QBluetoothObexSender::~QBluetoothObexSender ()

Deconstructs a Bluetooth OBEX Sender.

void QBluetoothObexSender::abort ()   [slot]

Attempts to abort the file send operation. This operation has no effect if no request is currently in progress.

void QBluetoothObexSender::aboutToDelete ()   [signal]

This signal is emitted whenever the current sender object is about to delete itself. This will only happen if the autoDelete property is set.

See also setAutoDelete() and autoDelete().

bool QBluetoothObexSender::autoDelete () const

Returns whether autoDelete property is enabled.

See also setAutoDelete().

void QBluetoothObexSender::done ( bool error )   [signal]

This signal is emitted whenever a request is completed. The error parameter reports whether an error occurred during a request.

Error QBluetoothObexSender::error () const

Returns the current error state of the object

const QBluetoothAddress & QBluetoothObexSender::localAddress () const

Returns the address of the local device specified during construction.

void QBluetoothObexSender::progress ( qint64 completed, qint64 total )   [signal]

This signal is emitted reports the progress of the file send operation. The completed parameter reports how many bytes were sent, and total parameter reports the total number of bytes to send.

const QBluetoothAddress & QBluetoothObexSender::remoteAddress () const

Returns the address of the remote device the sender will attempt to connect to.

bool QBluetoothObexSender::send ( const QString & filename, const QString & mimetype = QString() )   [slot]

Initiates a new send request. The sender will connect to the server specified in the constructor, and will push a file specified by filename. If the mimetype is not provided (empty) then the mimetype will be guessed based on the file extension.

This method returns true if the request could be started successfully, and false otherwise (for instance, request already in progress.) Once the request finishes, if the object is set to autoDelete, the sender will delete itself.

void QBluetoothObexSender::setAutoDelete ( bool enable )

Sets the object autoDelete property to enable. If autoDelete is enabled, then the sender object will automatically delete itself once it completes its request or is aborted. If autoDelete is disabled, the programmer has to manually handle the destruction of the object.

See also autoDelete().

State QBluetoothObexSender::state () const

Returns the current state of the object

void QBluetoothObexSender::stateChanged ( QBluetoothObexSender::State state )   [signal]

This signal is emitted whenever a sender object changes state. The state parameter holds the current state.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7