QXmppFileDownload Class
Provides progress of stateless file sharing uploads. More...
| Header: | #include <QXmppFileSharingManager.h> |
| Since: | QXmpp 1.5 |
Public Types
| struct | Downloaded |
| enum | HashVerificationResult { NoStrongHashes, HashVerified } |
| Result |
Properties
- progress : float
Public Functions
| quint64 | bytesTotal() const |
| quint64 | bytesTransferred() const |
| void | cancel() |
| bool | isFinished() const |
| float | progress() const |
| QXmppFileDownload::Result | result() const |
Signals
| void | finished() |
| void | progressChanged() |
Detailed Description
Member Type Documentation
enum QXmppFileDownload::HashVerificationResult
Result of hash verification after a file download.
| Constant | Value | Description |
|---|---|---|
QXmppFileDownload::NoStrongHashes | 0 | File did not contain strong hashes (or no hashes at all) and no verification was done. This value is not used when a hash value did not match — in that case the whole file download returns an error. |
QXmppFileDownload::HashVerified | 1 | The file integrity could be proved using a strong hash algorithm. |
[alias] QXmppFileDownload::Result
Contains QXmpp::Success (successfully finished), QXmpp::Cancelled (manually cancelled) or QXmppError (an error occured while downloading).
Property Documentation
[read-only] progress : float
Progress of the file download between 0.0 and 1.0.
Access functions:
| float | progress() const |
Notifier signal:
| void | progressChanged() |
Member Function Documentation
quint64 QXmppFileDownload::bytesTotal() const
Returns the number of bytes that totally need to be transferred.
quint64 QXmppFileDownload::bytesTransferred() const
Returns the number of bytes that have been uploaded or downloaded.
void QXmppFileDownload::cancel()
Cancels the file transfer. finished() will be emitted.
[signal] void QXmppFileDownload::finished()
Emitted when the download has finished.
bool QXmppFileDownload::isFinished() const
Returns whether the file transfer is finished.
float QXmppFileDownload::progress() const
Returns the current progress between 0.0 and 1.0.
Note: Getter function for property progress.
[signal] void QXmppFileDownload::progressChanged()
Emitted when new bytes have been transferred.
Note: Notifier signal for property progress.
QXmppFileDownload::Result QXmppFileDownload::result() const
Returns the result of the download.
The download must be finished when calling this.