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