diff options
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_; }; } |