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  · 

FileTransferTask Class Reference
[QtBluetoothModule, QtInfraredModule]

The FileTransferTask class provides an interface to receive notifications about file transfer operations. More...

    #include <FileTransferTask>

Inherits QObject.

Inherited by BluetoothFileSendService, BluetoothObexPushService, IrFileSendService, and IrObexPushService.

Public Functions

  • 29 public functions inherited from QObject

Public Slots

  • 1 public slot inherited from QObject

Signals

Static Protected Members

Additional Inherited Members

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

Detailed Description

The FileTransferTask class provides an interface to receive notifications about file transfer operations.

FileTransferTask is a Qt Extended server task interface. If a class is to implement this interface, it must subclass FileTransferTask, be made into a task, and declare that it implements this interface using QTOPIA_TASK_PROVIDES. For example, if there is a subclass called MyTransferService, the code would look something similar to this:

In the .h header file:

    class MyTransferService : public FileTransferTask
    {
        Q_OBJECT
    public:
        MyTransferService();
    }

In the .cpp implementation file:

    MyTransferService::MyTransferService()
        : FileTransferTask()
    {
    }
    QTOPIA_TASK(MyTransferService, MyTransferService)
    QTOPIA_TASK_PROVIDES(MyTransferService, FileTransferTask)

Refer to the various FileTransferTask subclasses for the various transfer tasks supported by Qtopia.

Each existing FileTransferTask is automatically incorporated into the FileTransferWindow which monitors each transfer and presents a window to the user indicating the progress.

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

See also FileTransferWindow.


Member Function Documentation

void FileTransferTask::abortTransfer ( int id )   [virtual slot]

Aborts the transfer identified by id. Does nothing if the request cannot be identified or if it has already finished.

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

The default implementation does nothing.

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

This signal should be emitted by the subclass when an incoming file transfer has started. id should be a value that uniquely identifies the transfer, and name, mimeType should be set to the name and MIME type of the transferred object. description can be used to provide a user-friendly description of the transferred object, if necessary.

See also nextTransferId().

int FileTransferTask::nextTransferId ()   [static protected]

Generates and returns a new file transfer ID.

Subclasses should use this to generate a file transfer ID that is unique across all file transfer classes that implement the FileTransferTask interface. The ID can then be used to emit the signals in this class.

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

This signal should be emitted by the subclass when an outgoing file transfer has started. id should be a value that uniquely identifies the transfer within this task, and name, mimeType should be set to the name and MIME type of the transferred object. description can be used to provide a user-friendly description of the transferred object, if necessary.

See also nextTransferId().

QContentId FileTransferTask::transferContentId ( int id ) const   [virtual]

Returns the QContent ID for the transfer identified by id, or QContent::InvalidId if the transfer does not have an associated QContent ID.

This value may change over the course of a file transfer. For example, an incoming transfer may not have an associated QContent ID to begin with, but a file transfer task might assign a QContent ID to the transfer once the transfer is finished and the data has been saved into the Qt Extended document system as an identifiable QContent resource.

The specified transfer should be one that is still in progress or has only just finished (i.e. at the point when transferFinished() is emitted), as a file transfer task is not required to retain information for a transfer after transferFinished() has been emitted.

The default implementation returns QContent::InvalidId.

void FileTransferTask::transferFinished ( int id, bool error, bool aborted )   [signal]

This signal should be emitted by the subclass when a transfer has finished. id is the value that identifies the transfer, error is true if an error occurred during the transfer (that is, the transfer was unsuccessful) and aborted is true if the transfer was canceled.

void FileTransferTask::transferProgress ( int id, qint64 done, qint64 total )   [signal]

This signal should be emitted by the subclass when some data has been sent or received for a file transfer. id is the value that identifies the transfer, done is the number of bytes that have been transferred so far, and total is the total number of bytes to be transferred. total can be set to 0 if the total is unknown.

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 64
  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