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  · 

ObexPushRequestSender Class Reference
[QtBluetoothModule, QtInfraredModule]

The ObexPushRequestSender class provides convenience methods for sending a variety of OBEX Push requests and also provides updates regarding the progress of each request. More...

    #include <ObexPushRequestSender>

Inherits QObject.

Public Functions

  • ObexPushRequestSender ( QObject * parent = 0 )
  • bool abortRequest ( int id )
  • QContentId requestContentId ( int id ) const
  • void sendBusinessCard ( SessionedObexClient * client, int id, const QContact & contact )
  • void sendBusinessCard ( SessionedObexClient * client, int id, const QDSActionRequest & actionRequest )
  • void sendCalendar ( SessionedObexClient * client, int id, const QDSActionRequest & actionRequest )
  • void sendContent ( SessionedObexClient * client, int id, const QContentId & contentId )
  • void sendFile ( SessionedObexClient * client, int id, const QString & filePath, const QString & mimeType, const QString & description, bool autoDeleteFile )
  • void sendPersonalBusinessCard ( SessionedObexClient * client, int id )
  • 29 public functions inherited from QObject

Signals

  • void requestFinished ( int id, bool error, bool aborted )
  • void requestProgress ( int id, qint64 done, qint64 total )
  • void requestStarted ( int id, const QString & name, const QString & mimeType, const QString & description )

Protected Functions

  • virtual QIODevice * createDevice ( const QContentId & contentId ) const
  • virtual QIODevice * createDevice ( const QContact & contact ) const
  • virtual QFile * createFile ( const QString & filePath ) const
  • QContact ownerBusinessCard ( bool * hasBusinessCard ) const
  • 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 ObexPushRequestSender class provides convenience methods for sending a variety of OBEX Push requests and also provides updates regarding the progress of each request.

ObexPushRequestSender sends files that are commonly transferred using the OBEX Object Push Profile, including business cards (vCards), calendars and ordinary files.

A unique ID is generated for each request and is used to provide request updates through the requestStarted(), requestProgress() and requestFinished() signals. Requests can be canceled using abortRequest().

This class uses SessionedObexClient to send each OBEX request inside of a device session for a particular hardware device. This ensures the Qt Extended device manager will try to keep the device open while a request is in progress.

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.


Member Function Documentation

ObexPushRequestSender::ObexPushRequestSender ( QObject * parent = 0 )

Constructs a sender with parent object parent.

bool ObexPushRequestSender::abortRequest ( int id )

Aborts the request identified by id.

If the request is successfully aborted, requestFinished() is emitted with aborted set to true. Due to timing issues, it is possible that the request has already finished. In this case, the request is not aborted, and requestFinished() will be emitted as normal.

Returns true if id references a request that is in progress; that is, requestFinished() has not yet been emitted for the request. Otherwise, this method does nothing, and returns false.

QIODevice * ObexPushRequestSender::createDevice ( const QContentId & contentId ) const   [virtual protected]

Returns an opened QIODevice that can read from the contents of the resource identified by contentId. Returns 0 if there was an error.

The default implementation displays an error message if the resource is not accessible for reading.

This sender takes ownership of the returned device and deletes it when the request is finshed.

QIODevice * ObexPushRequestSender::createDevice ( const QContact & contact ) const   [virtual protected]

This is an overloaded member function, provided for convenience.

Returns an opened QIODevice that can read the raw vCard data for the business card specified by contact. Returns 0 if there was an error.

The default implementation displays an error message if the contact data cannot be processed.

This sender takes ownership of the returned device and deletes it when the request is finshed.

QFile * ObexPushRequestSender::createFile ( const QString & filePath ) const   [virtual protected]

Returns an opened file that can read from the contents of the file at filePath. Returns 0 if there was an error.

The default implementation displays an error message if the file does not exist or cannot be opened.

This sender takes ownership of the returned file and deletes it when the request is finshed.

