Introduce to a project aurum
[platform/core/uifw/aurum.git] / protocol / aurum.proto
1 syntax = "proto3";
2 package aurum;
3
4 service Bootstrap {
5    rpc sync(ReqEmpty) returns (RspEmpty) {}
6    rpc killServer(ReqEmpty) returns (RspEmpty) {}
7
8    rpc findElement(ReqFindElement) returns (RspFindElement) {}
9
10    rpc getValue(ReqGetValue) returns (RspGetValue) {}
11    rpc setValue(ReqSetValue) returns (RspSetValue) {}
12    rpc getSize(ReqGetSize) returns (RspGetSize) {}
13    rpc clear(ReqClear) returns (RspClear) {}
14    rpc getAttribute(ReqGetAttribute) returns (RspGetAttribute) {}
15
16    rpc click(ReqClick) returns (RspClick) {}
17    rpc longClick(ReqClick) returns (RspClick) {}
18    rpc flick(ReqFlick) returns (RspFlick) {}
19
20    rpc touchDown(ReqTouchDown) returns (RspTouchDown) {}
21    rpc touchMove(ReqTouchMove) returns (RspTouchMove) {}
22    rpc touchUp(ReqTouchUp) returns (RspTouchUp) {}
23
24    rpc installApp(stream ReqInstallApp) returns (RspInstallApp) {}
25    rpc removeApp(ReqRemoveApp) returns (RspRemoveApp) {}
26    rpc getAppInfo(ReqGetAppInfo) returns (RspGetAppInfo) {}
27    rpc launchApp(ReqLaunchApp) returns (RspLaunchApp) {}
28    rpc closeApp(ReqCloseApp) returns (RspCloseApp) {}
29
30    rpc getDeviceTime(ReqGetDeviceTime) returns (RspGetDeviceTime) {}
31    rpc getLocation(ReqGetLocation) returns (RspGetLocation) {}
32    rpc sendKey(ReqKey) returns (RspKey) {}
33 }
34
35 // ------------------------------------ //
36
37 enum RspStatus {
38    OK = 0;
39    NA = 1;
40    ERROR = 2;
41 }
42
43 enum ParamType {
44    STRING = 0;
45    INT = 1;
46    DOUBLE = 2;
47    BOOL = 3;
48 }
49
50 message Element {
51    string elementId = 1;
52 }
53
54 message Point {
55    int32 x = 1;
56    int32 y = 2;
57 }
58
59 message Rect {
60    int32 x = 1;
61    int32 y = 2;
62    int32 width = 3;
63    int32 height = 4;
64 }
65
66 // ------------------------------------ //
67
68 message ReqFindElement {
69    enum RequestType {
70       AUTOMATIONID = 0;
71       TEXT = 1;
72       TYPE = 2;
73       STYLE = 3;
74    }
75    string elementId = 1;
76    RequestType strategy = 2;
77    oneof params {
78          string automationId = 3;
79          string textField = 4;
80          string widgetType = 5;
81          string widgetStyle = 6;
82    }
83 }
84 message RspFindElement {
85    RspStatus status = 1;
86    repeated Element elements = 2;
87 }
88
89 // ------------------------------------ //
90
91 message ReqGetValue {
92    string elementId = 1;
93 }
94 message RspGetValue {
95    RspStatus status = 1;
96    ParamType type  = 2;
97    oneof params {
98       string stringValue = 3;
99       int32 intValue = 4;
100       double doubleValue = 5;
101       double boolValue = 6;
102    }
103 }
104
105 message ReqSetValue {
106    string elementId = 1;
107    ParamType type  = 2;
108    oneof params {
109       string stringValue = 3;
110       int32 intValue = 4;
111       double doubleValue = 5;
112       double boolValue = 6;
113    }
114 }
115 message RspSetValue {
116    RspStatus status = 1;
117 }
118
119 message ReqGetSize{
120    string elementId = 1;
121 }
122 message RspGetSize{
123    RspStatus status = 1;
124    Rect size = 2;
125 }
126
127 message ReqClear{
128    string elementId = 1;
129 }
130 message RspClear{
131    RspStatus status = 1;
132 }
133
134 message ReqGetAttribute {
135    enum RequestType {
136       VISIBLE     = 0;
137       FOCUSABLE   = 1;
138       FOCUSED     = 2;
139       ENABLED     = 3;
140       CLICKABLE   = 4;
141       SCROLLABLE  = 5;
142       CHECKABLE   = 6;
143       CHECKED     = 7;
144       SELECTED    = 8;
145       SELECTABLE  = 9;
146    }
147    string elementId = 1;
148    RequestType attribute = 2;
149 }
150 message RspGetAttribute {
151    RspStatus status = 1;
152    ParamType type = 2;
153    oneof params {
154       string stringValue = 3;
155       int32 intValue = 4;
156       double doubleValue = 5;
157       double boolValue = 6;
158    }
159 }
160
161 // ------------------------------------ //
162
163 message ReqClick{
164    enum RequestType {
165       ELEMENTID = 0;
166       COORD = 1;
167       ATSPI = 2;
168    }
169    RequestType type  = 1;
170    oneof params {
171       string elementId = 2;
172       Point coordination = 3;
173    }
174 }
175 message RspClick{
176    RspStatus status = 1;
177 }
178
179 message ReqFlick{
180    Point startPoint = 1;
181    Point endPoint = 2;
182    int32 durationMs = 3;
183 }
184 message RspFlick{
185    RspStatus status = 1;
186 }
187
188 message ReqTouchDown{
189    Point coordination = 1;
190 }
191 message RspTouchDown{
192    RspStatus status = 1;
193    int32 seqId = 2;
194 }
195
196 message ReqTouchMove{
197    int32 seqId = 1;
198    Point coordination = 2;
199 }
200 message RspTouchMove{
201    RspStatus status = 1;
202 }
203
204 message ReqTouchUp{
205    int32 seqId = 1;
206    Point coordination = 2;
207 }
208 message RspTouchUp{
209    RspStatus status = 1;
210 }
211
212 // ------------------------------------ //
213
214 message ReqInstallApp{
215    bytes package = 1;
216 }
217 message RspInstallApp{
218    RspStatus status = 1;
219 }
220
221 message ReqRemoveApp{
222    string packageName = 1;
223 }
224 message RspRemoveApp{
225    RspStatus status = 1;
226 }
227
228 message ReqGetAppInfo{
229    string packageName = 1;
230 }
231 message RspGetAppInfo {
232    RspStatus status = 1;
233    bool isInstalled = 2;
234    bool isRunning = 3;
235    bool isFocused = 4;
236 }
237
238 message ReqLaunchApp{
239    string packageName = 1;
240 }
241 message RspLaunchApp{
242    RspStatus status = 1;
243 }
244
245 message ReqCloseApp{
246    string packageName = 1;
247 }
248 message RspCloseApp{
249    RspStatus status = 1;
250 }
251
252 // ------------------------------------ //
253
254 message ReqGetDeviceTime{
255 }
256 message RspGetDeviceTime{
257    RspStatus status = 1;
258 }
259
260 message ReqGetLocation{
261 }
262 message RspGetLocation{
263    RspStatus status = 1;
264    string alt = 2;
265    string lat = 3;
266 }
267
268 message ReqKey{
269    enum KeyType{
270       BACK = 0;
271       MENU = 1;
272       HOME = 2;
273       VOLUP = 3;
274       VOLDOWN = 4;
275       POWER = 5;
276       KEY = 6;
277       XF86 = 7;
278    }
279    enum KeyActionType{
280       PRESS = 0;
281       RELEASE = 1;
282       STROKE = 2;
283       LONG_STROKE = 3;
284    }
285    KeyType type = 1;
286    KeyActionType actionType = 2;
287    oneof keys {
288       uint32 keyCode = 3;
289       string XF86keyCode = 4;
290    }
291 }
292 message RspKey{
293    RspStatus status = 1;
294 }
295
296 // ------------------------------------ //
297
298 message ReqEmpty {
299 }
300 message RspEmpty {
301 }