diff options
author | Tobias Markmann <tm@ayena.de> | 2015-10-29 10:12:03 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-10-30 12:49:14 (GMT) |
commit | cb62de17d1e17fd3049a6bc8155a100574a42a85 (patch) | |
tree | ddbabd81818f1dd16ba2ebc96b45267a1d2e4bf2 /Swiften/FileTransfer/FileTransfer.h | |
parent | 1d921f3d39ed134ca7f1d40011c1a07a5835b73c (diff) | |
download | swift-cb62de17d1e17fd3049a6bc8155a100574a42a85.zip swift-cb62de17d1e17fd3049a6bc8155a100574a42a85.tar.bz2 |
Add FileTransfer::getState() method
In addition, this adds the file-transfer classes to the
Doxygen documentation.
Test-Information:
Unit and integration tests still pass.
Change-Id: Ib6c16078c90ed56fae835cb2abfea8a564c3afa3
Diffstat (limited to 'Swiften/FileTransfer/FileTransfer.h')
-rw-r--r-- | Swiften/FileTransfer/FileTransfer.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Swiften/FileTransfer/FileTransfer.h b/Swiften/FileTransfer/FileTransfer.h index 01c8295..afb3f7b 100644 --- a/Swiften/FileTransfer/FileTransfer.h +++ b/Swiften/FileTransfer/FileTransfer.h @@ -18,12 +18,18 @@ #include <Swiften/Base/API.h> #include <Swiften/Base/boost_bsignals.h> #include <Swiften/FileTransfer/FileTransferError.h> namespace Swift { + /** + * The FileTransfer class provides a general interface for file-transfer + * implmenetations. Currently, only Jingle File Transfer based on XEP-0234 is + * implementated in the \ref OutgoingJingleFileTransfer and + * \ref IncomingJingleFileTransfer classes. + */ class SWIFTEN_API FileTransfer { public: struct State { enum Type { Initial, WaitingForStart, @@ -46,26 +52,32 @@ namespace Swift { FileTransfer(); virtual ~FileTransfer(); virtual void cancel() = 0; const std::string& getFileName() const { - return filename; + return filename_; } boost::uintmax_t getFileSizeInBytes() const { - return fileSizeInBytes; + return fileSizeInBytes_; + } + + const State& getState() const { + return state_; } public: boost::signal<void (size_t /* proccessedBytes */)> onProcessedBytes; boost::signal<void (const State&)> onStateChanged; boost::signal<void (boost::optional<FileTransferError>)> onFinished; protected: + void setState(const State& state); void setFileInfo(const std::string& name, boost::uintmax_t size); private: - boost::uintmax_t fileSizeInBytes; - std::string filename; + boost::uintmax_t fileSizeInBytes_; + std::string filename_; + State state_; }; } |