QContact ObexPushRequestSender::ownerBusinessCard ( bool * hasBusinessCard ) const   [protected]

Returns a QContact object that contains the details of the owner's business card. hasBusinessCard is set to true if the owner's business card is available, otherwise it is set to false.

The default implementation returns the result of QContactModel::personalDetails(). The owner's business card is determined to be available if QContactModel::hasPersonalDetails() returns true.

QContentId ObexPushRequestSender::requestContentId ( int id ) const

Returns the QContent ID for the request identified by id if the request was started by a call to sendContent(). Otherwise, returns QContent::InvalidId.

void ObexPushRequestSender::requestFinished ( int id, bool error, bool aborted )   [signal]

This signal is emitted when the request identified by id is finished. error is true if the request has failed, and aborted is true if the request was aborted following a call to abortRequest().

void ObexPushRequestSender::requestProgress ( int id, qint64 done, qint64 total )   [signal]

This signal is emitted to indicate the progress of the request identified by id. done is the amount of data that has already been sent, and total is the total amount of data to be sent. If the total amount cannot be determined, total is set to 0.

void ObexPushRequestSender::requestStarted ( int id, const QString & name, const QString & mimeType, const QString & description )   [signal]

This signal is emitted when an OBEX request begins. The id uniquely identifies the request for this sender. The name, mimeType and description are respectively set to the Name, Type and Description metadata values that will be sent in the request.

void ObexPushRequestSender::sendBusinessCard ( SessionedObexClient * client, int id, const QContact & contact )

Sends the business card represented by contact using client.

The specified id will be used to emit the requestStarted(), requestProgress() and requestFinished() signals for this request.

This sender takes ownership of client and deletes it when the request is finished.

See also sendPersonalBusinessCard().

void ObexPushRequestSender::sendBusinessCard ( SessionedObexClient * client, int id, const QDSActionRequest & actionRequest )

This is an overloaded member function, provided for convenience.

Sends the business card represented by actionRequest using client. The request object should contain raw serialized QContact data.

The specified id will be used to emit the requestStarted(), requestProgress() and requestFinished() signals for this request.

This sender takes ownership of client and deletes it when the request is finished.

See also sendPersonalBusinessCard().

void ObexPushRequestSender::sendCalendar ( SessionedObexClient * client, int id, const QDSActionRequest & actionRequest )

Sends the vCalendar object represented by actionRequest using client. The request object should contain raw serialized QTask or QAppointment data.

The specified id will be used to emit the requestStarted(), requestProgress() and requestFinished() signals for this request.

This sender takes ownership of client and deletes it when the request is finished.

void ObexPushRequestSender::sendContent ( SessionedObexClient * client, int id, const QContentId & contentId )

Sends the document identified by contentId using client.

The specified id will be used to emit the requestStarted(), requestProgress() and requestFinished() signals for this request.

This sender takes ownership of client and deletes it when the request is finished.

See also createDevice().

void ObexPushRequestSender::sendFile ( SessionedObexClient * client, int id, const QString & filePath, const QString & mimeType, const QString & description, bool autoDeleteFile )

Sends the file stored at filePath using client. The specified mimeType and description (both optional) will be sent in the request to provide additional metadata for the file. Set autoDeleteFile to true if the file stores at filePath should be deleted after it has been sent.

The specified id will be used to emit the requestStarted(), requestProgress() and requestFinished() signals for this request.

This sender takes ownership of client and deletes it when the request is finished.

See also createFile().

void ObexPushRequestSender::sendPersonalBusinessCard ( SessionedObexClient * client, int id )

Sends the user's personal business card using client. If the user has not set a personal business card, the user will be notified appropriately.

The specified id will be used to emit the requestStarted(), requestProgress() and requestFinished() signals for this request.

This sender takes ownership of client and deletes it when the request is finished.

See also sendBusinessCard() and ownerBusinessCard().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 68
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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