From 833f1316962ada13451b6eaef542542c79b8692d Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 17 Nov 2009 12:47:55 +0000 Subject: [PATCH] Forgot to commit this (grrr. Why the hell do we dupplicate rsiface/ ?? git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1833 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/rsiface/rsfiles.h | 1 + retroshare-gui/src/rsiface/rspeers.h | 1 + retroshare-gui/src/rsiface/rstypes.h | 23 ++++++++++++++++++----- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/rsiface/rsfiles.h b/retroshare-gui/src/rsiface/rsfiles.h index aa1c2a3b6..28d0aedbe 100644 --- a/retroshare-gui/src/rsiface/rsfiles.h +++ b/retroshare-gui/src/rsiface/rsfiles.h @@ -128,6 +128,7 @@ virtual void getDwlDetails(std::list & details) = 0; virtual bool FileDownloads(std::list &hashs) = 0; virtual bool FileUploads(std::list &hashs) = 0; virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) = 0; +virtual bool FileChunksDetails(const std::string& hash,FileChunksInfo& info) = 0 ; /*** * Extra List Access diff --git a/retroshare-gui/src/rsiface/rspeers.h b/retroshare-gui/src/rsiface/rspeers.h index 2a1cd0156..2772bdc37 100644 --- a/retroshare-gui/src/rsiface/rspeers.h +++ b/retroshare-gui/src/rsiface/rspeers.h @@ -132,6 +132,7 @@ virtual bool getOthersList(std::list &ids) = 0; virtual bool isOnline(std::string id) = 0; virtual bool isFriend(std::string id) = 0; virtual std::string getPeerName(std::string id) = 0; +virtual std::string getPeerPGPName(std::string pgp_id) = 0; virtual bool getPeerDetails(std::string id, RsPeerDetails &d) = 0; /* Using PGP Ids */ diff --git a/retroshare-gui/src/rsiface/rstypes.h b/retroshare-gui/src/rsiface/rstypes.h index f12816e4a..9b8afae01 100644 --- a/retroshare-gui/src/rsiface/rstypes.h +++ b/retroshare-gui/src/rsiface/rstypes.h @@ -28,6 +28,7 @@ #include +#include #include #include #include @@ -37,11 +38,13 @@ typedef std::string RsChanId; typedef std::string RsMsgId; typedef std::string RsAuthId; -const uint32_t FT_STATE_FAILED = 0x0000; -const uint32_t FT_STATE_OKAY = 0x0001; -const uint32_t FT_STATE_WAITING = 0x0002; -const uint32_t FT_STATE_DOWNLOADING = 0x0003; -const uint32_t FT_STATE_COMPLETE = 0x0004; +#ifndef FT_STATE_FAILED + const uint32_t FT_STATE_FAILED = 0x0000; + const uint32_t FT_STATE_OKAY = 0x0001; + const uint32_t FT_STATE_WAITING = 0x0002; + const uint32_t FT_STATE_DOWNLOADING = 0x0003; + const uint32_t FT_STATE_COMPLETE = 0x0004; +#endif class TransferInfo { @@ -245,6 +248,16 @@ class FileDetail enum DwlPriority { Low = 0, Normal, High, Auto }; +class FileChunksInfo +{ + public: + enum ChunkState { CHUNK_DONE, CHUNK_ACTIVE, CHUNK_OUTSTANDING } ; + + uint64_t file_size ; // real size of the file + uint32_t chunk_size ; // size of chunks + std::vector chunks ; // dl state of chunks. Only the last chunk may have size < chunk_size +}; + /* class which encapsulates download details */ class DwlDetails { public: