diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-09-29 20:36:36 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-09-29 20:36:36 +0300 |
commit | a904729ad2a51b7752d8f3f240b92c91f0fa4411 (patch) | |
tree | 582705cd1fa6725d060d85cfee10036e0d6a5c50 | |
parent | 01050fcdbf0184c9ded1eeb6021b8a6549e643aa (diff) |
protocol:
split to multiple proto files
-rw-r--r-- | client-qt/udm-client-qt/udm-client-qt.pro | 4 | ||||
-rw-r--r-- | docs/README | 2 | ||||
-rw-r--r-- | protocol/auth.proto | 38 | ||||
-rw-r--r-- | protocol/core.proto | 29 | ||||
-rw-r--r-- | protocol/download.proto | 82 | ||||
-rw-r--r-- | protocol/events.proto | 107 | ||||
-rw-r--r-- | protocol/misc.proto | 31 | ||||
-rw-r--r-- | protocol/module.proto | 47 | ||||
-rw-r--r-- | protocol/settings.proto | 43 | ||||
-rw-r--r-- | protocol/udm.proto | 311 | ||||
-rw-r--r-- | protocol/ui.proto | 74 | ||||
-rw-r--r-- | server/udm-server.project | 20 |
12 files changed, 482 insertions, 306 deletions
diff --git a/client-qt/udm-client-qt/udm-client-qt.pro b/client-qt/udm-client-qt/udm-client-qt.pro index ce04163..35cf6db 100644 --- a/client-qt/udm-client-qt/udm-client-qt.pro +++ b/client-qt/udm-client-qt/udm-client-qt.pro @@ -42,7 +42,9 @@ SOURCES += main.cpp\ ../../protocol/udm.pb.cc \ downloads_model.cpp \ filters_model.cpp \ - download_add_widget.cpp + download_add_widget.cpp \ + ../../protocol/events.pb.cc \ + ../../protocol/ui.pb.cc HEADERS += udm_main.h \ client_session.h \ diff --git a/docs/README b/docs/README index 1f77d46..954ba10 100644 --- a/docs/README +++ b/docs/README @@ -31,6 +31,6 @@ a. unfortunately currently you can't, for now you can monitor my git branch for q. i want to make development faster, can i help somehow ? a. you can help in few ways: 1. if you know c/c++, linux, any ui framework for client development (including ncurses for console ui) you can join me and directly help with development. - you can contact me on sss123next/\ at|| mail ?dot \ru or via jabber sss123next/\ at|| jabber ?dot \ru + you can contact me on sss123next/\ at|| list ?dot \ru or via jabber sss123next/\ at|| jabber ?dot \ru 2. if you have some money which you can send me, this also will help development, as freelancer i gain money by doing tasks for peoples, so if i have no need to gain money, i can spare more time to this project so this also will help much. currently i have webmoney: Z310665177715 , R498589439318 , E620435050338 and bitcoin: 1JYyRwoXmozUNRx6aDfszDRGPnTYb8R2P5 diff --git a/protocol/auth.proto b/protocol/auth.proto new file mode 100644 index 0000000..a39d2ad --- /dev/null +++ b/protocol/auth.proto @@ -0,0 +1,38 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +enum PASSWD_HASH_TYPE { + HASH_NONE = 0; + HASH_MD5 = 1; + HASH_SHA2 = 2; + HASH_SHA512 = 3; +} + +message client_auth_request { + required bytes password = 1; + optional PASSWD_HASH_TYPE hash_type = 2 [default = HASH_NONE]; +} + +message server_auth_reply { + required bool status = 1; //true == success, false == error + optional string auth_token = 2; //must be set if no error + optional string error_description = 3; //readable description must be set on error +} + diff --git a/protocol/core.proto b/protocol/core.proto new file mode 100644 index 0000000..53f887a --- /dev/null +++ b/protocol/core.proto @@ -0,0 +1,29 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +import "settings.proto"; + +message core_info //core info for client currently for editable server settings, server version and proto version only +{ + optional int32 proto_version = 1 [default = 1]; + required int32 version = 2; + repeated setting settings = 3; +} + diff --git a/protocol/download.proto b/protocol/download.proto new file mode 100644 index 0000000..d40ecb9 --- /dev/null +++ b/protocol/download.proto @@ -0,0 +1,82 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +import "misc.proto"; + +message client_download_add_request { + required string module_name = 1; + repeated int_string_pair params = 2; +} + +message client_download_start_request { + required int32 download_id = 1; +} + +message client_download_stop_request { + required int32 download_id = 1; +} + +message client_download_delete_request { + required int32 download_id = 1; + optional bool with_data = 2 [default = false]; +} + +message client_download_action_request { + required int32 download_id = 1; + required int32 action_id = 2; +} + +message client_downloads_request { + repeated int_string_pair params = 1; +} + +message client_download_request { + required int32 download_id = 1; + repeated int_string_pair params = 2; +} + + +enum DOWNLOAD_CONTENT_ENTRY_TYPE { + DOWNLOAD_CONTENT_ENTRY_TYPE_FILE = 0; + DOWNLOAD_CONTENT_ENTRY_TYPE_DIRECTORY = 1; +} + +message download_content_entry { + required string name = 1; + optional DOWNLOAD_CONTENT_ENTRY_TYPE type = 2 [default = DOWNLOAD_CONTENT_ENTRY_TYPE_FILE]; + repeated download_content_entry children = 3; + optional int64 size = 4 [default = 0]; + optional int64 downloaded = 5 [default = 0]; +} + + +message download { + required int32 id = 1; + required string name = 2; + required string module_name = 3; + optional download_content_entry content = 4; + required int64 size = 5; + required int64 downloaded = 6; + required int32 state = 7; //download state as defined in api_module_downloader.h, or module defined state +} + +message server_download_reply { + required download download = 1; +} diff --git a/protocol/events.proto b/protocol/events.proto new file mode 100644 index 0000000..f543577 --- /dev/null +++ b/protocol/events.proto @@ -0,0 +1,107 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +import "ui.proto"; + +//TODO: extended ui updates subscriptions proto part (ui data messages on timer, e.t.c.) + +// event subscription part begin + +//TODO: rework +//TODO: download state chage events + + +message subscription_download_ui_info { + optional client_download_ui_data_request download_ui_data = 1; + optional bool one_shot = 3 [default = false]; + required int64 interval = 4; +} + + +message unsubscription_download_ui_info { + required int32 id = 1; //ui element id +} + + +//subscription type +enum SUBSCRIPTION_TYPE { + S_UI_CHANGE = 0; + S_SETTING_CHANGE = 1; + S_DOWNLOAD_STATE_CHANGE = 2; + S_DOWNLOAD_ADDED = 3; + S_DOWNLOAD_DELETED = 4; +} + +//download state subscription for download state changes (can be module defined) +enum SUBSCRIPTION_DOWNLOAD_STATE { + S_D_STARTED = 0; + S_D_STOPPED = 1; +} + +message subscription_download_state_change { + repeated SUBSCRIPTION_DOWNLOAD_STATE states = 1; +} + +//information about subscription request +message client_event_subscription_request { + required SUBSCRIPTION_TYPE type = 1; //type must be set + required string module_name = 2; //module name must be set, can be "" for all installed modules supported subscription type + optional subscription_download_ui_info download_ui_info = 3; + optional subscription_download_state_change download_state_change = 4; +} + + +//unsubscript from events of specified type +//here is two variants of unsubscription + +//1. can be customized to unsubscript from few aubscriptions at once +message client_event_unsubscription_request { + required SUBSCRIPTION_TYPE type = 1; + required string module_name = 2; + optional unsubscription_download_ui_info ui_info = 3; + optional subscription_download_state_change download_state_change = 4; //reusing defined structure to avoid code duplication +} + +//2. unsubscript by id given in "server_event_subscription_reply" +message client_event_unsubscription_by_id_request { + required int32 subscription_id = 1; +} + +message server_event_subscription_reply { + required SUBSCRIPTION_TYPE type = 1; + required string module_name = 2; + optional subscription_download_ui_info ui_info = 3; + + required bool status = 1000; + optional string status_description = 1001; + optional int32 subscription_id = 1002 [default = -1]; +} + +message server_event_unsubscription_reply { + required SUBSCRIPTION_TYPE type = 1; + required string module_name = 2; + optional unsubscription_download_ui_info ui_info = 3; + + required bool status = 1000; + optional string status_description = 1001; + optional int32 subscription_id = 1002; +} + +//event subscription part end diff --git a/protocol/misc.proto b/protocol/misc.proto new file mode 100644 index 0000000..152c7f5 --- /dev/null +++ b/protocol/misc.proto @@ -0,0 +1,31 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +message int_string_pair { + required int32 id = 1; + required string value = 2; +} + +message string_pair +{ + required string name = 1; + required string value = 2; +} diff --git a/protocol/module.proto b/protocol/module.proto new file mode 100644 index 0000000..2376b7b --- /dev/null +++ b/protocol/module.proto @@ -0,0 +1,47 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +import "settings.proto"; +import "ui.proto"; +import "misc.proto"; + +enum SERVER_MODULE_TYPE { + SERVER_MODULE_DOWNLOADER = 0; + SERVER_MODULE_METADATA_STORAGE = 1; +} + + + +message module_info //general module info for client including settings, download info ui and module specific menus +{ + required SERVER_MODULE_TYPE type = 1; + required string name = 2; //unique (used as module id) + required string version = 3; + optional string description = 4 [default = "no description specified"]; + repeated setting settings = 5; + repeated module_download_ui_element_info download_info_ui = 6; //module defined download info ui, always complete here + repeated module_download_ui_element_info download_creation_ui = 7; //module defined download creation ui, always complete here + repeated module_download_menu_element_info download_menu = 8; //module defined download menu info, may not present + repeated module_download_menu_element_info download_content_menu = 9; //menu for files and folders inside download root, may not present + repeated string_pair get_downloads_parameters_info = 10; //info about additional parameters which may be passed to api_module_downloader::get_download, api_module_downloader::get_downloads + repeated int_string_pair download_state_name = 11; //module defined download states description, we have a few hardcoded states necessary for every downloader: 0 = stopped, 1 = running, ... +} + + diff --git a/protocol/settings.proto b/protocol/settings.proto new file mode 100644 index 0000000..ff0e9a3 --- /dev/null +++ b/protocol/settings.proto @@ -0,0 +1,43 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +//TODO: settings: +// children ? +// groups ? + +//settings common proto part begin + +message setting_info { + optional string default_value = 1 [default = "empty"]; + optional string minimal_value = 2 [default = "not set"]; + optional string maximal_value = 3 [default = "not set"]; + optional string description = 4; + repeated string dependencies = 5; //list containing all settings which must be turned on for this setting + repeated string blockers = 6; //list of settings which must be turned of for this setting +} + +message setting { + required string name = 1 [default = "not set"]; //should be unique for every loaded module + optional setting_info info = 2; + optional string value = 3 [default = "empty"]; +} + + +//settings common proto part end diff --git a/protocol/udm.proto b/protocol/udm.proto index d792a22..4b0fa34 100644 --- a/protocol/udm.proto +++ b/protocol/udm.proto @@ -18,312 +18,17 @@ */ - //TODO: write readable proto description -//ui common proto part begin - -enum MODULE_UI_ELEMENT_TYPE { - UI_EMPTY = 0; //helper type to set empty element - UI_STR = 1; //ui elements containing strings - UI_INTEGER = 2; //numeric only ui elements (use strings instead ?) - UI_PROGRESS_BAR = 3; //generic progress bar - UI_WINDOW = 4; //ui window ... - UI_GROUP = 5; //empty ui element to group children together in ui (tabs can be implemented using this type) -} - -message module_download_ui_element_info { - optional MODULE_UI_ELEMENT_TYPE type = 1 [default = UI_EMPTY]; - required int32 id = 2; //internal element id used to get element value (should be unique for every loaded module) - optional string name = 3 [default = "not set"]; //can be non unique - optional string description = 4; - optional bool data_required = 5 [default = false]; //ui element may required data specified (used in download creation ui) - repeated module_download_ui_element_info children = 6; -} - - -message module_download_menu_element_info { - required int32 id = 1; - required string name = 2; - optional string description = 3; - optional bool data_required = 4 [default = false]; - repeated module_download_menu_element_info children = 5; //element with children cannot be executed, it's just container -} - - -message module_download_ui_element_data { - required int32 ui_id = 1; //should be unique for every loaded module - required string data = 2; -} - -message module_download_ui_data { - repeated module_download_ui_element_data data = 1; - required string download_id = 2; -} - -message server_download_ui_data_reply { - required string module_name = 1; - required module_download_ui_data data = 2; -} - -message client_download_ui_data_request { - required string module_name = 1; - required string download_id = 2; - repeated int32 ui_id = 3; //should be unique for for every loaded module -} - - -//ui common proto part end - -//TODO: extended ui updates subscriptions proto part (ui data messages on timer, e.t.c.) - -// event subscription part begin - -//TODO: rework -//TODO: download state chage events - - -message subscription_download_ui_info { - optional client_download_ui_data_request download_ui_data = 1; - optional bool one_shot = 3 [default = false]; - required int64 interval = 4; -} - - -message unsubscription_download_ui_info { - required int32 id = 1; //ui element id -} - - -//subscription type -enum SUBSCRIPTION_TYPE { - S_UI_CHANGE = 0; - S_SETTING_CHANGE = 1; - S_DOWNLOAD_STATE_CHANGE = 2; - S_DOWNLOAD_ADDED = 3; - S_DOWNLOAD_DELETED = 4; -} - -//download state subscription for download state changes (can be module defined) -enum SUBSCRIPTION_DOWNLOAD_STATE { - S_D_STARTED = 0; - S_D_STOPPED = 1; -} - -message subscription_download_state_change { - repeated SUBSCRIPTION_DOWNLOAD_STATE states = 1; -} - -//information about subscription request -message client_event_subscription_request { - required SUBSCRIPTION_TYPE type = 1; //type must be set - required string module_name = 2; //module name must be set, can be "" for all installed modules supported subscription type - optional subscription_download_ui_info download_ui_info = 3; - optional subscription_download_state_change download_state_change = 4; -} - - -//unsubscript from events of specified type -//here is two variants of unsubscription - -//1. can be customized to unsubscript from few aubscriptions at once -message client_event_unsubscription_request { - required SUBSCRIPTION_TYPE type = 1; - required string module_name = 2; - optional unsubscription_download_ui_info ui_info = 3; - optional subscription_download_state_change download_state_change = 4; //reusing defined structure to avoid code duplication -} - -//2. unsubscript by id given in "server_event_subscription_reply" -message client_event_unsubscription_by_id_request { - required int32 subscription_id = 1; -} - -message server_event_subscription_reply { - required SUBSCRIPTION_TYPE type = 1; - required string module_name = 2; - optional subscription_download_ui_info ui_info = 3; - - required bool status = 1000; - optional string status_description = 1001; - optional int32 subscription_id = 1002 [default = -1]; -} - -message server_event_unsubscription_reply { - required SUBSCRIPTION_TYPE type = 1; - required string module_name = 2; - optional unsubscription_download_ui_info ui_info = 3; - - required bool status = 1000; - optional string status_description = 1001; - optional int32 subscription_id = 1002; -} - -//event subscription part end - - - -//dowloads proto part begin - -message client_download_add_request { - required string module_name = 1; - repeated int_string_pair params = 2; -} - -message client_download_start_request { - required int32 download_id = 1; -} - -message client_download_stop_request { - required int32 download_id = 1; -} - -message client_download_delete_request { - required int32 download_id = 1; - optional bool with_data = 2 [default = false]; -} - -message client_download_action_request { - required int32 download_id = 1; - required int32 action_id = 2; -} - -message int_string_pair { - required int32 id = 1; - required string value = 2; -} -message client_downloads_request { - repeated int_string_pair params = 1; -} - -message client_download_request { - required int32 download_id = 1; - repeated int_string_pair params = 2; -} - - -enum DOWNLOAD_CONTENT_ENTRY_TYPE { - DOWNLOAD_CONTENT_ENTRY_TYPE_FILE = 0; - DOWNLOAD_CONTENT_ENTRY_TYPE_DIRECTORY = 1; -} - -message download_content_entry { - required string name = 1; - optional DOWNLOAD_CONTENT_ENTRY_TYPE type = 2 [default = DOWNLOAD_CONTENT_ENTRY_TYPE_FILE]; - repeated download_content_entry children = 3; - optional int64 size = 4 [default = 0]; - optional int64 downloaded = 5 [default = 0]; -} - - -message download { - required int32 id = 1; - required string name = 2; - required string module_name = 3; - optional download_content_entry content = 4; - required int64 size = 5; - required int64 downloaded = 6; - required int32 state = 7; //download state as defined in api_module_downloader.h, or module defined state -} - -message server_download_reply { - required download download = 1; -} - - -//downloads proto part end - - - -//TODO: settings: -// children ? -// groups ? - -//settings common proto part begin - -message setting_info { - optional string default_value = 1 [default = "empty"]; - optional string minimal_value = 2 [default = "not set"]; - optional string maximal_value = 3 [default = "not set"]; - optional string description = 4; - repeated string dependencies = 5; //list containing all settings which must be turned on for this setting - repeated string blockers = 6; //list of settings which must be turned of for this setting -} - -message setting { - required string name = 1 [default = "not set"]; //should be unique for every loaded module - optional setting_info info = 2; - optional string value = 3 [default = "empty"]; -} - - -//settings common proto part end - - -//module related messages begin - -enum SERVER_MODULE_TYPE { - SERVER_MODULE_DOWNLOADER = 0; - SERVER_MODULE_METADATA_STORAGE = 1; -} - -message string_pair -{ - required string name = 1; - required string value = 2; -} - - -message module_info //general module info for client including settings, download info ui and module specific menus -{ - required SERVER_MODULE_TYPE type = 1; - required string name = 2; //unique (used as module id) - required string version = 3; - optional string description = 4 [default = "no description specified"]; - repeated setting settings = 5; - repeated module_download_ui_element_info download_info_ui = 6; //module defined download info ui, always complete here - repeated module_download_ui_element_info download_creation_ui = 7; //module defined download creation ui, always complete here - repeated module_download_menu_element_info download_menu = 8; //module defined download menu info, may not present - repeated module_download_menu_element_info download_content_menu = 9; //menu for files and folders inside download root, may not present - repeated string_pair get_downloads_parameters_info = 10; //info about additional parameters which may be passed to api_module_downloader::get_download, api_module_downloader::get_downloads - repeated int_string_pair download_state_name = 11; //module defined download states description, we have a few hardcoded states necessary for every downloader: 0 = stopped, 1 = running, ... -} - -//module related messages end - -//core related messages begin - -message core_info //core info for client currently for editable server settings, server version and proto version only -{ - optional int32 proto_version = 1 [default = 1]; - required int32 version = 2; - repeated setting settings = 3; -} - -//core related messages end - - -//auth proto part begin - -enum PASSWD_HASH_TYPE { - HASH_NONE = 0; - HASH_MD5 = 1; - HASH_SHA2 = 2; - HASH_SHA512 = 3; -} - -message client_auth_request { - required bytes password = 1; - optional PASSWD_HASH_TYPE hash_type = 2 [default = HASH_NONE]; -} - -message server_auth_reply { - required bool status = 1; //true == success, false == error - optional string auth_token = 2; //must be set if no error - optional string error_description = 3; //readable description must be set on error -} +import "ui.proto"; +import "events.proto"; +import "download.proto"; +import "misc.proto"; +import "settings.proto"; +import "module.proto"; +import "auth.proto"; +import "core.proto"; -//auth proto part end //TODO: large datatransfer proto part // it should be in separate connection diff --git a/protocol/ui.proto b/protocol/ui.proto new file mode 100644 index 0000000..387e17c --- /dev/null +++ b/protocol/ui.proto @@ -0,0 +1,74 @@ +/* + Copyright © 2015 Gluzskiy Alexandr (sss) + + This file is part of Unknown Download Manager (UDM). + + UDM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + UDM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with UDM. If not, see <http://www.gnu.org/licenses/>. + +*/ + +//ui common proto part begin + +enum MODULE_UI_ELEMENT_TYPE { + UI_EMPTY = 0; //helper type to set empty element + UI_STR = 1; //ui elements containing strings + UI_INTEGER = 2; //numeric only ui elements (use strings instead ?) + UI_PROGRESS_BAR = 3; //generic progress bar + UI_WINDOW = 4; //ui window ... + UI_GROUP = 5; //empty ui element to group children together in ui (tabs can be implemented using this type) +} + +message module_download_ui_element_info { + optional MODULE_UI_ELEMENT_TYPE type = 1 [default = UI_EMPTY]; + required int32 id = 2; //internal element id used to get element value (should be unique for every loaded module) + optional string name = 3 [default = "not set"]; //can be non unique + optional string description = 4; + optional bool data_required = 5 [default = false]; //ui element may required data specified (used in download creation ui) + repeated module_download_ui_element_info children = 6; +} + + +message module_download_menu_element_info { + required int32 id = 1; + required string name = 2; + optional string description = 3; + optional bool data_required = 4 [default = false]; + repeated module_download_menu_element_info children = 5; //element with children cannot be executed, it's just container +} + + +message module_download_ui_element_data { + required int32 ui_id = 1; //should be unique for every loaded module + required string data = 2; +} + +message module_download_ui_data { + repeated module_download_ui_element_data data = 1; + required string download_id = 2; +} + +message server_download_ui_data_reply { + required string module_name = 1; + required module_download_ui_data data = 2; +} + +message client_download_ui_data_request { + required string module_name = 1; + required string download_id = 2; + repeated int32 ui_id = 3; //should be unique for for every loaded module +} + + +//ui common proto part end + diff --git a/server/udm-server.project b/server/udm-server.project index 39a75cc..0c59c5a 100644 --- a/server/udm-server.project +++ b/server/udm-server.project @@ -20,7 +20,6 @@ <Description/> <Dependencies/> <VirtualDirectory Name="src"> - <File Name="../protocol/udm.pb.cc"/> <File Name="src/api_core.cpp"/> <File Name="src/client.cpp"/> <File Name="src/main.cpp"/> @@ -48,6 +47,17 @@ <File Name="include/utilities.h"/> </VirtualDirectory> <Dependencies Name="Debug"/> + <VirtualDirectory Name="protocol"> + <File Name="../protocol/events.pb.cc"/> + <File Name="../protocol/udm.pb.cc"/> + <File Name="../protocol/ui.pb.cc"/> + <File Name="../protocol/download.pb.cc"/> + <File Name="../protocol/misc.pb.cc"/> + <File Name="../protocol/auth.pb.cc"/> + <File Name="../protocol/core.pb.cc"/> + <File Name="../protocol/module.pb.cc"/> + <File Name="../protocol/settings.pb.cc"/> + </VirtualDirectory> <Settings Type="Executable"> <GlobalSettings> <Compiler Options="" C_Options="" Assembler=""> @@ -90,6 +100,14 @@ </Debugger> <PreBuild> <Command Enabled="yes">[ -d ../protocol ] || mkdir ../protocol</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/misc.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/ui.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/events.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/download.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/settings.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/module.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/auth.proto</Command> + <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/core.proto</Command> <Command Enabled="yes">protoc --cpp_out=../protocol --proto_path=../protocol ../protocol/udm.proto</Command> </PreBuild> <PostBuild/> |