example: enhance a test script and mismatching protocol
[platform/core/uifw/aurum.git] / protocol / aurum.proto
1 syntax = "proto3";
2 package aurum;
3
4 service Bootstrap {
5    rpc sync(ReqEmpty) returns (RspEmpty) {}
6    rpc killServer(ReqEmpty) returns (RspEmpty) {}
7
8    rpc findElement(ReqFindElement) returns (RspFindElement) {}
9
10    rpc getValue(ReqGetValue) returns (RspGetValue) {}
11    rpc setValue(ReqSetValue) returns (RspSetValue) {}
12    rpc getSize(ReqGetSize) returns (RspGetSize) {}
13    rpc clear(ReqClear) returns (RspClear) {}
14    rpc getAttribute(ReqGetAttribute) returns (RspGetAttribute) {}
15
16    rpc click(ReqClick) returns (RspClick) {}
17    rpc longClick(ReqClick) returns (RspClick) {}
18    rpc flick(ReqFlick) returns (RspFlick) {}
19
20    rpc touchDown(ReqTouchDown) returns (RspTouchDown) {}
21    rpc touchMove(ReqTouchMove) returns (RspTouchMove) {}
22    rpc touchUp(ReqTouchUp) returns (RspTouchUp) {}
23
24    rpc installApp(stream ReqInstallApp) returns (RspInstallApp) {}
25    rpc removeApp(ReqRemoveApp) returns (RspRemoveApp) {}
26    rpc getAppInfo(ReqGetAppInfo) returns (RspGetAppInfo) {}
27    rpc launchApp(ReqLaunchApp) returns (RspLaunchApp) {}
28    rpc closeApp(ReqCloseApp) returns (RspCloseApp) {}
29
30    rpc getDeviceTime(ReqGetDeviceTime) returns (RspGetDeviceTime) {}
31    rpc getLocation(ReqGetLocation) returns (RspGetLocation) {}
32    rpc sendKey(ReqKey) returns (RspKey) {}
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 }
53
54 message Point {
55    int32 x = 1;
56    int32 y = 2;
57 }
58
59 message Rect {
60    int32 x = 1;
61    int32 y = 2;
62    int32 width = 3;
63    int32 height = 4;
64 }
65
66 // ------------------------------------ //
67
68 message ReqFindElement {
69    oneof _elementid {
70       string elementId = 1;
71    }
72
73    oneof _automationid {
74       string automationId = 2;
75    }
76
77    oneof _textfield {
78       string textField = 3;
79    }
80
81    oneof _widgettype {
82       string widgetType = 4;
83    }
84
85    oneof _widgetstyle {
86       string widgetStyle = 5;
87    }
88
89    oneof _ischecked {
90       bool isChecked = 6;
91    }
92
93    oneof _ischeckable {
94       bool isCheckable= 7;
95    }
96
97    oneof _isclickable {
98       bool isClickable = 8;
99    }
100
101    oneof _isenabled {
102       bool isEnabled = 9;
103    }
104
105    oneof _isfocused {
106       bool isFocused = 10;
107    }
108
109    oneof _isfocusable {
110       bool isFocusable = 11;
111    }
112
113    oneof _isscrollable {
114       bool isScrollable = 12;
115    }
116
117    oneof _isselected {
118       bool isSelected = 13;
119    }
120
121    oneof _isshowing {
122       bool isShowing = 14;
123    }
124
125    oneof _isactive {
126       bool isActive = 15;
127    }
128    oneof _mindepth {
129       int32 minDepth = 16;
130    }
131
132    oneof _maxdepth {
133       int32 maxDepth = 17;
134    }
135
136    repeated ReqFindElement children = 18;
137 }
138 message RspFindElement {
139    RspStatus status = 1;
140    repeated Element elements = 2;
141 }
142
143 // ------------------------------------ //
144
145 message ReqGetValue {
146    string elementId = 1;
147    // TODO : text, widgetstyle, widgettype, automationid
148 }
149 message RspGetValue {
150    RspStatus status = 1;
151    ParamType type  = 2;
152    oneof params {
153       string stringValue = 3;
154       int32 intValue = 4;
155       double doubleValue = 5;
156       bool boolValue = 6;
157    }
158 }
159
160 message ReqSetValue {
161    string elementId = 1;
162    ParamType type  = 2;
163    oneof params {
164       string stringValue = 3;
165       int32 intValue = 4;
166       double doubleValue = 5;
167       bool boolValue = 6;
168    }
169 }
170 message RspSetValue {
171    RspStatus status = 1;
172 }
173
174 message ReqGetSize{
175    string elementId = 1;
176 }
177 message RspGetSize{
178    RspStatus status = 1;
179    Rect size = 2;
180 }
181
182 message ReqClear{
183    string elementId = 1;
184 }
185 message RspClear{
186    RspStatus status = 1;
187 }
188
189 message ReqGetAttribute {
190    enum RequestType {
191       VISIBLE     = 0;
192       FOCUSABLE   = 1;
193       FOCUSED     = 2;
194       ENABLED     = 3;
195       CLICKABLE   = 4;
196       SCROLLABLE  = 5;
197       CHECKABLE   = 6;
198       CHECKED     = 7;
199       SELECTED    = 8;
200       SELECTABLE  = 9;
201       SHOWING     = 10;
202       ACTIVE      = 11;
203    }
204    string elementId = 1;
205    RequestType attribute = 2;
206 }
207 message RspGetAttribute {
208    RspStatus status = 1;
209    ParamType type = 2;
210    oneof params {
211       string stringValue = 3;
212       int32 intValue = 4;
213       double doubleValue = 5;
214       bool boolValue = 6;
215    }
216 }
217
218 // ------------------------------------ //
219
220 message ReqClick{
221    enum RequestType {
222       ELEMENTID = 0;
223       COORD = 1;
224       ATSPI = 2;
225    }
226    RequestType type  = 1;
227    oneof params {
228       string elementId = 2;
229       Point coordination = 3;
230    }
231 }
232 message RspClick{
233    RspStatus status = 1;
234 }
235
236 message ReqFlick{
237    Point startPoint = 1;
238    Point endPoint = 2;
239    int32 durationMs = 3;
240 }
241 message RspFlick{
242    RspStatus status = 1;
243 }
244
245 message ReqTouchDown{
246    Point coordination = 1;
247 }
248 message RspTouchDown{
249    RspStatus status = 1;
250    int32 seqId = 2;
251 }
252
253 message ReqTouchMove{
254    int32 seqId = 1;
255    Point coordination = 2;
256 }
257 message RspTouchMove{
258    RspStatus status = 1;
259 }
260
261 message ReqTouchUp{
262    int32 seqId = 1;
263    Point coordination = 2;
264 }
265 message RspTouchUp{
266    RspStatus status = 1;
267 }
268
269 // ------------------------------------ //
270
271 message ReqInstallApp{
272    bytes package = 1;
273 }
274 message RspInstallApp{
275    RspStatus status = 1;
276 }
277
278 message ReqRemoveApp{
279    string packageName = 1;
280 }
281 message RspRemoveApp{
282    RspStatus status = 1;
283 }
284
285 message ReqGetAppInfo{
286    string packageName = 1;
287 }
288 message RspGetAppInfo {
289    RspStatus status = 1;
290    bool isInstalled = 2;
291    bool isRunning = 3;
292    bool isFocused = 4;
293 }
294
295 message ReqLaunchApp{
296    string packageName = 1;
297 }
298 message RspLaunchApp{
299    RspStatus status = 1;
300 }
301
302 message ReqCloseApp{
303    string packageName = 1;
304 }
305 message RspCloseApp{
306    RspStatus status = 1;
307 }
308
309 // ------------------------------------ //
310
311 message ReqGetDeviceTime{
312    enum TimeType {
313       WALLCLOCK= 0;
314       SYSTEM = 1;
315    }
316    TimeType type = 1;
317 }
318 message RspGetDeviceTime{
319    RspStatus status = 1;
320    int64 timestampUTC = 2;
321    string localeDatetime = 3;
322 }
323
324 message ReqGetLocation{
325 }
326 message RspGetLocation{
327    RspStatus status = 1;
328    double alt = 2;
329    double lat = 3;
330 }
331
332 message ReqKey{
333    enum KeyType{
334       BACK = 0;
335       MENU = 1;
336       HOME = 2;
337       VOLUP = 3;
338       VOLDOWN = 4;
339       POWER = 5;
340       KEY = 6;
341       XF86 = 7;
342    }
343    enum KeyActionType{
344       PRESS = 0;
345       RELEASE = 1;
346       STROKE = 2;
347       LONG_STROKE = 3;
348    }
349    KeyType type = 1;
350    KeyActionType actionType = 2;
351    oneof keys {
352       uint32 keyCode = 3;
353       string XF86keyCode = 4;
354    }
355 }
356 message RspKey{
357    RspStatus status = 1;
358 }
359
360 // ------------------------------------ //
361
362 message ReqEmpty {
363 }
364 message RspEmpty {
365 }