summaryrefslogtreecommitdiff
path: root/protocol/ui.proto
blob: dc91b7c5db9a2faa10812ea5212a82faae9e20ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
	Copyright © 2015-2016 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

syntax = "proto2";

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