summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-29 10:12:03 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-10-30 12:49:14 (GMT)
commitcb62de17d1e17fd3049a6bc8155a100574a42a85 (patch)
treeddbabd81818f1dd16ba2ebc96b45267a1d2e4bf2 /Swiften/FileTransfer/FileTransfer.h
parent1d921f3d39ed134ca7f1d40011c1a07a5835b73c (diff)
downloadswift-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.h20
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
@@ -21,6 +21,12 @@
#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 {
@@ -49,11 +55,15 @@ namespace Swift {
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:
@@ -62,10 +72,12 @@ namespace Swift {
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_;
};
}