6b66794035384cd2a00d9f972cd68a359590f029
[platform/core/uifw/aurum.git] / protocol / aurum.proto
1 syntax = "proto3";
2 package aurum;
3
4 /**
5   * @page protocol Protocol
6   * Here is a page with some descriptions about protocol explained
7   */
8 service Bootstrap {
9    rpc killServer(ReqEmpty) returns (RspEmpty) {}
10    rpc findElement(ReqFindElement) returns (RspFindElement) {}
11    rpc getValue(ReqGetValue) returns (RspGetValue) {}
12    rpc setValue(ReqSetValue) returns (RspSetValue) {}
13    rpc getSize(ReqGetSize) returns (RspGetSize) {}
14    rpc clear(ReqClear) returns (RspClear) {}
15    rpc getAttribute(ReqGetAttribute) returns (RspGetAttribute) {}
16    rpc click(ReqClick) returns (RspClick) {}
17    rpc longClick(ReqClick) returns (RspClick) {}
18    rpc flick(ReqFlick) returns (RspFlick) {}
19    rpc touchDown(ReqTouchDown) returns (RspTouchDown) {}
20    rpc touchMove(ReqTouchMove) returns (RspTouchMove) {}
21    rpc touchUp(ReqTouchUp) returns (RspTouchUp) {}
22    rpc installApp(stream ReqInstallApp) returns (RspInstallApp) {}
23    rpc removeApp(ReqRemoveApp) returns (RspRemoveApp) {}
24    rpc getAppInfo(ReqGetAppInfo) returns (RspGetAppInfo) {}
25    rpc launchApp(ReqLaunchApp) returns (RspLaunchApp) {}
26    rpc closeApp(ReqCloseApp) returns (RspCloseApp) {}
27    rpc getDeviceTime(ReqGetDeviceTime) returns (RspGetDeviceTime) {}
28    rpc getLocation(ReqGetLocation) returns (RspGetLocation) {}
29    rpc sendKey(ReqKey) returns (RspKey) {}
30    rpc takeScreenshot(ReqTakeScreenshot) returns (stream RspTakeScreenshot) {}
31    rpc dumpObjectTree(ReqDumpObjectTree) returns (RspDumpObjectTree) {}
32    rpc getScreenSize(ReqGetScreenSize) returns (RspGetScreenSize) {}
33    rpc actionAndWaitEvent(ReqActionAndWaitEvent) returns (RspActionAndWaitEvent) {}
34    rpc setFocus(ReqSetFocus) returns (RspSetFocus) {}
35 }
36
37 // ------------------------------------ //
38
39 enum RspStatus {
40    OK = 0;
41    NA = 1;
42    ERROR = 2;
43 }
44
45 enum ParamType {
46    STRING = 0;
47    INT = 1;
48    DOUBLE = 2;
49    BOOL = 3;
50 }
51
52 message Element {
53    string elementId = 1;
54    repeated Element child = 2;
55
56    Rect geometry = 3;
57    Rect window_relative_geometry = 4;
58
59    string widget_type = 5;
60    string widget_style = 6;
61
62    string text = 7;
63    string automationId = 9;
64    string package = 10;
65    string role = 11;
66
67    bool isChecked = 12;
68    bool isCheckable = 13;
69    bool isClickable = 14;
70    bool isEnabled = 15;
71    bool isFocused = 16;
72    bool isFocusable = 17;
73    bool isScrollable = 18;
74    bool isSelected = 19;
75    bool isShowing = 20;
76    bool isActive = 21;
77    bool isVisible = 22;
78    bool isSelectable = 23;
79 }
80
81 message Point {
82    int32 x = 1;
83    int32 y = 2;
84 }
85
86 message Rect {
87    int32 x = 1;
88    int32 y = 2;
89    int32 width = 3;
90    int32 height = 4;
91 }
92
93 message LaunchData {
94    string key = 1;
95    string value = 2;
96 }
97
98 // ------------------------------------ //
99
100 message ReqFindElement {
101    oneof _elementid {
102       string elementId = 1;
103    }
104
105    oneof _automationid {
106       string automationId = 2;
107    }
108
109    oneof _textfield {
110       string textField = 3;
111    }
112
113    oneof _widgettype {
114       string widgetType = 4;
115    }
116
117    oneof _widgetstyle {
118       string widgetStyle = 5;
119    }
120
121    oneof _ischecked {
122       bool isChecked = 6;
123    }
124
125    oneof _ischeckable {
126       bool isCheckable= 7;
127    }
128
129    oneof _isclickable {
130       bool isClickable = 8;
131    }
132
133    oneof _isenabled {
134       bool isEnabled = 9;
135    }
136
137    oneof _isfocused {
138       bool isFocused = 10;
139    }
140
141    oneof _isfocusable {
142       bool isFocusable = 11;
143    }
144
145    oneof _isscrollable {
146       bool isScrollable = 12;
147    }
148
149    oneof _isselected {
150       bool isSelected = 13;
151    }
152
153    oneof _isshowing {
154       bool isShowing = 14;
155    }
156
157    oneof _isactive {
158       bool isActive = 15;
159    }
160    oneof _mindepth {
161       int32 minDepth = 16;
162    }
163
164    oneof _maxdepth {
165       int32 maxDepth = 17;
166    }
167
168    oneof _packagename {
169       string packageName = 18;
170    }
171
172    oneof _textpartialmatch {
173       string textPartialMatch = 19;
174    }
175
176    repeated ReqFindElement children = 20;
177 }
178 message RspFindElement {
179    RspStatus status = 1;
180    repeated Element elements = 2;
181 }
182
183 // ------------------------------------ //
184
185 message ReqGetValue {
186    string elementId = 1;
187    // TODO : text, widgetstyle, widgettype, automationid
188 }
189 message RspGetValue {
190    RspStatus status = 1;
191    ParamType type  = 2;
192    oneof params {
193       string stringValue = 3;
194       int32 intValue = 4;
195       double doubleValue = 5;
196       bool boolValue = 6;
197    }
198 }
199
200 message ReqSetValue {
201    string elementId = 1;
202    ParamType type  = 2;
203    oneof params {
204       string stringValue = 3;
205       int32 intValue = 4;
206       double doubleValue = 5;
207       bool boolValue = 6;
208    }
209 }
210 message RspSetValue {
211    RspStatus status = 1;
212 }
213
214 message ReqGetSize{
215    enum CoordType {
216    SCREEN = 0;
217    WINDOW = 1;
218    }
219    CoordType type = 1;
220    string elementId = 2;
221 }
222
223 message RspGetSize{
224    RspStatus status = 1;
225    Rect size = 2;
226 }
227
228 message ReqClear{
229    string elementId = 1;
230 }
231 message RspClear{
232    RspStatus status = 1;
233 }
234
235 message ReqGetAttribute {
236    enum RequestType {
237       VISIBLE     = 0;
238       FOCUSABLE   = 1;
239       FOCUSED     = 2;
240       ENABLED     = 3;
241       CLICKABLE   = 4;
242       SCROLLABLE  = 5;
243       CHECKABLE   = 6;
244       CHECKED     = 7;
245       SELECTED    = 8;
246       SELECTABLE  = 9;
247       SHOWING     = 10;
248       ACTIVE      = 11;
249    }
250    string elementId = 1;
251    RequestType attribute = 2;
252 }
253 message RspGetAttribute {
254    RspStatus status = 1;
255    bool boolValue = 2;
256 }
257
258 // ------------------------------------ //
259
260 message ReqClick{
261    enum RequestType {
262       ELEMENTID = 0;
263       COORD = 1;
264       ATSPI = 2;
265    }
266    RequestType type  = 1;
267    oneof params {
268       string elementId = 2;
269       Point coordination = 3;
270    }
271 }
272 message RspClick{
273    RspStatus status = 1;
274 }
275
276 message ReqFlick{
277    Point startPoint = 1;
278    Point endPoint = 2;
279    int32 durationMs = 3;
280 }
281 message RspFlick{
282    RspStatus status = 1;
283 }
284
285 message ReqTouchDown{
286    Point coordination = 1;
287 }
288 message RspTouchDown{
289    RspStatus status = 1;
290    int32 seqId = 2;
291 }
292
293 message ReqTouchMove{
294    int32 seqId = 1;
295    Point coordination = 2;
296 }
297 message RspTouchMove{
298    RspStatus status = 1;
299 }
300
301 message ReqTouchUp{
302    int32 seqId = 1;
303    Point coordination = 2;
304 }
305 message RspTouchUp{
306    RspStatus status = 1;
307 }
308
309 // ------------------------------------ //
310
311 message ReqInstallApp{
312    bytes package = 1;
313 }
314 message RspInstallApp{
315    RspStatus status = 1;
316 }
317
318 message ReqRemoveApp{
319    string packageName = 1;
320 }
321 message RspRemoveApp{
322    RspStatus status = 1;
323 }
324
325 message ReqGetAppInfo{
326    string packageName = 1;
327 }
328 message RspGetAppInfo {
329    RspStatus status = 1;
330    bool isInstalled = 2;
331    bool isRunning = 3;
332    bool isFocused = 4;
333 }
334
335 message ReqLaunchApp{
336    string packageName = 1;
337    repeated LaunchData data = 2;
338 }
339 message RspLaunchApp{
340    RspStatus status = 1;
341 }
342
343 message ReqCloseApp{
344    string packageName = 1;
345 }
346 message RspCloseApp{
347    RspStatus status = 1;
348 }
349
350 // ------------------------------------ //
351
352 message ReqGetDeviceTime{
353    enum TimeType {
354       WALLCLOCK= 0;
355       SYSTEM = 1;
356    }
357    TimeType type = 1;
358 }
359 message RspGetDeviceTime{
360    RspStatus status = 1;
361    int64 timestampUTC = 2;
362    string localeDatetime = 3;
363 }
364
365 message ReqGetLocation{
366 }
367 message RspGetLocation{
368    RspStatus status = 1;
369    double alt = 2;
370    double lat = 3;
371 }
372
373 message ReqKey{
374    enum KeyType{
375       BACK = 0;
376       MENU = 1;
377       HOME = 2;
378       VOLUP = 3;
379       VOLDOWN = 4;
380       POWER = 5;
381       //KEY = 6;
382       XF86 = 7;
383       WHEELUP = 8;
384       WHEELDOWN = 9;
385    }
386    enum KeyActionType{
387       STROKE = 0;
388       LONG_STROKE = 1;
389       PRESS = 2;
390       RELEASE = 3;
391    }
392    KeyType type = 1;
393    KeyActionType actionType = 2;
394    //oneof keys {
395       //uint32 keyCode = 3;
396    string XF86keyCode = 4;
397    //}
398 }
399 message RspKey{
400    RspStatus status = 1;
401 }
402
403 message ReqTakeScreenshot{
404 }
405 message RspTakeScreenshot{
406    bytes image = 1;
407 }
408
409 // ------------------------------------ //
410
411 message ReqEmpty {
412 }
413 message RspEmpty {
414 }
415
416 // ------------------------------------ //
417
418 message ReqDumpObjectTree {
419    string elementId = 1;
420 }
421
422 message RspDumpObjectTree {
423    RspStatus status = 1;
424    repeated Element roots = 2;
425 }
426
427 message ReqGetScreenSize {
428 }
429
430 message RspGetScreenSize {
431    RspStatus status = 1;
432    Rect size = 2;
433 }
434
435 message ReqActionAndWaitEvent {
436    enum ActionType{
437       CLICK = 0;
438       KEY = 1;
439    }
440    enum EventType {
441       EVENT_WINDOW_ACTIVATE = 0;
442       EVENT_WINDOW_DEACTIVATE = 1;
443       EVENT_STATE_CHANGED_FOCUSED = 2;
444    }
445    ActionType type = 1;
446    oneof params {
447       string elementId = 2;
448       string XF86keyCode = 3;
449    }
450    EventType eventType = 4;
451    int32 timeoutMs = 5;
452 }
453
454 message RspActionAndWaitEvent {
455    RspStatus status = 1;
456 }
457
458 message ReqSetFocus {
459    string elementId = 1;
460 }
461
462 message RspSetFocus {
463    RspStatus status = 1;
464 }