• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HI_GV_WIDGET_H
17 #define HI_GV_WIDGET_H
18 
19 #include "hi_gv_conf.h"
20 #include "hi_go.h"
21 #include "hi_gv_errno.h"
22 #include "hi_gv_resm.h"
23 
24 #ifdef HIGV_USE_WIDGET_BUTTON
25 #include "hi_gv_button.h"
26 #endif
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* Widget type */
33 
34 typedef enum HI_WIDGET {
35     /*  window */
36     HIGV_WIDGET_WINDOW = 0,
37     /*  containder  */
38     HIGV_WIDGET_CONTAINER = 1,
39     /*  button */
40     HIGV_WIDGET_BUTTON = 2,
41     /*  label */
42     HIGV_WIDGET_LABEL = 3,
43     /*  image */
44     HIGV_WIDGET_IMAGE = 4,
45     /*  extend image */
46     HIGV_WIDGET_IMAGEEX = 5,
47     /*  grid */
48     HIGV_WIDGET_GRID = 6,
49     /*  groupbox */
50     HIGV_WIDGET_GROUPBOX = 7,
51     /*  scrollbar */
52     HIGV_WIDGET_SCROLLBAR = 8,
53     /*  edit */
54     HIGV_WIDGET_EDIT = 9,
55     /*  spin box **/
56     HIGV_WIDGET_SPINBOX = 10,
57     /*  progressbar */
58     HIGV_WIDGET_PROGRESS = 11,
59     /*  scrollbox */
60     HIGV_WIDGET_SCROLLBOX = 12,
61     /*  scrolltext */
62     HIGV_WIDGET_SCROLLTEXT = 13,
63     /*  image cipher */
64     HIGV_WIDGET_IMAGECIPHER = 14,
65     /*  clock */
66     HIGV_WIDGET_CLOCK = 15,
67     /*  listbox */
68     HIGV_WIDGET_LISTBOX = 16,
69     /*  timetrack */
70     HIGV_WIDGET_TIMETRACK = 17,
71     /*  scrollgrid */
72     HIGV_WIDGET_SCROLLGRID = 18,
73     /*  trackbar */
74     HIGV_WIDGET_TRACKBAR = 19,
75     /*  ipedit */
76     HIGV_WIDGET_IPEDIT = 20,
77     /*  calendar */
78     HIGV_WIDGET_CALENDAR = 21,
79     /*  videoshelter */
80     HIGV_WIDGET_VIDEOSHELTER = 22,
81     /*  movemonito */
82     HIGV_WIDGET_MOVEMONITOR = 23,
83     /*  combobox */
84     HIGV_WIDGET_COMBOBOX = 24,
85     /*  pop window of combobox */
86     HIGV_WIDGET_CPOPBOX = 25,
87     /*  input method window  */
88     HIGV_WIDGET_IMEWINDOW = 26,
89     /*  timebar  */
90     HIGV_WIDGET_TIMEBAR = 27,
91     /*  dialog box  */
92     HIGV_WIDGET_MSGBOX = 28,
93     /*  multi edit */
94     HIGV_WIDGET_MULTIEDIT = 29,
95     /*  scroll view  */
96     HIGV_WIDGET_SCROLLVIEW = 30,
97     /*  content box  */
98     HIGV_WIDGET_CONTENTBOX = 31,
99     /*  slide unlock  */
100     HIGV_WIDGET_SLIDEUNLOCK = 32,
101     /*  wheel view */
102     HIGV_WIDGET_WHEELVIEW = 33,
103     /*  image view */
104     HIGV_WIDGET_IMAGEVIEW = 34,
105     /*  image view */
106     HIGV_WIDGET_SCALEVIEW = 35,
107    /*  charts view */
108     HIGV_WIDGET_CHARTS  = 36,
109     HIGV_WIDGET_BUTT
110 } HIGV_WIDGET_E;
111 
112 typedef struct {
113     HI_U32 style;
114     const HI_RECT *rect;
115     HIGV_HANDLE parentHandle;
116     HI_U32 level;
117 } WidgetBasicParam;
118 
119 /* The sequence of user defined widget */
120 #define HIGV_EXTWIDGET_START HIGV_WIDGET_BUTT
121 /* The callback of user defined widget */
122 typedef HI_VOID *(*HIGV_WIDGET_INIT_FUNC)(const WidgetBasicParam *widgetBasicParam);
123 
124 typedef HI_S32 (*HIGV_WIDGET_HDL2ADDR_PFN)(HI_U32 u32Idx, HI_U8 u8MemType, HI_PARAM *pAddr);
125 
126 typedef struct hiHIGV_WIDGET_TYPEINFO_S {
127     /* Widget name */
128     HI_CHAR Name[33];  // 33 represents this array can save 33 HI_CHAR type data
129     /* The sequence of user defined widget */
130     HI_U32 TypeID;
131     HIGV_WIDGET_INIT_FUNC WidgetInitFunc;
132     /* The callback of user defined widget */
133     /* The size of widget that pasered by parser mode, it is should seted
134     if the widget is defined in xml, otherwise it can be set 0 */
135 
136     HI_U32 WidgetPaserSize;
137 } HIGV_WIDGET_TYPEINFO_S;
138 
139 /* coordinate type  */
140 typedef HI_S32 HIGV_CORD;
141 
142 /* The button of mouse which pressed */
143 typedef enum {
144     HIGV_MOUSEBUTTON_NONE = 0x00,
145     HIGV_MOUSEBUTTON_L = 0x01,
146     HIGV_MOUSEBUTTON_M = 0x02,
147     HIGV_MOUSEBUTTON_R = 0x04,
148     HIGV_MOUSEBUTTON_BUTT
149 } HIGV_MOUSEBUTTON_E;
150 
151 /* The status of timer running  */
152 typedef enum {
153     HIGV_TIMERMSG_STATUS_UNEXIST = 0,
154     /* unexit status */
155     HIGV_TIMERMSG_STATUS_IDLE,
156     /* idle status */
157     HIGV_TIMERMSG_STATUS_FRYING,
158     /* frying status */
159     HIGV_TIMERMSG_STATUS_RESET,
160     /* reset status */
161     HIGV_TIMERMSG_STATUS_BUTT
162 } HIGV_TIMERMSG_STATUS_E;
163 
164 /* The language direction of widget  */
165 typedef enum {
166     HIGV_TEXTDIR_NEUTRAL = 0,
167     HIGV_TEXTDIR_LTR,
168     HIGV_TEXTDIR_RTL,
169     HIGV_TEXTDIR_BUTT
170 } HIGV_TEXTDIR_E;
171 
172 /* Set widget focus switch mode  */
173 typedef enum {
174     HIGV_FOCUS_SWITCH_AUTO = 0,
175     /* auto */
176     HIGV_FOCUS_SWITCH_MANUAL,
177     /* manual */
178     HIGV_FOCUS_SWITCH_BUTT
179 } HIGV_FOCUS_SWITCH_E;
180 
181 /* Focus switch state at manual focus mode  */
182 typedef enum {
183     HIGV_FOCUS_STATE_SWITCH = 0,
184     /* Focus switch state */
185     HIGV_FOCUS_STATE_EDIT,
186     /* Widget can operate */
187     HIGV_FOCUS_STATE_BUTT
188 } HIGV_FOCUS_STATE_E;
189 
190 /* The type of widget paint  */
191 typedef enum {
192     HIGV_PAINT_TYPE_HIDE = 0,
193     /* hide widget  */
194     HIGV_PAINT_TYPE_SHOW,
195     /* show widget  */
196     HIGV_PAINT_TYPE_BUTT
197 } HIGV_PAINT_TYPE_E;
198 
199 /* Window style   */
200 /* Default style, it is used 2bytes  */
201 #define HIGV_STYLE_DEFAULT 0x00
202 /* Don't draw the background  */
203 #define HIGV_STYLE_TRANSPARENT 0x02
204 /* Couldn't get foucssuch Label  */
205 #define HIGV_STYLE_NOFOCUS 0x04
206 /* Release the resource when hidden  */
207 #define HIGV_STYLE_HIDE_UNLODRES 0x10
208 /* It is indicated that the widget can change language, it can trigger the language msg to user */
209 
210 #define HIGV_STYLE_LANCHNG 0x20
211 /* Modal window */
212 
213 #define HIGV_STYLE_MODAL 0x40
214 /* Foce draw background of parent */
215 
216 #define HIGV_STYLE_FORCE_PAINT_PARENT 0x80
217 /* if container is seted this flag, it's child also highlighted,
218 and lost the focus, the child will not be highlight */
219 /*
220  * ʧȥʱʧȥ״̬ */
221 #define HIGV_STYLE_HILIGHT_CHILD 0x100
222 
223 /* The extend style of widget which only support 8 */
224 
225 #define HIGV_STYLE_DEFINE(WidgetType, style) ((((HI_U32)(WidgetType)) << (24)) | ((1) << ((16) +   \
226     (HI_U32)((style) & (0x7)))))
227 
228 /* Common style mask of widget */
229 
230 #define HIGV_STYLE_MASK 0xffffff
231 
232 /* Skin index, it is only used to skin */
233 
234 /* No focus */
235 #define HIGV_SKIN_NORMAL 0x01
236 /* Disable state */
237 
238 #define HIGV_SKIN_DISABLE 0x02
239 /* Highlight state */
240 
241 #define HIGV_SKIN_HIGHLIGHT 0x03
242 /* Active state */
243 
244 #define HIGV_SKIN_ACITVE 0x04
245 /* Mouse down state */
246 
247 #define HIGV_SKIN_MOUSEDOWN 0x05
248 /* Checked state */
249 
250 #define HIGV_SKIN_BUTTON_CHECKED_NORMAL 0x06
251 /* Disable at check state */
252 
253 #define HIGV_SKIN_BUTTON_CHECKED_DISABLE 0x07
254 /* Highlight at check state */
255 
256 #define HIGV_SKIN_BUTTON_CHECKED_HIGHLIGHT 0x08
257 /* Focus at check state */
258 
259 #define HIGV_SKIN_BUTTON_CHECKED_ACITVE 0x09
260 /* Pressed at check state */
261 
262 #define HIGV_SKIN_BUTTON_CHECKED_MOUSEDOWN 0xa
263 
264 /* Window manager handle */
265 
266 #define HIGV_WND_MANAGER_HANDLE ((HI_U32)(-1))
267 
268 /* It is used to HIGV_MSG_STATE_CHANGE message */
269 
270 typedef enum {
271     /* enable */
272     HIGV_STATENAME_ENABLE,
273     /* highlight */
274     HIGV_STATENAME_HIGHLIGHT,
275     HIGV_STATENAME_BUTT
276 } HIGV_STATENAME_E;
277 
278 /* The order of the message which user register to higv */
279 typedef enum {
280     /* It is first order to call user function */
281 
282     HIGV_PROCORDER_BEFORE,
283     /* It is after order to call user function */
284 
285     HIGV_PROCORDER_AFTER,
286     HIGV_PROCORDER_BUTT
287 } HIGV_PROCORDER_E;
288 
289 #define HIGV_RECT_TOU32PARAM(rc, param1, param2)                                  \
290     do {                                                                          \
291         param1 = ((((HI_U32)(rc).x & 0xFFFF) << 16) | ((HI_U32)(rc).y & 0xFFFF)); \
292         param2 = ((((HI_U32)(rc).w & 0xFFFF) << 16) | ((HI_U32)(rc).h & 0xFFFF)); \
293     } while (0)
294 
295 #define HIGV_U32PARAM_TORECT(param1, param2, rc)      \
296     do {                                              \
297         (rc).x = (HI_S32)(((param1) >> 16) & 0xFFFF); \
298         (rc).y = (HI_S32)((param1)&0xFFFF);           \
299         (rc).w = (HI_S32)(((param2) >> 16) & 0xFFFF); \
300         (rc).h = (HI_S32)((param2)&0xFFFF);           \
301     } while (0)
302 
303 /* Message of window */
304 /* Paint message [wparam, lparam] = [PaintRect<x,y>, PaintRect<w,h>] =
305 [((((rc).x & 0xFFFF)<<16) | ((rc).y & 0xFFFF)),
306  *  ((((rc).w & 0xFFFF)<<16) | ((rc).h & 0xFFFF))] */
307 /*
308 [((((rc).x & 0xFFFF)<<16) | ((rc).y & 0xFFFF)), ((((rc).w & 0xFFFF)<<16) | ((rc).h & 0xFFFF))] */
309 #define HIGV_MSG_PAINT 0x03
310 /* Key down message [wparam, lparam]= [HIGV_KEYCODE_E, nil] */
311 
312 #define HIGV_MSG_KEYDOWN 0x04
313 /* Key up message [wparam, lparam]  = [HIGV_KEYCODE_E, nil]* */
314 
315 #define HIGV_MSG_KEYUP 0x05
316 /* Get focus message [wparam, lparam]  = [nil, nil] */
317 
318 #define HIGV_MSG_GET_FOCUS 0x06
319 /* Lost focus message [wparam, lparam]  = [nil, nil] */
320 /* **/
321 #define HIGV_MSG_LOST_FOCUS 0x07
322 /* Show message [wparam, lparam]  = [nil, nil] */
323 
324 #define HIGV_MSG_SHOW 0x08
325 /* Hide message [wparam, lparam]  = [nil, nil] */
326 
327 #define HIGV_MSG_HIDE 0x09
328 /* Data change message [wparam, lparam]  = [nil, nil] */
329 
330 #define HIGV_MSG_DATA_CHANGE 0x10
331 /* Timer message [wparam, lparam]  = [TimerID, nil]  */
332 
333 #define HIGV_MSG_TIMER 0x11
334 /* button down message  [wparam, lparam]  = [nil, nil] */
335 /*
336                                                            */
337 #define HIGV_MSG_CLICK 0x12
338 /* State change message */
339 
340 #define HIGV_MSG_STATE_CHANGE 0x13
341 /* Item selected message */
342 
343 #define HIGV_MSG_ITEM_SELECT 0x14
344 /* Scroll text message */
345 #define HIGV_MSG_ST_UPDATE 0x15
346 /* Update time message [wparam, lparam]  = [nil, nil] */
347 
348 #define HIGV_MSG_CLOCK_UPDATE 0x16
349 /* Input over for imagecipher [wparam, lparam]  = [nil, nil] */
350 
351 #define HIGV_MSG_IC_INPUTEND 0x17
352 /* Input over for edit [wparam, lparam]  = [nil, nil] */
353 
354 #define HIGV_MSG_EDIT_INPUTEND 0x18
355 /* Scroll over in one cycle for scrolltext  [wparam, lparam]  = [nil, nil] */
356 
357 #define HIGV_MSG_ST_SCROLLONETIME 0x19
358 /* The value changed when opreate */
359 /*
360     [wparam,  lparam]  = [(SlidePos << 16) | ContentLength, ((touchMove << 16)| handle)] */
361 #define HIGV_MSG_SCROLLBAR_CHANGE 0x1a
362 /* State change of checkbox or radio button [wparam, lparam]  = [HIGV_BUTTON_STATUS_E, nil] */
363 /*
364  * [wparam, lparam]  =[HIGV_BUTTON_STATUS_E,nil] */
365 #define HIGV_MSG_BUTTON_STATUSCHANGE 0x1b
366 /* Cell is selected [m_SelCell.Item,m_SelCell.Col] */
367 
368 #define HIGV_MSG_LISTBOX_CELLSEL 0x1c
369 /* Item is selected [wparam, lparam]  =  [Item, nil] */
370 
371 #define HIGV_MSG_COMBOBOX_ITEMSEL 0x1d
372 /* Container widget change active child [wparam, lparam] = [Last active child handle, new active child handle] */
373 
374 #define HIGV_MSG_CONTAINER_CHANGE_FOCUSE 0x1e
375 
376 /* The event of scrollgrid */
377 /* The cell selected event  [wparam, lparam]  = [SelCell.Item, SelCell.Col] */
378 
379 #define HIGV_MSG_SCROLLGRID_CELL_COLSEL 0x23
380 /* The focus move the top margin will genterate the event [wparam, lparam]  = [SelCell, nil] */
381 
382 #define HIGV_MSG_SCROLLGRID_REACH_TOP 0x24
383 /* The focus move the bottom margin will genterate the event  [wparam, lparam]  = [SelCell, nil] */
384 
385 #define HIGV_MSG_SCROLLGRID_REACH_BTM 0x25
386 /* The focus move the left margin will genterate the event  [wparam, lparam]  = [SelCell, nil]  */
387 
388 #define HIGV_MSG_SCROLLGRID_REACH_LEFT 0x26
389 /* The focus move the right margin will genterate the event  [wparam, lparam]  = [SelCell, nil] */
390 
391 #define HIGV_MSG_SCROLLGRID_REACH_RIGHT 0x27
392 /* The update event of item for scrollgrid [wparam, lparam]  = [nil, nil] */
393 
394 #define HIGV_MSG_SCROLLGRID_ITEM_UPDATE 0x28
395 /* The uddate event of scrollgrid [wparam, lparam]  = [nil, nil] */
396 
397 #define HIGV_MSG_SCROLLGRID_FOCUS_UPDATE 0x29
398 /* The begin event of decode image for scrollgrid [wparam, lparam]  = [nil, nil] */
399 
400 #define HIGV_MSG_SCROLLGRID_DECIMG_BEGIN 0x2a
401 /* The finish event of decode image for scrollgrid [wparam, lparam]  = [nil, nil] */
402 
403 #define HIGV_MSG_SCROLLGRID_DECIMG_FINISH 0x2b
404 /* The finish event of fling for scrollgrid [wparam, lparam]  = [nil, nil] */
405 
406 #define HIGV_MSG_SCROLLGRID_FLING_FINISH 0x2c
407 
408 /* The event of timetrack */
409 /* The drag event of mouse for timetrack [wparam, lparam]  = [m_CurGraduation, nil]  */
410 
411 #define HIGV_MSG_TIMETRACK_DRAGBEGIN 0x30
412 /* The position change of timetrack  [wparam, lparam]  = [m_CurGraduation, nil]   */
413 
414 #define HIGV_MSG_TIMETRACK_CHANGE 0x31
415 /* The end event when mouse move through timetrack [wparam, lparam]  = [m_CurGraduation, nil] */
416 
417 #define HIGV_MSG_TIMETRACK_DRAGEND 0x32
418 /* The graduation value change event when drag trackbar [wparam, lparam]  = [m_CurValue, nil]   */
419 
420 #define HIGV_MSG_VALUEONCHANGE 0x33
421 
422 /* The update event of scrollbox  [wparam, lparam]  = [nil, nil] */
423 
424 #define HIGV_MSG_SCROLLBOX_UPDATE 0x34
425 
426 /* The switch event of input method[wparam, lparam]  = [nil, nil] */
427 
428 #define HIGV_MSG_IME_SWITCH 0x35
429 /* The show event of input method [wparam, lparam]  = [nil, nil] */
430 
431 #define HIGV_MSG_IME_SHOW 0x36
432 /* *The hide event of input method [wparam, lparam]  = [nil, nil] */
433 /* **/
434 #define HIGV_MSG_IME_HIDE 0x37
435 
436 /* The event of timebar */
437 
438 /* The drag start event of mouse for timebar  [wparam, lparam]  = [nil, nil] */
439 
440 #define HIGV_MSG_TIMEBAR_DRAGBEGIN 0x40
441 /* The change event of timebar  [wparam, lparam]  = [GraduationIndex, nil] */
442 
443 #define HIGV_MSG_TIMEBAR_CHANGE 0x41
444 /* The drag end event of mouse for timebar  [wparam, lparam]  = [nil, nil] */
445 
446 #define HIGV_MSG_TIMEBAR_DRAGEND 0x42
447 
448 /* Change the focus of clock [wparam, lparam]  =[m_FocusSeg, 0] */
449 
450 #define HIGV_MSG_CLOCK_FOCUS_MOVE 0x50
451 /* Set clock. [wparam, lparam]  =  [nil, nil] */
452 
453 #define HIGV_MSG_CLOCK_TIME_ADJUST 0x51
454 /* Set widget state. [wparam, lparam]  =  [nil, nil] */
455 
456 #define HIGV_MSG_MANUAL_FOCUS_STATE_CHANGE 0x52
457 
458 /* The event of message box */
459 /* The timeout event of MessageBox show  [wparam, lparam]  = [ButtonID, show times] */
460 
461 #define HIGV_MSG_MSGBOX_TIMEOUT 0x60
462 /* The message box click button message [wparam, lparam]  = [ButtonID, nil] */
463 
464 #define HIGV_MSG_MSGBOX_SELECT 0x61
465 /* The message box hide message. attention:Don't use it */
466 
467 #define HIGV_MSG_MSGBOX_HIDE 0x62
468 
469 /* The event of multi edit */
470 
471 /* Input over for multi edit [wparam, lparam]  = [nil, nil] */
472 
473 #define HIGV_MSG_MULTIEDIT_INPUT 0x70
474 /* Begin select string from text [wparam, lparam]  = [nil, nil] */
475 
476 #define HIGV_MSG_MULTIEDIT_SELECT_OUT 0x71
477 /* End select string from text [wparam, lparam]  = [nil, nil] */
478 
479 #define HIGV_MSG_MULTIEDIT_SELECT_END 0x72
480 /* Move reach side [wparam, lparam]  = [HigvMultiEditSlide, nil] */
481 
482 #define HIGV_MSG_MULTIEDIT_REACH_SIDE 0x73
483 /* Draw cursor [wparam, lparam]  = [nil, nil] */
484 
485 #define HIGV_MSG_MULTIEDIT_DRAW_CURSOR 0x74
486 
487 /* The event of scroll view */
488 /* Scroll view scroll event [wparam, lparam] =
489 [(((content rect).x & 0xFFFF)<<16) | (y & 0xFFFF), ((w & 0xFFFF)<<16) |
490  *  (h & 0xFFFF)] */
491 /*
492 [(((content rect).x & 0xFFFF)<<16) | (y & 0xFFFF), ((w & 0xFFFF)<<16) | (h & 0xFFFF)] */
493 #define HIGV_MSG_SCROLLVIEW_SCROLL 0x80
494 /* The event of finish fling event */
495 /* finish fling event [wparam, lparam] = [(((content rect).x & 0xFFFF)<<16) | (y & 0xFFFF), ((w & 0xFFFF)<<16) | (h &
496  * 0xFFFF)] */
497 /*
498 [(((content rect).x & 0xFFFF)<<16) | (y & 0xFFFF), ((w & 0xFFFF)<<16) | (h & 0xFFFF)] */
499 #define HIGV_MSG_SCROLLVIEW_FINISHFLING 0x81
500 
501 /* Language change event */
502 
503 #define HIGV_MSG_LAN_CHANGE 0x100
504 /* Exit edit status at auto manual focus mode [wparam, lparam]  = [nil, nil] */
505 
506 #define HIGV_MSG_FOCUS_EDIT_EXIT 0x101
507 /* Mouse in event [wparam, lparam]  = [nil, nil] */
508 
509 #define HIGV_MSG_MOUSEIN 0x200
510 /* The first event of mouse */
511 #define HIGV_MSG_FIRSTMOUSEMSG HIGV_MSG_MOUSEIN
512 /* Mouse down event [wparam, lparam]  = [HIGV_MOUSEBUTTON_L, (ScreenX << 16)|(ScreenY & 0xffff)] */
513 
514 #define HIGV_MSG_MOUSEDOWN 0x201
515 /* Mouse out event [wparam, lparam]  = [nil, nil] */
516 
517 #define HIGV_MSG_MOUSEOUT 0x202
518 /* Mouse up event [wparam, lparam]  = [HigvMouseState, (ScreenX << 16)|(ScreenY & 0xffff)] */
519 
520 #define HIGV_MSG_MOUSEUP 0x203
521 /* Mouse move event [wparam, lparam]  = [nil, (ScreenX << 16)|(ScreenY & 0xffff)] */
522 
523 #define HIGV_MSG_MOUSEMOVE 0x204
524 /* Mouse wheel event [wparam, lparam]  = [nil, nil] */
525 
526 #define HIGV_MSG_MOUSEWHEEL 0x205
527 /* The press down of left mouse [wparam, lparam]  = [nil, nil] */
528 /* ¼ [wparam, lparam]  = [nil, nil] */
529 #define HIGV_MSG_MOUSELONGDOWN 0x206
530 /* The double click of  mouse [wparam, lparam]  = [nil, nil] */
531 /* ˫¼[wparam, lparam]  = [nil, nil] */
532 #define HIGV_MSG_MOUSEDBCLICK 0x207
533 /* The last message of  mouse */
534 
535 #define HIGV_MSG_LASTMOUSEMSG HIGV_MSG_MOUSEDBCLICK
536 /* The virtual mouse up event [wparam, lparam]  = [nil, nil] */
537 
538 #define HIGV_MSG_VIRTUAL_MOUSEUP 0x208
539 /* The virtual mouse down event [wparam, lparam]  = [nil, nil] */
540 
541 #define HIGV_MSG_VIRTUAL_MOUSEDOWN 0x209
542 
543 /* Refresh the window to screen [wparam, lparam]  =
544 [(((rc).x & 0xFFFF)<<16) | ((rc).y & 0xFFFF), (((rc).w & 0xFFFF)<<16)
545  * | ((rc).h & 0xFFFF)] */
546 /*
547 [(((rc).x & 0xFFFF)<<16) | ((rc).y & 0xFFFF), (((rc).w & 0xFFFF)<<16) | ((rc).h & 0xFFFF)] */
548 #define HIGV_MSG_REFRESH_WINDOW 0x500
549 /* After refresh the window to screen [wparam, lparam]  = [nil, nil] */
550 
551 #define HIGV_MSG_AFTERREFRESH 0x501
552 /* The data change message for adm */
553 
554 #define HIGV_MSG_ADM_DATACHANGE 0x502
555 /* Force to update the window to the screen */
556 /*
557 *  0xFFFF)<<16) | ((rc).y & 0xFFFF), (((rc).w & 0xFFFF)<<16) | ((rc).h &
558 * 0xFFFF)] */
559 #define HIGV_MSG_FORCE_REFRESH_WINDOW 0x503
560 
561 /* Refresh message which is used to avoid loss combined message [wparam, lparam]  = [nil, nil] */
562 
563 #define HIGV_MSG_FAKE_REFRESH_WINDOW 0x504
564 
565 /* Force to update the window state */
566 
567 #define HIGV_MSG_WINDOW_CHANGE_STATE 0x505
568 
569 /* Business event [wparam, lparam]  = [nil, nil] */
570 
571 #define HIGV_MSG_EVENT 0x900
572 /* The base value of user defined [wparam, lparam]  = [nil, nil] */
573 
574 #define HIGV_MSG_USER 0x1000
575 /* touch screen event [wparam, lparam]  = [nil, nil] */
576 
577 #define HIGV_MSG_TOUCH 0x2001
578 /* tap gesture event[wparam, lparam]  = [nil, nil] */
579 
580 #define HIGV_MSG_GESTURE_TAP 0x2002
581 /* long press gesture event [wparam, lparam]  = [nil, nil] */
582 
583 #define HIGV_MSG_GESTURE_LONGTAP 0x2003
584 /* fling gesture event [wparam, lparam]  = [nil, nil] */
585 /*
586  */
587 #define HIGV_MSG_GESTURE_FLING 0x2004
588 /* scroll gesture event [wparam, lparam]  = [nil, nil] */
589 /* **/
590 #define HIGV_MSG_GESTURE_SCROLL 0x2005
591 /* pinch gesture event [wparam, lparam]  = [nil, nil] */
592 
593 #define HIGV_MSG_GESTURE_PINCH 0x2006
594 /* unlock done event [wparam, lparam]  = [nil, nil] */
595 
596 #define HIGV_MSG_UNLOCK 0x2007
597 /* finish seek trackbar [wparam, lparam]  = [m_CurValue, nil]   */
598 
599 #define HIGV_MSG_FINISHSEEK 0x2008
600 /* move event [wparam, lparam]  = [nil, nil] */
601 
602 #define HIGV_MSG_MOVE 0x2009
603 /* kick back event [wparam, lparam]  = [nil, nil] */
604 
605 #define HIGV_MSG_KICKBACK 0x2010
606 /* clock position event [wparam, lparam]  = [nil, nil] */
607 
608 #define HIGV_MSG_POSITION 0x2011
609 /* Touch in event [wparam, lparam]  = [nil, nil] */
610 
611 #define HIGV_MSG_TOUCHIN 0x2012
612 /* Touch out event [wparam, lparam]  = [nil, nil] */
613 
614 #define HIGV_MSG_TOUCHOUT 0x2013
615 /* wheelview position event [wparam, lparam]  = [nil, nil] */
616 
617 #define HIGV_MSG_WHEELVIEW_ITEM 0x3001
618 /* imageview git finish repeat event [wparam, lparam]  = [nil, nil] */
619 
620 #define HIGV_MSG_IMAGEEX_ENDOF_REPEAT 0x3101
621 
622 /* animation start event [wparam, lparam]   = [nil, nil] */
623 
624 #define HIGV_MSG_ANIM_START 0x5001
625 /* animation running event [wparam, lparam] = [nil, nil] */
626 
627 #define HIGV_MSG_ANIM_UPDATE 0x5002
628 /* animation stop event [wparam, lparam]    = [nil, nil] */
629 
630 #define HIGV_MSG_ANIM_STOP 0x5003
631 
632 /* animation start event [wparam, lparam]   = [nil, nil] */
633 
634 #define HIGV_MSG_REBOUND_START 0x5101
635 /* animation running event [wparam, lparam] = [nil, nil] */
636 
637 #define HIGV_MSG_REBOUND_UPDATE 0x5102
638 /* animation stop event [wparam, lparam]    = [nil, nil] */
639 
640 #define HIGV_MSG_REBOUND_STOP 0x5103
641 /* item scale event [wparam, lparam] = [nil, nil] */
642 
643 #define HIGV_MSG_SCALE 0x5104
644 /* selector focus position report event [wparam, lparam] = [nil, nil] */
645 
646 #define HIGV_MSG_SCALEVIEW_ITEM 0x3002
647 /* TAP reported event [wparam, lparam] = [nil, nil] */
648 
649 #define HIGV_MSG_SCALEVIEW_TAPLISTENER 0x3003
650 
651 /* it is defined the message whether process continue */
652 
653 /* The message will go on */
654 #define HIGV_PROC_GOON 100
655 /* Stop process message, it is not continue */
656 
657 #define HIGV_PROC_STOP 200
658 
659 /* Get the x coordinate of mouse which is relative the x coordinate of widget */
660 
661 #define HIGV_GET_MOUSE_X(lParam) ((HIGV_CORD)((HI_S16)(((HI_U32)(lParam)) >> (16))))
662 /* Get the y coordinate of mouse which is relative the y coordinate of widget */
663 
664 #define HIGV_GET_MOUSE_Y(lParam) ((HIGV_CORD)((HI_S16)(((HI_U32)(lParam)) & (0xFFFF))))
665 /* Get step of mouse moving */
666 #define HIGV_GET_MOUSE_STEP(wParam) ((HI_S32)((HI_S16)(((HI_U32)(wParam)) >> (16))))
667 /* Get state of mouse button */
668 #define HIGV_GET_MOUSE_BUTTON(wParam) ((HI_U32)((HI_S16)(((HI_U32)(wParam)) & (0xFFFF))))
669 
670 /* Mouse wheel direction */
671 typedef enum hiHIGV_WHEEL_DIRECTION {
672     HIGV_WHEEL_DIRECTION_DOWN = 0,
673     HIGV_WHEEL_DIRECTION_UP = 1,
674     HIGV_WHEEL_DIRECTION_BUTT
675 } HIGV_WHEEL_DIRECTION;
676 
677 /* Get step and diection of mouse wheel */
678 
679 #define HIGV_GET_MOUSE_WHEEL(wParam, Step, Direction) \
680     do {                                              \
681         Step = HIGV_GET_MOUSE_STEP(wParam);           \
682         if ((Step) >> 7) {                              \
683             Step = 0xFF - (Step) + 1;                   \
684             Direction = HIGV_WHEEL_DIRECTION_UP;      \
685         } else {                                      \
686             Direction = HIGV_WHEEL_DIRECTION_DOWN;    \
687         }                                             \
688     } while (0)
689 
690 /* Message callback */
691 typedef HI_S32 (*HIGV_MSG_PROC)(HIGV_HANDLE widgetHandle, HI_PARAM wParam, HI_PARAM lParam);
692 
693 /* The attribute of widget to use create  */
694 typedef struct hiHIGV_WCREATE_S {
695     HI_U32 type; /* Control class  */
696     HI_RECT rect;                    /* The position and size of widget */
697     HIGV_HANDLE hParent;             /* Parent widget handle */
698     HI_U32 style;                    /* Widget style */
699     HI_U32 level;
700     /* Window level, it is only effect to window, the range is [0,15]
701     */
702     HI_VOID *pPrivate; /*  The private data of widget */
703 } HIGV_WCREATE_S;
704 
705 /* The private data of widnow  */
706 typedef struct hiHIGV_WINCREATE_S {
707     HIGV_HANDLE hLayer;    /* Layer of window */
708     HIGO_PF_E PixelFormat; /* Pixel format of window */
709     HI_BOOL bVideoHole;    /* For video hole */
710 } HIGV_WINCREATE_S;
711 
712 /* The build tree of widget */
713 typedef struct hiHIGV_WIDGETNODE_S {
714     struct hiHIGV_WIDGETNODE_S *pChildHead;  /* first child node */
715     struct hiHIGV_WIDGETNODE_S *pNextSibing; /* sibling node */
716     HI_VOID *pWidgetInfo;
717     /* The build parameter when create the widget
718     */
719     HI_BOOL bCreateHide;   /* whether hide the widget when create */
720     HI_VOID *pPrivateData; /* User private data */
721 } HIGV_WIDGETNODE_S;
722 
723 /* The type of text alignment */
724 /* Horizontal left of text alignment */
725 #define HIGV_ALIGN_LEFT LAYOUT_LEFT
726 /* Horizontal right of text alignment */
727 #define HIGV_ALIGN_RIGHT LAYOUT_RIGHT
728 /* Horizontal center of text alignment */
729 #define HIGV_ALIGN_HCENTER LAYOUT_HCENTER
730 /* Top style of text alignment */
731 #define HIGV_ALIGN_TOP LAYOUT_TOP
732 /* Vertical bottom style  of text alignment */
733 #define HIGV_ALIGN_BOTTOM LAYOUT_BOTTOM
734 /* Vertical center style  of text alignment */
735 #define HIGV_ALIGN_VCENTER LAYOUT_VCENTER
736 /* Wap style  of text alignment */
737 #define HIGV_ALIGN_WRAP LAYOUT_WRAP
738 
739 /* Ellipsis style of text alignment  */
740 #define HIGV_ALIGN_WORDELLIPSIS LAYOUT_WORDELLIPSIS
741 /* Force to left of Horizontal  */
742 #define HIGV_ALIGN_FORCE_LEFT LAYOUT_FORCE_LEFT
743 /* Force to right of Horizontal  */
744 #define HIGV_ALIGN_FORCE_RIGHT LAYOUT_FORCE_RIGHT
745 /* Support the type of input method  */
746 /* Support all input method by default */
747 #define HIGV_IMETYPE_ALLTYPE 0
748 /* Lowcase english input method  */
749 #define HIGV_IMETYPE_ENGLISH (1 << 0)
750 /* Caps english input method  */
751 #define HIGV_IMETYPE_CAPENGLISH (1 << 1)
752 /* Number input method  */
753 #define HIGV_IMETYPE_NUMBER (1 << 2)
754 /* Pingyin input method  */
755 #define HIGV_IMETYPE_PINYIN (1 << 3)
756 /* Symbol method   */
757 #define HIGV_IMETYPE_SYMBOL (1 << 4)
758 /* Standard input method A  */
759 #define HIGV_IMETYPE_STANDARD_A (1 << 5)
760 /* Standard input method B */
761 #define HIGV_IMETYPE_STANDARD_B (1 << 6)
762 
763 /*
764 * brief Active widget.
765 * param[in] widgetHandle Widget handle.
766 * retval ::HI_SUCCESS
767 * retval ::HI_ERR_COMM_LOST
768 * retval ::HI_ERR_COMM_INVAL
769 * retval ::HI_FAILURE
770 */
771 extern HI_S32 HI_GV_Widget_Active(HIGV_HANDLE widgetHandle);
772 
773 /*
774 * brief Create widget.
775 * param[in] creatInfo The information of widget.
776 * param[out] widgetHandle   Widget handle.
777 * retval ::HI_SUCCESS
778 * retval ::HI_ERR_COMM_LOST
779 * retval ::HI_ERR_COMM_INVAL
780 * retval ::HI_ERR_COMM_NORES
781 * see :HI_GV_Widget_Destroy
782 */
783 HI_S32 HI_GV_Widget_Create(const HIGV_WCREATE_S *creatInfo, HIGV_HANDLE *widgetHandle);
784 
785 /*
786 * brief Destroy widget.
787 * param[in] widgetHandle Widget handle.
788 * retval ::HI_SUCCESS
789 * retval ::HI_ERR_COMM_LOST
790 * retval ::HI_ERR_COMM_NORES
791 * see:HI_GV_Widget_Create
792 */
793 HI_S32 HI_GV_Widget_Destroy(HIGV_HANDLE widgetHandle);
794 
795 /*
796 * brief enable widget, but it is not effect to window.
797 * param[in] widgetHandle Widget handle.
798 * param[in] enable  enable flag.
799 * retval ::HI_SUCCESS
800 * retval ::HI_ERR_COMM_LOST
801 * retval ::HI_ERR_COMM_NOOP Unsupported operation, such as the operation is to window.
802 * ָ֧ôڣԴڽиò \retval ::HI_ERR_COMM_PAERM Not allow, such as,
803 * it is not allowed when the parent
804 * window is disabled.
805 *
806 */
807 HI_S32 HI_GV_Widget_Enable(HIGV_HANDLE widgetHandle, HI_BOOL enable);
808 
809 /*
810 * brief Get the active child widget.
811 * attention :You can get the active window if parentHandle = HIGV_WND_MANAGER_HANDLE.
812 *
813 * param[in] parentHandle  Parent widget handle.
814 * param[out] activeWidgetHandle The pointer of active childe widget.
815 * retval ::HI_SUCCESS
816 * retval ::HI_ERR_COMM_LOST Invalid parater, such as the parent
817 * doesn't has active child or widget is invalid.
818 * ؼЧ߸ûл \retval ::HI_ERR_COMM_PAERM No support operation, parent window is not a
819 * container.
820 * see:HI_GV_Widget_SetActiveWidget
821 */
822 HI_S32 HI_GV_Widget_GetActiveWidget(HIGV_HANDLE parentHandle, HIGV_HANDLE *activeWidgetHandle);
823 
824 /*
825 * brief Get font.
826 * param[in] widgetHandle Widget handle.
827 * param[out] fontHandle Pointer of font.
828 * retval ::HI_SUCCESS
829 * retval ::HI_ERR_COMM_LOST
830 * retval ::HI_ERR_COMM_INVAL
831 */
832 HI_S32 HI_GV_Widget_GetFont(HIGV_HANDLE widgetHandle, HIGV_HANDLE *fontHandle);
833 
834 /*
835 * brief Get parent widget, if it is window ,it will return NULL.
836 * param[in] widgetHandle Widget handle.
837 * param[out] parentHandle Pointer of parent widget handle.
838 * retval ::HI_SUCCESS
839 * retval ::HI_ERR_COMM_LOST
840 * retval ::HI_ERR_COMM_INVAL
841 * retval ::HI_FAILURE Failure, such as, no parent.
842 */
843 HI_S32 HI_GV_Widget_GetParent(HIGV_HANDLE widgetHandle, HIGV_HANDLE *parentHandle);
844 
845 /*
846 * brief Get sibings of widget, it is mainly used to change focus.
847 * param[in] widgetHandle Widget handle.
848 * param[out] leftSibingHandle  Left sibing widget.
849 * param[out] rightSibingHandle Right sibing widget.
850 * param[out] upSibingHandle    Up sibing widget.
851 * param[out] downSibingHandle  Down sibing widget.
852 * retval ::HI_SUCCESS
853 * retval ::HI_ERR_COMM_LOST
854 * retval ::HI_ERR_COMM_INVAL
855 */
856 HI_S32 HI_GV_Widget_GetSiblings(HIGV_HANDLE widgetHandle, HIGV_HANDLE *leftSibingHandle,
857     HIGV_HANDLE *rightSibingHandle, HIGV_HANDLE *upSibingHandle, HIGV_HANDLE *downSibingHandle);
858 
859 /*
860 * brief Hide widget.
861 * param[in] widgetHandle Widget handle.
862 * retval ::HI_SUCCESS
863 * retval ::HI_ERR_COMM_LOST
864 * retval ::HI_ERR_COMM_INVAL
865 */
866 HI_S32 HI_GV_Widget_Hide(HIGV_HANDLE widgetHandle);
867 
868 /*
869 * brief Get the widget active state.
870 * param[in] Widget handle.
871 * retval ::HI_TRUE  The widget is active.
872 * retval ::HI_FALSE The widget is inactive.
873 */
874 HI_BOOL HI_GV_Widget_IsActive(HIGV_HANDLE widgetHandle);
875 
876 /*
877 * brief Get the widget enable state.
878 * param[in] widgetHandle Widget handle.
879 * retval ::HI_TRUE  enable state.
880 * retval ::HI_FALSE Disable state.
881 */
882 HI_BOOL HI_GV_Widget_IsEnable(HIGV_HANDLE widgetHandle);
883 
884 /*
885 * brief The widget whether show.
886 * param[in] widgetHandle  Widget handle.
887 * retval ::HI_TRUE  Show state.
888 * retval ::HI_FALSE  Hide state.
889 */
890 HI_BOOL HI_GV_Widget_IsShow(HIGV_HANDLE widgetHandle);
891 
892 /*
893 * brief The widget whether show.
894 * param[in] widgetHandle  Widget handle.
895 * retval ::HI_TRUE  Refreshed state.
896 * retval ::HI_FALSE  Other state.
897 */
898 HI_BOOL HI_GV_Widget_IsRefresh(HIGV_HANDLE widgetHandle);
899 
900 /*
901 * brief Get widget surface.
902 * param[in] widgetHandle Widget handle.
903 * param[out] surfaceHandle Surface pointer
904 * retval ::HI_SUCCESS
905 * retval ::HI_ERR_COMM_LOST
906 */
907 HI_S32 HI_GV_Widget_GetSurface(HIGV_HANDLE widgetHandle, HIGV_HANDLE *surfaceHandle);
908 
909 /*
910 * brief Paint the widget, it will emit a asynchronism message.
911 * param[in] widgetHandle Widget handle.
912 * param[in] rect The area of update .
913 * retval ::HI_SUCCESS
914 * retval ::HI_ERR_COMM_LOST
915 * retval ::HI_FAILURE Failure such as the widget is not show.
916 */
917 HI_S32 HI_GV_Widget_Paint(HIGV_HANDLE widgetHandle, const HI_RECT *rect);
918 
919 /*
920 * brief Set font.
921 * param[in] widgetHandle Widget handle.
922 * param[in] fontHandle The font of widget.
923 * retval ::HI_SUCCESS
924 * retval ::HI_ERR_COMM_LOST
925 */
926 HI_S32 HI_GV_Widget_SetFont(HIGV_HANDLE widgetHandle, HIGV_HANDLE fontHandle);
927 
928 /*
929 * brief Register message processor.
930 * param[in] widgetHandle   Widget handle.
931 * param[in] msg        Message.
932 * param[in] customProc Message processor.
933 * param[in] procOrder  Message prioprity.
934 * retval ::HI_SUCCESS
935 * retval ::HI_ERR_COMM_LOST
936 * retval ::HI_ERR_COMM_NORES
937 */
938 HI_S32 HI_GV_Widget_SetMsgProc(HIGV_HANDLE widgetHandle, HI_U32 msg, HIGV_MSG_PROC customProc,
939     HIGV_PROCORDER_E procOrder);
940 
941 /*
942 * brief Set skin of widget.
943 * param[in] widgetHandle   Widget handle.
944 * param[in] skinIndexHandle Skin index.
945 * param[in] skinHandle     Skin handle.
946 * retval ::HI_SUCCESS
947 * retval ::HI_ERR_COMM_INVAL
948 * retval ::HI_ERR_COMM_LOST
949 * retval ::HI_ERR_COMM_NORES
950 * see:HI_GV_Widget_SetCharset
951 */
952 HI_S32 HI_GV_Widget_SetSkin(HIGV_HANDLE widgetHandle, HI_U32 skinIndexHandle, HI_RESID skinHandle);
953 
954 /*
955 * brief Set siblings of widget.
956 * param[in] widgetHandle  Widget handle.
957 * param[in] leftHandle      Left siblings widet.
958 * param[in] rightHandle    Right siblings widet.
959 * param[in] upHandle        Up siblings widet.
960 * param[in] downHandle    Down siblings widet.
961 * retval ::HI_SUCCESS
962 * retval ::HI_ERR_COMM_INVAL
963 * retval ::HI_ERR_COMM_LOST
964 * see : HI_GV_Widget_GetSiblings
965 */
966 HI_S32 HI_GV_Widget_SetSiblings(HIGV_HANDLE widgetHandle, HIGV_HANDLE leftHandle, HIGV_HANDLE rightHandle,
967     HIGV_HANDLE upHandle, HIGV_HANDLE downHandle);
968 
969 /*
970 * brief Show widget.
971 * param[in] widgetHandle   Widget handle.
972 * retval ::HI_SUCCESS
973 * retval ::HI_ERR_COMM_LOST
974 * see: HI_GV_Widget_Hide
975 */
976 HI_S32 HI_GV_Widget_Show(HIGV_HANDLE widgetHandle);
977 
978 /*
979 * brief Move widget.
980 * param[in] widgetHandle Widget handle.
981 * param[in] x       the x coordinate that moved after.
982 * param[in] y       the y coordinate  that moved after.
983 * retval ::HI_SUCCESS
984 * retval ::HI_ERR_COMM_LOST
985 */
986 HI_S32 HI_GV_Widget_Move(HIGV_HANDLE widgetHandle, HIGV_CORD x, HIGV_CORD y);
987 
988 /*
989 * brief Move window to top.
990 * param[in] widgetHandle  Widget handle.
991 * retval ::HI_SUCCESS
992 * retval ::HI_ERR_COMM_LOST
993 * retval ::HI_ERR_COMM_NOOP Unsupported operation, such as the widget except window not support the api.
994 * ָ֧òԿؼøýӿ
995 */
996 HI_S32 HI_GV_Widget_MoveToTop(HIGV_HANDLE widgetHandle);
997 
998 /*
999 * brief Highlight widget.
1000 * param[in] widgetHandle   Widget handle.
1001 * param[in] highlight
1002 * retval ::HI_SUCCESS
1003 * retval ::HI_ERR_COMM_LOST
1004 * retval ::HI_ERR_COMM_NOOP Unsupported operation, such as the widget is disabed.
1005 */
1006 HI_S32 HI_GV_Widget_Highlight(HIGV_HANDLE widgetHandle, HI_BOOL highlight);
1007 
1008 /*
1009 * brief Whether highlight the widget.
1010 * param[in] widgetHandle   Widget handle.
1011 * retval ::HI_TRUE Highlight.
1012 * retval ::HI_FALSE it is not highlight.
1013 */
1014 HI_BOOL HI_GV_Widget_IsHighlight(HIGV_HANDLE widgetHandle);
1015 
1016 /*
1017 * brief Set transparent of widget.
1018 * param[in] widgetHandle  Widget handle.
1019 * param[in] isTrans  Transparent flag.
1020 * retval ::HI_SUCCESS
1021 * retval ::HI_ERR_COMM_LOST
1022 */
1023 HI_S32 HI_GV_Widget_SetTransparent(HIGV_HANDLE widgetHandle, HI_BOOL isTrans);
1024 
1025 /*
1026 * brief Set alignment of text.
1027 * param[in] widgetHandle Widget handle.
1028 * param[in] align  Alignment of text.
1029 * retval ::HI_SUCCESS
1030 * retval ::HI_ERR_COMM_LOST
1031 */
1032 HI_S32 HI_GV_Widget_SetAlign(HIGV_HANDLE widgetHandle, HI_U32 align);
1033 
1034 /*
1035 * brief Set text.
1036 * param[in] widgetHandle  Widget handle.
1037 * param[in] text   Text of wiget.
1038 * retval ::HI_SUCCESS
1039 * retval ::HI_ERR_COMM_LOST
1040 * retval ::HI_ERR_COMM_INVAL
1041 * retval ::HI_ERR_COMM_NORES No enough memory.
1042 * see
1043 * ::HI_GV_Widget_GetText
1044 * ::HI_GV_Widget_SetTextByID
1045 */
1046 HI_S32 HI_GV_Widget_SetText(HIGV_HANDLE widgetHandle, const HI_CHAR *text);
1047 
1048 /*
1049 * brief Set text by ID.
1050 * param[in] widgetHandle  Widget handle.
1051 * param[in] strID      String ID.
1052 * retval ::HI_SUCCESS
1053 * retval ::HI_ERR_COMM_LOST
1054 * see:
1055 * HI_GV_Widget_GetText
1056 * HI_GV_Widget_GetTextID
1057 * HI_GV_Widget_SetText
1058 */
1059 HI_S32 HI_GV_Widget_SetTextByID(HIGV_HANDLE widgetHandle, const HI_U32 strID);
1060 
1061 /*
1062 * brief Get text.
1063 * param[in] widgetHandle Widget handle.
1064 * param[out] buf     Text content.
1065 * param[in] bufLen     Buffer length.
1066 * retval ::HI_SUCCESS
1067 * retval ::HI_ERR_COMM_LOST
1068 * retval ::HI_ERR_COMM_INVAL Null pointer and the buffer length is 0.
1069 * see
1070 * HI_GV_Widget_SetText
1071 */
1072 HI_S32 HI_GV_Widget_GetText(HIGV_HANDLE widgetHandle, HI_CHAR *buffer, HI_U32 bufferLen);
1073 
1074 /*
1075 * brief Get text by ID.
1076 * param[in] widgetHandle Widget handle.
1077 * param[out] strID    String ID.
1078 * retval ::HI_SUCCESS
1079 * retval ::HI_ERR_COMM_LOST
1080 * retval ::HI_ERR_COMM_INVAL
1081 * see :HI_GV_Widget_SetTextByID
1082 */
1083 HI_S32 HI_GV_Widget_GetTextID(HIGV_HANDLE widgetHandle, HI_U32 *strID);
1084 
1085 /*
1086 * brief Bind database to widget.
1087 * param[in] widgetHandle Widget handle.
1088 * param[in] dataSource Data source object.
1089 * retval ::HI_SUCCESS
1090 * retval ::HI_ERR_COMM_LOST
1091 * see:HI_GV_Widget_UnbindDataSource
1092 */
1093 HI_S32 HI_GV_Widget_BindDataSource(HIGV_HANDLE widgetHandle, HIGV_HANDLE dataSource);
1094 
1095 /*
1096 * brief Unbind database to widget.
1097 * param[in] widgetHandle  Widget handle.
1098 * retval ::HI_SUCCESS
1099 * retval ::HI_ERR_COMM_LOST
1100 * retval ::HI_ERR_COMM_INVAL
1101 * see :HI_GV_Widget_BindDataSource
1102 */
1103 HI_S32 HI_GV_Widget_UnbindDataSource(HIGV_HANDLE widgetHandle);
1104 
1105 /*
1106 * brief Get datasource handle.
1107 * param[in] widgetHandle  Widget handle.
1108 * param[out] dataSource The pointer of datasource.
1109 * retval ::HI_SUCCESS
1110 * retval ::HI_ERR_COMM_LOST
1111 * retval ::HI_ERR_COMM_INVAL
1112 */
1113 HI_S32 HI_GV_Widget_GetDataSource(HIGV_HANDLE widgetHandle, HIGV_HANDLE *dataSource);
1114 
1115 /*
1116 * brief Get window which the widget attach.
1117 * param[in] widgetHandle Widget handle.
1118 * param[out] windowHandle  the pointer of parent widget handle.
1119 * retval ::HI_SUCCESS
1120 * retval ::HI_ERR_COMM_LOST
1121 * retval ::HI_ERR_COMM_INVAL
1122 */
1123 HI_S32 HI_GV_Widget_GetWindow(HIGV_HANDLE widgetHandle, HIGV_HANDLE *windowHandle);
1124 
1125 /*
1126 * brief Immediate repaint control.
1127 * param[in] widgetHandle  Widget handle.
1128 * param[in] rect    The area of update
1129 * retval ::HI_SUCCESS
1130 * retval ::HI_ERR_COMM_LOST
1131 */
1132 HI_S32 HI_GV_Widget_Update(HIGV_HANDLE widgetHandle, const HI_RECT *rect);
1133 
1134 /*
1135 * brief Immediate update the area of screen.
1136 * param[in] widgetHandle Widget handle.
1137 * param[in] rect  The area of update.
1138 * retval ::HI_SUCCESS
1139 * retval ::HI_ERR_COMM_LOST
1140 */
1141 HI_S32 HI_GV_Widget_Refresh(HIGV_HANDLE widgetHandle, const HI_RECT *refreshRect);
1142 
1143 /*
1144 * brief Get data from db and notify the widget to update data.
1145 * param[in] widgetHandle  Widget handle.
1146 * retval ::HI_SUCCESS
1147 * retval ::HI_ERR_COMM_LOST
1148 * retval ::HI_ERR_COMM_INVAL
1149 */
1150 HI_S32 HI_GV_Widget_SyncDB(HIGV_HANDLE widgetHandle);
1151 
1152 /*
1153 * brief Get area of widget, the widget coordate is refre to the parent, and window is refer to the screen.
1154 * ȡؼ��ڵ丸Ļ \attention \n N/A.
1155 *
1156 * retval ::HI_SUCCESS
1157 * retval ::HI_ERR_COMM_LOST
1158 * retval ::HI_ERR_COMM_INVAL
1159 */
1160 HI_S32 HI_GV_Widget_GetRect(HIGV_HANDLE widgetHandle, HI_RECT *rect);
1161 
1162 /*
1163 * brief Set colorkey of window.
1164 * param[in] windowHandle Window handle.
1165 * param[in] colorKey colorekey value.
1166 * retval ::HI_SUCCESS
1167 * retval ::HI_ERR_COMM_LOST
1168 */
1169 HI_S32 HI_GV_Widget_SetWinColorKey(HIGV_HANDLE windowHandle, HI_COLOR colorKey);
1170 
1171 /*
1172 * brief is it a window.
1173 * param[in] widgetHandle   Widget handle.
1174 * retval ::HI_TRUE
1175 * retval ::HI_FALSE
1176 */
1177 HI_BOOL HI_GV_Widget_IsWindow(HIGV_HANDLE widgetHandle);
1178 
1179 /*
1180 * brief Cancel paint.
1181 * param[in] widgetHandle Widet handle.
1182 * retval ::HI_SUCCESS
1183 * retval ::HI_ERR_COMM_LOST
1184 */
1185 HI_S32 HI_GV_Widget_Depaint(HIGV_HANDLE widgetHandle);
1186 
1187 /*
1188 * brief Convert the screen coordaite to widget coordinate.
1189 * param[in] widgetHandle Widget handle.
1190 * param[in] screenX The x coordinate of screen.
1191 * param[in] screenY The y coordinate of screen.
1192 * param[out] widgetX The x coordinate of widget.
1193 * param[out] widgetY The y coordinate of widget.
1194 * retval ::HI_SUCCESS
1195 * retval ::HI_ERR_COMM_LOST
1196 */
1197 HI_S32 HI_GV_Widget_Screen2Widget(HIGV_HANDLE widgetHandle, HIGV_CORD screenX, HIGV_CORD screenY, HIGV_CORD *widgetX,
1198     HIGV_CORD *widgetY);
1199 
1200 /*
1201 * brief Convert thewidget coordaite to  screen coordinate.
1202 * param[in] widgetHandle Widget handle.
1203 * param[in] widgetX The x coordinate of widget.
1204 * param[in] widgetY The y coordinate of widget.
1205 * param[out] screenX The x coordinate of screen.
1206 * param[out] screenY The y coordinate of screen.
1207 * retval ::HI_SUCCESS
1208 * retval ::HI_ERR_COMM_LOST
1209 */
1210 HI_S32 HI_GV_Widget_Widget2Screen(HIGV_HANDLE widgetHandle, HIGV_CORD widgetX, HIGV_CORD widgetY, HIGV_CORD *screenX,
1211     HIGV_CORD *screenY);
1212 
1213 /*
1214 * brief Get widget corresponding coordate.
1215 * param[in]  screenX The x coordinate of widget.
1216 * param[in]  screenY The x coordinate of widget.
1217 * param[out] widgetHandle The x coordinate of screen.
1218 * retval ::HI_SUCCESS
1219 * retval ::HI_EINVAL
1220 * retval ::HI_ENOTINIT
1221 * retval ::HI_FAILURE
1222 * retval ::HI_ERR_COMM_LOST
1223 */
1224 HI_S32 HI_GV_Widget_GetWidgetByPos(HIGV_CORD screenX, HIGV_CORD screenY, HIGV_HANDLE *widgetHandle);
1225 
1226 /*
1227 * brief Get widget corresponding coordate.
1228 * param[in]  screenX The x coordinate of widget.
1229 * param[in]  screenY The x coordinate of widget.
1230 * param[out] widgetHandle The x coordinate of screen.
1231 * retval ::HI_SUCCESS
1232 * retval ::HI_EINVAL
1233 * retval ::HI_ENOTINIT
1234 * retval ::HI_FAILURE
1235 * retval ::HI_ERR_COMM_LOST
1236 */
1237 HI_S32 HI_GV_Widget_GetWidgetByPos_TouchDevice(HIGV_CORD screenX, HIGV_CORD screenY, HIGV_HANDLE *widgetHandle);
1238 
1239 /*
1240 * brief Bind the scrollbar to widget.
1241 * param[in] widgetHandle  Widget handle.
1242 * param[in] scrollBarHandle Scrollbar handle.
1243 * retval ::HI_SUCCESS
1244 * retval ::HI_ERR_COMM_LOST
1245 * retval ::HI_ERR_COMM_INVAL
1246 */
1247 HI_S32 HI_GV_Widget_BindScrollBar(HIGV_HANDLE widgetHandle, HIGV_HANDLE scrollBarHandle);
1248 
1249 /*
1250 * brief Get the scrollbar of widget.
1251 * param[in] widgetHandle  widget handle.
1252 * param[in] scrollBarHandle  Binding scrollbar
1253 * retval N/A.
1254 */
1255 HI_S32 HI_GV_Widget_GetScrollBar(HIGV_HANDLE widgetHandle, HIGV_HANDLE *scrollBarHandle);
1256 
1257 #ifdef HIGV_USE_WIDGET_BUTTON
1258 /*
1259 * brief Get the state of all checkbox.
1260 * param[in] parentHandle Parent widget handle.
1261 * param[in] status  Status.
1262 * retval N/A.
1263 */
1264 HI_S32 HI_GV_Widget_SetAllCheckStatus(HIGV_HANDLE parentHandle, HIGV_BUTTON_STATUS_E status);
1265 #endif
1266 
1267 /*
1268 * brief Change window size, it is not effect widget.
1269 * param[in] widgetHandle  Widget handle.
1270 * param[in] width   Window width.
1271 * param[in] height    widnow height.
1272 * retval ::HI_SUCCESS
1273 * retval ::HI_ERR_COMM_LOST
1274 * retval ::HI_ERR_COMM_NOOP
1275 */
1276 HI_S32 HI_GV_Widget_Resize(HIGV_HANDLE widgetHandle, HI_S32 width, HI_S32 height);
1277 
1278 /*
1279 * brief Query the widget whether support the input method window.
1280 * param[in] widgetHandle      Widget handle.
1281 * param[in] supportImeType  Input method type.
1282 *             ȡֵΪλ
1283 *             ֧У  HIGV_IMETYPE_ALLTYPE
1284 *             Ӣģ      HIGV_IMETYPE_ENGLISH
1285 *             дӢģ  HIGV_IMETYPE_CAPENGLISH
1286 *             ֣      HIGV_IMETYPE_NUMBER
1287 *             ţ      HIGV_IMETYPE_SYMBOL
1288 *             ƴ      HIGV_IMETYPE_PINYIN
1289 * retval HI_TRUE          Is need input method window.
1290 * return HI_FALSE          it is not need.
1291 */
1292 HI_BOOL HI_GV_Widget_IsNeedIMEWindow(HIGV_HANDLE widgetHandle, HI_U32 *supportImeType);
1293 
1294 /*
1295 * brief Get the layer corresponding widget.
1296 * param[in]  widgetHandle       Widget handle.
1297 * param[out] layerHandle       Layer.
1298 * retval HI_SUCCESS
1299 * return HI_ERR_COMM_LOST
1300 * return HI_ERR_COMM_EMPTY
1301 */
1302 HI_S32 HI_GV_Widget_GetLayer(HIGV_HANDLE widgetHandle, HIGV_HANDLE *layerHandle);
1303 
1304 /*
1305 * brief Set the private data of widget.
1306 * attention :The memory of private data should be released by user.
1307 *
1308 * param[in]  widgetHandle      Widget handle.
1309 * param[in] privateData    The pointer of private data.
1310 * retval ::HI_SUCCESS
1311 * return ::HI_ERR_COMM_LOST
1312 * retval ::HI_ERR_COMM_INVAL
1313 */
1314 HI_S32 HI_GV_Widget_SetPrivate(HIGV_HANDLE widgetHandle, const HI_VOID *privateData);
1315 
1316 /*
1317 * brief
1318 * The memory of private data should be released by user.
1319 *
1320 * aram[in]  widgetHandle    Widget handle.
1321 * param[out] privateData    The pointer of private data.
1322 * retval ::HI_SUCCESS
1323 * return ::HI_ERR_COMM_LOST
1324 * retval ::HI_ERR_COMM_INVAL
1325 */
1326 HI_S32 HI_GV_Widget_GetPrivate(HIGV_HANDLE widgetHandle, HI_VOID **privateData);
1327 
1328 /*
1329 * brief Get the clone handle corresponding layer.
1330 * attention \n
1331 * param[in]  widgetHandle  Widget handle.
1332 * param[in]  layerHandle     Layer handle.
1333 * param[out] cloneHandle   Clone handle.
1334 * retval ::HI_SUCCESS
1335 * retval ::HI_ERR_COMM_INVAL
1336 * retval ::HI_ERR_COMM_INTER
1337 * retval ::HI_ERR_COMM_OVERFLOW The layer number is over.
1338 */
1339 HI_S32 HI_GV_Widget_GetCloneHandle(HIGV_HANDLE widgetHandle, HIGV_HANDLE layerHandle, HIGV_HANDLE *cloneHandle);
1340 
1341 /*
1342 * brief Whether errasing the bakground.
1343 * attention
1344 * param[in]  widgetHandle  Widget handle.
1345 * param[in] isErasebg
1346 * retval ::HI_SUCCESS
1347 * retval ::HI_ERR_COMM_LOST
1348 */
1349 HI_S32 HI_GV_Widget_EraseBackground(HIGV_HANDLE widgetHandle, HI_BOOL isErasebg);
1350 
1351 /*
1352 * brief Register the information of widget type, user can apply this api to register their own widget.
1353 * עؼϢûͨýӿ עԶĿؼϢ \attention \n N/A.
1354 * info of widget type
1355 * retval ::HI_SUCCESS
1356 * retval ::HI_ERR_COMM_EXIST
1357 * retval ::HI_ERR_COMM_INVAL
1358 * retval ::HI_ERR_COMM_NORES
1359 */
1360 HI_S32 HI_GV_Widget_RgisterWidget(HIGV_WIDGET_TYPEINFO_S typeInfo);
1361 
1362 /*
1363 * brief Unregister the widget.
1364 * param[in] typeID The type ID of widget.
1365 * retval ::HI_SUCCESS
1366 * retval ::HI_ERR_COMM_LOST
1367 */
1368 HI_S32 HI_GV_Widget_UnRgisterWidget(HI_U32 typeID);
1369 
1370 /*
1371 * brief Whether active the widget, This api is added for pop window of combobox.
1372 * ΪӵĽӿڣʹģ̬ڣģ̬ϵĵ ҲԼ \attention \n it is should attention to us this
1373 * api, otherwise the modal window will loss the function.
1374 * widgetHandle   Widget handle.
1375 * retval ::HI_SUCCESS
1376 * retval ::HI_ERR_COMM_LOST
1377 */
1378 HI_S32 HI_GV_Widget_CanActive(HIGV_HANDLE widgetHandle);
1379 
1380 /*
1381 * brief enable/disable mirror the widget when change language.
1382 * param[in] widgetHandle Widget handle.
1383 * param[in] posMirror   Whether mirror widget pos.
1384 * param[in] interiorMirror  Whether mirror widget interior.
1385 * retval ::HI_SUCCESS
1386 * retval ::HI_ERR_COMM_LOST
1387 * see : HI_GV_Widget_GetMirrorAttr
1388 */
1389 HI_S32 HI_GV_Widget_EnableMirror(HIGV_HANDLE widgetHandle, HI_BOOL posMirror, HI_BOOL interiorMirror);
1390 
1391 /*
1392 * brief Get the mirror attribute.CNcommment:ȡؼ
1393 * param[in] widgetHandle  Widget handle.
1394 * param[out] posMirror   Whether mirror widget pos.
1395 * param[out] interiorMirror  Whether mirror widget interior.
1396 * retval ::HI_SUCCESS
1397 * retval ::HI_ERR_COMM_LOST
1398 * retval ::HI_ERR_COMM_EMPTY
1399 * see : HI_GV_Widget_EnableMirror
1400 */
1401 HI_S32 HI_GV_Widget_GetMirrorAttr(HIGV_HANDLE widgetHandle, HI_BOOL *posMirror, HI_BOOL *interiorMirror);
1402 
1403 /*
1404 * brief Set text direction of the widget.CNcommment:ǿƿؼıķ
1405 * param[in] widgetHandle  Widget handle.
1406 * param[in] direction  Text direction.
1407 * retval ::HI_SUCCESS
1408 * retval ::HI_ERR_COMM_LOST
1409 */
1410 HI_S32 HI_GV_Widget_SetTextDir(HIGV_HANDLE widgetHandle, HIGV_TEXTDIR_E direction);
1411 
1412 /*
1413 * brief Set focus switch mode of the widget.CNcommment:ÿؼлģʽ
1414 * param[in] widgetHandle  Widget handle.
1415 * param[in] fousMode.
1416 * retval ::HI_SUCCESS
1417 * retval ::HI_ERR_COMM_LOST
1418 */
1419 HI_S32 HI_GV_Widget_SetFocusMode(HIGV_HANDLE widgetHandle, HIGV_FOCUS_SWITCH_E focusMode);
1420 
1421 /*
1422 * brief Set text or image margin.
1423 * attention:
1424 * For button,label,trackbar,listbox,msgbox,timerbar.
1425 *
1426 * param[in] widgetHandle  Widget handle.
1427 * param[in] leftMargin  Left margin.
1428 * param[in] rightMargin  Right margin.
1429 * param[in] topMargin  Top margin.
1430 * param[in] bottomMargin  Bottom margin.
1431 * retval ::HI_SUCCESS
1432 * retval ::HI_ERR_COMM_LOST
1433 * retval ::HI_ERR_COMM_INVAL
1434 */
1435 HI_S32 HI_GV_Widget_SetMargin(HIGV_HANDLE widgetHandle, HI_U32 leftMargin, HI_U32 rightMargin, HI_U32 topMargin,
1436     HI_U32 bottomMargin);
1437 
1438 /*
1439 * brief Get the margin.
1440 * param[in] widgetHandle  Widget handle.
1441 * param[out] leftMargin Left margin.
1442 * param[out] rightMargin  Right margin.
1443 * param[out] topMargin  Top margin.
1444 * param[out] bottomMargin Bottom margin.
1445 * retval ::HI_SUCCESS
1446 * retval ::HI_ERR_COMM_LOST
1447 * retval ::HI_ERR_COMM_INVAL
1448 */
1449 HI_S32 HI_GV_Widget_GetMargin(HIGV_HANDLE widgetHandle, HI_U32 *leftMargin, HI_U32 *rightMargin, HI_U32 *topMargin,
1450     HI_U32 *bottomMargin);
1451 
1452 /*
1453 * brief enable config image res path.CNcommment:ʹͼƬԴ·
1454 * param[in] widgetHandle  Widget handle.
1455 * param[in] enable enable or disable image res path.
1456 * retval ::HI_SUCCESS
1457 * retval ::HI_ERR_COMM_LOST
1458 */
1459 HI_S32 HI_GV_Widget_EnableResPach(HIGV_HANDLE widgetHandle, HI_BOOL enable);
1460 
1461 /*
1462 * brief enable widget forget focus.CNcommment: show & activeؼ
1463 * param[in] widgetHandle  Widget handle.
1464 * param[in] activeShow.
1465 * retval ::HI_SUCCESS
1466 */
1467 HI_S32 HI_GV_Widget_ActiveShow(HIGV_HANDLE widgetHandle, HI_BOOL activeShow);
1468 
1469 /*
1470 * brief Set bit block transfer operation of picture type skin.CNcommment: ÿؼͼƬƤİƻϲ
1471 * param[in] widgetHandle  Widget handle.
1472 * param[in] blitOpt Bit block transfer operation.
1473 * retval ::HI_SUCCESS
1474 * retval ::HI_ERR_COMM_LOST
1475 */
1476 HI_S32 HI_GV_Widget_SetSkinBlitOpt(HIGV_HANDLE widgetHandle, const HIGO_BLTOPT_S *blitOpt);
1477 
1478 #ifdef __cplusplus
1479 }
1480 #endif /* __cplusplus */
1481 #endif /* HI_GV_WIDGET_H */
1482