summaryrefslogtreecommitdiff
path: root/server/include/api_module_downloader.h
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2015-09-22 13:59:38 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2015-09-22 13:59:38 +0300
commitbd7207d8bf82c58c60399c05c29c2312a8c0f258 (patch)
treebd8674bdf03e23d6797ab9e69ece4523307607ff /server/include/api_module_downloader.h
parentacfde068698184249e50e0781a22bb38ba87cf3f (diff)
protocol:
added download state field to "download" added module defined download state names to "module_info" few fields description server: added download state to downloader api structures setting download states in outgoing downloads client-qt: basic implementation of download state in downloads table (withoud module defined states) fixed downloads table model update (working)
Diffstat (limited to 'server/include/api_module_downloader.h')
-rw-r--r--server/include/api_module_downloader.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/server/include/api_module_downloader.h b/server/include/api_module_downloader.h
index ba6cb6a..6445772 100644
--- a/server/include/api_module_downloader.h
+++ b/server/include/api_module_downloader.h
@@ -57,7 +57,8 @@ struct downloader_module_info : public module_info_base //downloader_module_info
{
std::list<module_download_menu_element_info_s> download_root_menu, download_content_menu; //downloader module can add additional menu entries for download root and download content if content management supported by protocol
std::list<module_download_ui_element_info_s> download_info_ui, download_creation_ui; //downloader module should set all data fields required for download creation, also may set data fields for info in ui in client
- std::map<std::string, std::string> get_downloads_parameters_info; //any supported parameters of get_downloads(), get_download_info() must be described here
+ std::map<std::string, std::string> get_downloads_parameters_info; //module defined parameters of get_downloads(), get_download_info() must be described here
+ std::map<int, std::string> download_state_names; //module defined download states
};
enum DOWNLOAD_CONTENT_ENTRY_TYPE_s {
@@ -75,15 +76,20 @@ struct download_content_entry_s { //here is basic content entry description, thi
std::map<std::string, std::string> info_map; //any additional info
};
+enum download_state_e {
+ stoppped = 0,
+ running = 1
+};
struct download_s {
int id = -1; //id generated via download_add or via session restore and it's unique for current session and current dowloader
- std::string name;
- int64_t size = 0, downloaded = 0, download_speed = 0; //download size and size of downloaded data, also download speed all vars in bytes
- std::map<int, std::string> info_map; //any additional info provided by downloader module can be stored here
- std::list<download_content_entry_s> content; //download content can be set for download, structure described above
- std::map<std::string, std::string> metadata; //client defined metadata map
+ std::string name;
+ int64_t size = 0, downloaded = 0, download_speed = 0; //download size and size of downloaded data, also download speed all vars in bytes
+ download_state_e state = download_state_e::stoppped; //download state can be module defined
+ std::map<int, std::string> info_map; //any additional info provided by downloader module can be stored here
+ std::list<download_content_entry_s> content; //download content can be set for download, structure described above
+ std::map<std::string, std::string> metadata; //client defined metadata map
};
class module_downloader : public module_base