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