QObexPushService Class Reference
|
Constant | Value | Description |
---|---|---|
QObexPushService::NoError | 0 | No error has occurred. |
QObexPushService::ConnectionError | 1 | The client is unable to send data, or the client-server communication process is otherwise disrupted. If this happens, the state will change to QObexPushService::Closed. |
QObexPushService::Aborted | 2 | The request was aborted (either by the client, or by a call to abort()). |
QObexPushService::UnknownError | 100 | An error other than those specified above occurred. |
Defines the possible states for a push service.
Constant | Value | Description |
---|---|---|
QObexPushService::Ready | 0 | The service is ready to receive requests from an OBEX client. This is the default state. |
QObexPushService::Connecting | 1 | A client is connecting. |
QObexPushService::Disconnecting | 2 | A client is disconnecting. |
QObexPushService::Streaming | 3 | A file transfer operation is in progress. |
QObexPushService::Closed | 100 | The service has been closed and cannot process any more requests. The service will change to this state if a client sends a Disconnect command, or a ConnectionError occurs. |
Constructs an OBEX Push service that uses device for the transport connection. The parent is the QObject parent.
The device must be opened, or else the service will be unable to receive any client requests.
Destroys the service.
Aborts the current client request if a Put or Get request is in progress. If the request was successfully aborted, requestFinished() will be emitted with error set to true and error() will return QObexPushService::Aborted.
Due to timing issues, the request may finish before it can be aborted, in which case requestFinished() is emitted normally.
Called when a client makes a Put request to send a file to this service. The name, type, size and description parameters respectively hold the name, MIME type, size and description of the file, as sent by the client. The size will be 0 if the client did not send any information about the size of the file.
This function can be overridden to intercept the request and determine whether the request should be allowed to continue (for example, by asking the end user, or by checking some file threshold) and where the file data should be saved. To allow the request, return a QIODevice pointer, and the received file data will be written to this QIODevice. To refuse the request, return 0.
If the request is allowed to continue, the putRequested() signal is emitted, and the requestFinished() signal will be emitted when the the request has finished. The returned QIODevice pointer is accessible from currentDevice().
The default implementation attempts to save the incoming file into QDir::homePath(), using name as the name of the file. (If name contains a path, only the filename at the end of the path will be used, and if name is an empty string, the file will be saved as "received_file".) If the file is successfully created, the Put request will be accepted; otherwise, the request will be refused.
See also putRequested(), currentDevice(), dataTransferProgress(), and requestFinished().
Returns the business card that will be sent to OBEX clients who request it, as per the Business Card exchange feature of the Bluetooth Object Push Profile.
See also setBusinessCard().
This signal is emitted when an OBEX client has requested the business card from the service, and businessCard() returns a non-empty QByteArray. (If businessCard() returns an empty QByteArray, the signal is not emitted.)
The requestFinished() signal is emitted when the request is completed.
See also setBusinessCard() and businessCard().
If a Put request is in progress, this function returns the QIODevice pointer that is used to store the data from the request. If there is no Put request in progress, this function returns 0.
This function can be used to delete the QIODevice in the slot connected to the requestFinished() signal.
See also acceptFile().
This signal is emitted during file transfer operations to indicate the progress of the 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 number of bytes is not known, total will be 0.
This signal is emitted when the OBEX client has disconnected from the service or if the connection has been terminated. The error value is true if an error occurred during the processing; otherwise error is false.
Returns the error for the last completed request.
This signal is emitted when an OBEX client has made a Put request to the service and acceptFile() has accepted the request. The name, type, size and description parameters respectively hold the name, MIME type, size and description of the file, as sent by the client. The size will be 0 if the client did not send any information about the size of the file.
The requestFinished() signal is emitted when the Put request is completed.
See also currentDevice().
This signal is emitted when a client Put or Get request is completed. The error value is true if an error occurred during the request; otherwise error is false.
Returns the device used by this OBEX Push server session, as provided in the constructor.
Sets vCard to be the business card (in vCard format) that will be sent to OBEX clients who request it, as per the Business Card exchange feature of the Bluetooth Object Push Profile.
If no business card is set, this service will refuse all client requests for business cards.
See also businessCard().
Returns the current state of the service.
This signal is emitted when the state of the service changes. The state is the new state of the client.
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 ! |
Copyright © 2000-2012 - www.developpez.com