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