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