summaryrefslogtreecommitdiff
path: root/server/include/api_module_downloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/include/api_module_downloader.h')
-rw-r--r--server/include/api_module_downloader.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/server/include/api_module_downloader.h b/server/include/api_module_downloader.h
index ae91943..d980d62 100644
--- a/server/include/api_module_downloader.h
+++ b/server/include/api_module_downloader.h
@@ -27,16 +27,16 @@
//i decided to avoid protobuf dependency in modules, so here is a copy/past of some protobuf declared structures required by downloader module
enum MODULE_UI_ELEMENT_TYPE_e {
- UI_EMPTY = 0, //helper type to set empty element
- UI_STR = 1, //ui elements containing strings
- UI_INTEGER, //numeric only ui elements (use strings instead ?)
- UI_PROGRESS_BAR, //generic progress bar
- UI_WINDOW, //ui window ...
- UI_GROUP //empty ui element to group children together in ui (tabs can be implemented using this type)
+ UI_EMPTY_ = 0, //helper type to set empty element
+ UI_STR_ = 1, //ui elements containing strings
+ UI_INTEGER_, //numeric only ui elements (use strings instead ?)
+ UI_PROGRESS_BAR_, //generic progress bar
+ UI_WINDOW_, //ui window ...
+ UI_GROUP_ //empty ui element to group children together in ui (tabs can be implemented using this type)
};
struct module_download_ui_element_info_s {
- MODULE_UI_ELEMENT_TYPE_e type = UI_EMPTY;
+ MODULE_UI_ELEMENT_TYPE_e type = UI_EMPTY_;
std::list<module_download_ui_element_info_s> children;
std::string name; // name can be non unique
int id; //internal element id used to get element value (should be unique for every loaded module)
@@ -51,7 +51,7 @@ struct module_download_menu_element_info_s {
};
-struct downloader_module_info : public module_info //downloader_module_info must be returned via module_base::get_module_info() for downloader module
+struct downloader_module_info : public module_info_base //downloader_module_info must be returned via module_base::get_module_info() for downloader module
{
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
@@ -59,15 +59,15 @@ struct downloader_module_info : public module_info //downloader_module_info must
};
enum DOWNLOAD_CONTENT_ENTRY_TYPE_s {
- DOWNLOAD_CONTENT_ENTRY_TYPE_FILE = 0,
- DOWNLOAD_CONTENT_ENTRY_TYPE_DIRECTORY = 1
+ DOWNLOAD_CONTENT_ENTRY_TYPE_FILE_ = 0,
+ DOWNLOAD_CONTENT_ENTRY_TYPE_DIRECTORY_ = 1
};
struct download_content_entry_s { //here is basic content entry description, this may be file or directory, i have set basic attributes required, but additional may be specified in info_map
std::string name; //file/dir name, required
- DOWNLOAD_CONTENT_ENTRY_TYPE_s type = DOWNLOAD_CONTENT_ENTRY_TYPE_FILE;
+ DOWNLOAD_CONTENT_ENTRY_TYPE_s type = DOWNLOAD_CONTENT_ENTRY_TYPE_FILE_;
std::list<download_content_entry_s> children;
int64_t size = 0, downloaded = 0; //file/dir size, downloaded size, optional
std::map<std::string, std::string> info_map; //any additional info
@@ -93,6 +93,8 @@ public:
virtual bool execute_action_on_download(int download_id, int action_id) = 0; //execute module defined action on download, by id received via add_download
virtual std::list<download_s> get_downloads(std::map<int, std::string> params = std::map<int, std::string>()) = 0; //this function must return list of downloads, additional options may be passed via params map
virtual download_s get_download_info(int download_id, std::map<int, std::string> params = std::map<int, std::string>()) = 0; //same as above, except this one is for single download, not a complete list
+protected:
+ downloader_module_info info;
};