Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

SessionedObexClient Class Reference
[QtBluetoothModule, QtInfraredModule]

The SessionedObexClient class provides a base implementation for performing an OBEX Put request inside of a device session for a particular hardware device. More...

    #include <SessionedObexClient>

Inherits QObject.

Public Functions

  • SessionedObexClient ( const QByteArray & deviceId, QObject * parent = 0 )
  • virtual void abort ()
  • virtual void begin ( const QObexHeader & header, QIODevice * dataToSend )
  • 29 public functions inherited from QObject

Signals

Protected Functions

  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The SessionedObexClient class provides a base implementation for performing an OBEX Put request inside of a device session for a particular hardware device.

A SessionedObexClient will open a device session for the relevant hardware device before sending the specified OBEX request. Once the request is completed, the device session will be closed.

The use of device sessions ensures the Qt Extended device manager is aware that a hardware device is currently in use, so that the device manager will try to keep the device open while the OBEX request is in progress.

If you want to send OBEX requests without using device sessions, just use QObexClientSession.

This class enables the BluetoothFileSendService and the IrFileSendService.

This class is part of the Qt Extended server and cannot be used by other Qt Extended applications.

Subclassing SessionedObexClient

SessionedObexClient needs to be subclassed to provide the transport socket for the OBEX client request. When start() is called, the client will attempt to open a device session. When the session is opened (or fails to open), openedDeviceSession() is called. Subclasses should override this openedDeviceSession() to create an appropriate transport socket and then call sendRequest() with the socket object in order to begin the OBEX request.

The subclass can call abort() if the session should be ended prematurely.

See also QCommDeviceSession and QAbstractCommDeviceManager.


Member Function Documentation

SessionedObexClient::SessionedObexClient ( const QByteArray & deviceId, QObject * parent = 0 )

Creates a client that will operate on a device session for the hardware device with the given deviceId.

The parent is the QObject parent object for the client.

void SessionedObexClient::abort ()   [virtual]

Aborts the OBEX request and closes the device session.

If the OBEX request has been sent (i.e. begin() and sendRequest() have been called) and the request has not yet finished, the client will attempt to abort the transfer to the server. If this is successful, requestFinished() is emitted with aborted set to true. Then, the device session is closed, closedDeviceSession() is called and done() is emitted.

Otherwise, this will just close the device session, call closedDeviceSession() and emit done().

void SessionedObexClient::begin ( const QObexHeader & header, QIODevice * dataToSend )   [virtual]

Starts the client. Once the client is ready, it will send an OBEX Put request with header and the contents of dataToSend.

void SessionedObexClient::closedDeviceSession ()   [virtual protected]

Called when the device session for this client has been closed.

The device session could be closed because abort() has been called, or an external party has closed the session (e.g. by bringing down the associated hardware device).

void SessionedObexClient::dataSendProgress ( qint64 done, qint64 total )   [signal]

This signal is emitted after the request has started to indicate the progress of the data transfer. The done value is the number of bytes that have been sent or received so far, and total is the total number of bytes to be sent or received. If the total amount cannot be determined, total is set to 0.

void SessionedObexClient::done ()   [signal]

This signal is emitted once the device session has closed and closedDeviceSession() has been called.

void SessionedObexClient::forceAbort ()   [pure virtual protected]

Called when abort() has been called but the OBEX server has not responded to the Abort request. In this case, the subclass should try to force the cancelation of the request - for example, by disconnecting the transport connection.

void SessionedObexClient::openedDeviceSession ( bool error )   [pure virtual protected]

When begin() is called, the client will open the device session. Once the device session is opened (or has failed to open), this method will be called. error is true if the session failed to open.

Subclasses should override this to call sendRequest() with an appropriate socket object if the session was opened successfully.

void SessionedObexClient::requestFinished ( bool error, bool aborted )   [signal]

This signal is emitted when the OBEX request has finished. error is set to true if an error occurred during the request, and aborted is set to true if the request was aborted by a call to abort().

void SessionedObexClient::requestStarted ()   [signal]

This signal is emitted when the OBEX request has started. The request will not start until sendRequest() has been called by the subclass.

void SessionedObexClient::sendRequest ( QIODevice * socket )   [protected]

Sends the OBEX Put request specified in begin() over the given socket.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web