A11yEvent: Rename EVENT_WINDOW_CLOSE to EVENT_WINDOW_DESTROY
[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    rpc findElements(ReqFindElements) returns (RspFindElements) {}
36    rpc getActiveAppToolkitName(ReqGetActiveAppToolkitName) returns (RspGetActiveAppToolkitName) {}
37    rpc enableScreenAnalyzer(ReqEnableScreenAnalyzer) returns (RspEnableScreenAnalyzer) {}
38    rpc getTextMinBoundingRect(ReqGetTextMinBoundingRect) returns (RspGetTextMinBoundingRect) {}
39    rpc setTimeout(ReqSetTimeout) returns (RspSetTimeout) {}
40 }
41
42 // ------------------------------------ //
43
44 enum RspStatus {
45    OK = 0;
46    NA = 1;
47    ERROR = 2;
48 }
49
50 enum ParamType {
51    STRING = 0;
52    INT = 1;
53    DOUBLE = 2;
54    BOOL = 3;
55 }
56
57 message Element {
58    string elementId = 1;
59    repeated Element child = 2;
60
61    Rect geometry = 3;
62    Rect windowRelativeGeometry = 4;
63
64    string widgetType = 5;
65    string widgetStyle = 6;
66
67    string text = 7;
68    string xpath = 8;
69    string ocrText = 9;
70    string automationId = 10;
71    string package = 11;
72    string role = 12;
73    string toolkit = 13;
74
75    bool isChecked = 14;
76    bool isCheckable = 15;
77    bool isClickable = 16;
78    bool isEnabled = 17;
79    bool isFocused = 18;
80    bool isFocusable = 19;
81    bool isScrollable = 20;
82    bool isSelected = 21;
83    bool isShowing = 22;
84    bool isActive = 23;
85    bool isVisible = 24;
86    bool isSelectable = 25;
87    bool isHighlightable = 26;
88
89    double minValue = 27;
90    double maxValue = 28;
91    double value = 29;
92    double increment = 30;
93 }
94
95 message Point {
96    int32 x = 1;
97    int32 y = 2;
98 }
99
100 message Rect {
101    int32 x = 1;
102    int32 y = 2;
103    int32 width = 3;
104    int32 height = 4;
105 }
106
107 message LaunchData {
108    string key = 1;
109    string value = 2;
110 }
111
112 // ------------------------------------ //
113
114 message ReqFindElement {
115    oneof _elementid {
116       string elementId = 1;
117    }
118
119    oneof _automationid {
120       string automationId = 2;
121    }
122
123    oneof _textfield {
124       string textField = 3;
125    }
126
127    oneof _widgettype {
128       string widgetType = 4;
129    }
130
131    oneof _widgetstyle {
132       string widgetStyle = 5;
133    }
134
135    oneof _ischecked {
136       bool isChecked = 6;
137    }
138
139    oneof _ischeckable {
140       bool isCheckable= 7;
141    }
142
143    oneof _isclickable {
144       bool isClickable = 8;
145    }
146
147    oneof _isenabled {
148       bool isEnabled = 9;
149    }
150
151    oneof _isfocused {
152       bool isFocused = 10;
153    }
154
155    oneof _isfocusable {
156       bool isFocusable = 11;
157    }
158
159    oneof _isscrollable {
160       bool isScrollable = 12;
161    }
162
163    oneof _isselected {
164       bool isSelected = 13;
165    }
166
167    oneof _isshowing {
168       bool isShowing = 14;
169    }
170
171    oneof _isactive {
172       bool isActive = 15;
173    }
174
175    oneof _mindepth {
176       int32 minDepth = 16;
177    }
178
179    oneof _maxdepth {
180       int32 maxDepth = 17;
181    }
182
183    oneof _packagename {
184       string packageName = 18;
185    }
186
187    oneof _textpartialmatch {
188       string textPartialMatch = 19;
189    }
190
191    oneof _xpath {
192       string xpath = 20;
193    }
194
195    oneof _ocrtext {
196       string ocrText = 21;
197    }
198
199    oneof _geometry {
200      Rect geometry = 22;
201    }
202    oneof _isvisible {
203       bool isVisible = 23;
204    }
205
206    oneof _isselectable {
207       bool isSelectable = 24;
208    }
209
210    oneof _ishighlightable {
211       bool isHighlightable = 25;
212    }
213
214    repeated ReqFindElement children = 26;
215 }
216
217 message RspFindElement {
218    RspStatus status = 1;
219    Element element = 2;
220 }
221
222 message ReqFindElements {
223    oneof _elementid {
224       string elementId = 1;
225    }
226
227    oneof _automationid {
228       string automationId = 2;
229    }
230
231    oneof _textfield {
232       string textField = 3;
233    }
234
235    oneof _widgettype {
236       string widgetType = 4;
237    }
238
239    oneof _widgetstyle {
240       string widgetStyle = 5;
241    }
242
243    oneof _ischecked {
244       bool isChecked = 6;
245    }
246
247    oneof _ischeckable {
248       bool isCheckable= 7;
249    }
250
251    oneof _isclickable {
252       bool isClickable = 8;
253    }
254
255    oneof _isenabled {
256       bool isEnabled = 9;
257    }
258
259    oneof _isfocused {
260       bool isFocused = 10;
261    }
262
263    oneof _isfocusable {
264       bool isFocusable = 11;
265    }
266
267    oneof _isscrollable {
268       bool isScrollable = 12;
269    }
270
271    oneof _isselected {
272       bool isSelected = 13;
273    }
274
275    oneof _isshowing {
276       bool isShowing = 14;
277    }
278
279    oneof _isactive {
280       bool isActive = 15;
281    }
282
283    oneof _mindepth {
284       int32 minDepth = 16;
285    }
286
287    oneof _maxdepth {
288       int32 maxDepth = 17;
289    }
290
291    oneof _packagename {
292       string packageName = 18;
293    }
294
295    oneof _textpartialmatch {
296       string textPartialMatch = 19;
297    }
298
299    oneof _xpath {
300       string xpath = 20;
301    }
302
303    oneof _ocrtext {
304       string ocrText = 21;
305    }
306
307    oneof _geometry {
308       Rect geometry = 22;
309    }
310
311    oneof _isvisible {
312       bool isVisible = 23;
313    }
314
315    oneof _isselectable {
316       bool isSelectable = 24;
317    }
318
319    oneof _ishighlightable {
320       bool isHighlightable = 25;
321    }
322
323    repeated ReqFindElements children = 26;
324 }
325
326 message RspFindElements {
327    RspStatus status = 1;
328    repeated Element elements = 2;
329 }
330
331 // ------------------------------------ //
332
333 message ReqGetValue {
334    string elementId = 1;
335    ParamType type  = 2;
336    // TODO : text, widgetstyle, widgettype, automationid
337 }
338 message RspGetValue {
339    RspStatus status = 1;
340    ParamType type  = 2;
341    oneof params {
342       string stringValue = 3;
343       int32 intValue = 4;
344       double doubleValue = 5;
345       bool boolValue = 6;
346    }
347 }
348
349 message ReqSetValue {
350    string elementId = 1;
351    ParamType type  = 2;
352    oneof params {
353       string stringValue = 3;
354       int32 intValue = 4;
355       double doubleValue = 5;
356       bool boolValue = 6;
357    }
358 }
359 message RspSetValue {
360    RspStatus status = 1;
361 }
362
363 message ReqGetSize{
364    enum CoordType {
365    SCREEN = 0;
366    WINDOW = 1;
367    }
368    CoordType type = 1;
369    string elementId = 2;
370 }
371
372 message RspGetSize{
373    RspStatus status = 1;
374    Rect size = 2;
375 }
376
377 message ReqClear{
378    string elementId = 1;
379 }
380 message RspClear{
381    RspStatus status = 1;
382 }
383
384 message ReqGetAttribute {
385    enum RequestType {
386       VISIBLE     = 0;
387       FOCUSABLE   = 1;
388       FOCUSED     = 2;
389       ENABLED     = 3;
390       CLICKABLE   = 4;
391       SCROLLABLE  = 5;
392       CHECKABLE   = 6;
393       CHECKED     = 7;
394       SELECTED    = 8;
395       SELECTABLE  = 9;
396       SHOWING     = 10;
397       ACTIVE      = 11;
398    }
399    string elementId = 1;
400    RequestType attribute = 2;
401 }
402 message RspGetAttribute {
403    RspStatus status = 1;
404    bool boolValue = 2;
405 }
406
407 // ------------------------------------ //
408
409 message ReqClick{
410    enum RequestType {
411       ELEMENTID = 0;
412       COORD = 1;
413       ATSPI = 2;
414    }
415    RequestType type  = 1;
416    oneof params {
417       string elementId = 2;
418       Point coordination = 3;
419    }
420 }
421 message RspClick{
422    RspStatus status = 1;
423 }
424
425 message ReqFlick{
426    Point startPoint = 1;
427    Point endPoint = 2;
428    int32 durationMs = 3;
429 }
430 message RspFlick{
431    RspStatus status = 1;
432 }
433
434 message ReqTouchDown{
435    Point coordination = 1;
436 }
437 message RspTouchDown{
438    RspStatus status = 1;
439    int32 seqId = 2;
440 }
441
442 message ReqTouchMove{
443    int32 seqId = 1;
444    Point coordination = 2;
445 }
446 message RspTouchMove{
447    RspStatus status = 1;
448 }
449
450 message ReqTouchUp{
451    int32 seqId = 1;
452    Point coordination = 2;
453 }
454 message RspTouchUp{
455    RspStatus status = 1;
456 }
457
458 // ------------------------------------ //
459
460 message ReqInstallApp{
461    bytes package = 1;
462 }
463 message RspInstallApp{
464    RspStatus status = 1;
465 }
466
467 message ReqRemoveApp{
468    string packageName = 1;
469 }
470 message RspRemoveApp{
471    RspStatus status = 1;
472 }
473
474 message ReqGetAppInfo{
475    string packageName = 1;
476 }
477 message RspGetAppInfo {
478    RspStatus status = 1;
479    bool isInstalled = 2;
480    bool isRunning = 3;
481    bool isFocused = 4;
482 }
483
484 message ReqLaunchApp{
485    string packageName = 1;
486    repeated LaunchData data = 2;
487 }
488 message RspLaunchApp{
489    RspStatus status = 1;
490 }
491
492 message ReqCloseApp{
493    string packageName = 1;
494 }
495 message RspCloseApp{
496    RspStatus status = 1;
497 }
498
499 // ------------------------------------ //
500
501 message ReqGetDeviceTime{
502    enum TimeType {
503       WALLCLOCK= 0;
504       SYSTEM = 1;
505    }
506    TimeType type = 1;
507 }
508 message RspGetDeviceTime{
509    RspStatus status = 1;
510    int64 timestampUTC = 2;
511    string localeDatetime = 3;
512 }
513
514 message ReqGetLocation{
515 }
516 message RspGetLocation{
517    RspStatus status = 1;
518    double alt = 2;
519    double lat = 3;
520 }
521
522 message ReqKey{
523    enum KeyType{
524       BACK = 0;
525       MENU = 1;
526       HOME = 2;
527       VOLUP = 3;
528       VOLDOWN = 4;
529       POWER = 5;
530       XF86 = 7;
531       WHEELUP = 8;
532       WHEELDOWN = 9;
533    }
534    enum KeyActionType{
535       STROKE = 0;
536       LONG_STROKE = 1;
537       PRESS = 2;
538       RELEASE = 3;
539       REPEAT = 4;
540    }
541    KeyType type = 1;
542    KeyActionType actionType = 2;
543    string XF86keyCode = 3;
544    int32 durationMs = 4;
545    int32 intervalMs = 5;
546 }
547 message RspKey{
548    RspStatus status = 1;
549 }
550
551 message ReqTakeScreenshot{
552 }
553 message RspTakeScreenshot{
554    bytes image = 1;
555 }
556
557 // ------------------------------------ //
558
559 message ReqEmpty {
560 }
561 message RspEmpty {
562 }
563
564 // ------------------------------------ //
565
566 message ReqDumpObjectTree {
567    string elementId = 1;
568 }
569
570 message RspDumpObjectTree {
571    RspStatus status = 1;
572    repeated Element roots = 2;
573 }
574
575 message ReqGetScreenSize {
576 }
577
578 message RspGetScreenSize {
579    RspStatus status = 1;
580    Rect size = 2;
581 }
582
583 message ReqActionAndWaitEvent {
584    enum ActionType{
585       CLICK = 0;
586       KEY = 1;
587       FOCUS = 2;
588    }
589    enum EventType {
590       EVENT_WINDOW_ACTIVATE = 0;
591       EVENT_WINDOW_DEACTIVATE = 1;
592       EVENT_STATE_CHANGED_FOCUSED = 2;
593    }
594    ActionType type = 1;
595    oneof params {
596       string elementId = 2;
597       string XF86keyCode = 3;
598    }
599    EventType eventType = 4;
600    int32 timeoutMs = 5;
601    string packageName = 6;
602 }
603
604 message RspActionAndWaitEvent {
605    RspStatus status = 1;
606 }
607
608 message ReqSetFocus {
609    string elementId = 1;
610 }
611
612 message RspSetFocus {
613    RspStatus status = 1;
614 }
615
616 message ReqGetActiveAppToolkitName {
617 }
618
619 message RspGetActiveAppToolkitName {
620    RspStatus status = 1;
621    string toolkitName = 2;
622 }
623
624 message ReqEnableScreenAnalyzer {
625    bool enable = 1;
626    string serverIp = 2;
627 }
628
629 message RspEnableScreenAnalyzer {
630    RspStatus status = 1;
631 }
632
633 message ReqGetTextMinBoundingRect {
634    string elementId = 1;
635 }
636
637 message RspGetTextMinBoundingRect {
638    RspStatus status = 1;
639    Rect size = 2;
640 }
641
642 message ReqSetTimeout {
643    int32 timeout = 1;
644 }
645
646 message RspSetTimeout {
647    RspStatus status = 1;
648 }