• 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_WHEELVIEW_H
17 #define HI_GV_WHEELVIEW_H
18 #include "hi_type.h"
19 #include "hi_gv_conf.h"
20 #include "hi_gv_widget.h"
21 
22 #ifdef HIGV_USE_WIDGET_WHEELVIEW
23 /* add include here */
24 #include "hi_gv_resm.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 typedef struct {
31     HI_U32 rowNum; /* The count of display item */
32     HIGV_HANDLE dataModel; /* Data Model Handle */
33     HIGV_HANDLE upCoverSkin; /* Up Cover Skin */
34     HIGV_HANDLE downCoverSkin; /* Down Cover Skin */
35     HI_BOOL isCircleScroll; /* Circle tag */
36     HI_FLOAT scrollParam; /* Scroll Param */
37     HI_FLOAT flingParam; /* Fling Param */
38     HI_U32 leftMargin; /* Left margin */
39     HI_U32 rightMargin; /* Right margin */
40     HI_U32 topMargin; /* Up margin */
41     HI_U32 btmMargin; /* Bottom margin */
42 } HigvWheelViewStyle;
43 
44 /*
45 * brief Create wheelview.
46 * param[in] creatInfo    The Layout information of wheelview.
47 * param[out] wheelViewHandle   the pointer of wheelview handle.
48 * retval ::HI_SUCCESS
49 * retval ::HI_ERR_COMM_LOST
50 * retval ::HI_ERR_INVA
51 * retval ::HI_ERR_COMM_NORES
52 */
53 HI_S32 HI_GV_WheelView_Create(const HIGV_WCREATE_S *creatInfo, HIGV_HANDLE *wheelViewHandle);
54 
55 /*
56 * brief Set selected item of  wheelview.
57 * param[in] wheelViewHandle WheelView handle.
58 * param[in] item  Item index.
59 * retval ::HI_SUCCESS
60 * retval ::HI_ERR_COMM_LOST
61 * retval ::HI_ERR_COMM_INVAL
62 * see ::HI_GV_WheelView_GetSelItem
63 */
64 HI_S32 HI_GV_WheelView_SetSelItem(HIGV_HANDLE wheelViewHandle, HI_U32 item);
65 
66 /*
67 * brief Get the item of WheelView.
68 * param[in] wheelViewHandle  WheelView handle.
69 * param[out] item Item index.
70 * retval ::HI_SUCCESS
71 * retval ::HI_ERR_COMM_LOST
72 * retval ::HI_ERR_COMM_INVAL
73 * see ::HI_GV_WheelView_SetSelItem
74 */
75 HI_S32 HI_GV_WheelView_GetSelItem(HIGV_HANDLE wheelViewHandle, HI_U32 *item);
76 
77 /*
78 * brief Get the total item number of WheelView.
79 * param[in]  wheelViewHandle  WheelView handle.
80 * param[out] itemNum Toal item number.
81 * retval ::HI_SUCCESS
82 * retval ::HI_ERR_COMM_LOST
83 * retval ::HI_ERR_COMM_INVAL
84 */
85 HI_S32 HI_GV_WheelView_GetItemNum(HIGV_HANDLE wheelViewHandle, HI_U32 *itemNum);
86 
87 /*
88 * brief Set up image resource.
89 * param[in] wheelViewHandle Image handle.
90 * param[in] handleRes The resource ID of image.
91 * retval ::HI_SUCCESS
92 * retval ::HI_ERR_COMM_LOST
93 * retval ::HI_ERR_COMM_INVAL
94 */
95 HI_S32 HI_GV_WheelView_SetUpImage(HIGV_HANDLE wheelViewHandle, HI_RESID handleRes);
96 
97 /*
98 * brief Set up image resource.
99 * param[in] wheelViewHandle Image handle.
100 * param[in] handleRes The resource ID of image.
101 * retval ::HI_SUCCESS
102 * retval ::HI_ERR_COMM_LOST
103 * retval ::HI_ERR_COMM_INVAL
104 */
105 HI_S32 HI_GV_WheelView_SetDownImage(HIGV_HANDLE wheelViewHandle, HI_RESID handleRes);
106 
107 /*
108 * brief Enable wheelview touch.
109 * param[in] wheelViewHandle Image handle.
110 * param[in] enable  Enable flag.
111 * retval ::HI_SUCCESS
112 * retval ::HI_ERR_COMM_LOST
113 * retval ::HI_ERR_COMM_INVAL
114 */
115 HI_S32 HI_GV_WheelView_Enable(HIGV_HANDLE wheelViewHandle, HI_BOOL enable);
116 
117 /*
118 * brief Is touch enable.
119 * param[in] wheelViewHandle Image handle.
120 * retval ::HI_TRUE  Touch is Enable.
121 * retval ::HI_FALSE Touch is Disable.
122 */
123 HI_BOOL HI_GV_WheelView_IsEnable(HIGV_HANDLE wheelViewHandle);
124 
125 /*
126 * rief Set scroll param.
127 * param[in] wheelViewHandle wheelview handle.
128 * param[in] scrollParam scroll index.
129 * retval ::HI_SUCCESS
130 * retval ::HI_ERR_COMM_INVAL
131 */
132 HI_S32 HI_GV_WheelView_SetScrollParam(HIGV_HANDLE wheelViewHandle, HI_FLOAT scrollParam);
133 
134 /*
135 * brief Set fling param.
136 * param[in] wheelViewHandle wheelview handle.
137 * param[in] flingParam fling index.
138 * retval ::HI_SUCCESS
139 * retval ::HI_ERR_COMM_LOST
140 * retval ::HI_ERR_COMM_INVAL
141 */
142 HI_S32 HI_GV_WheelView_SetFlingParam(HIGV_HANDLE wheelViewHandle, HI_FLOAT flingParam);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 #endif
148 #endif /* HI_GV_WHEELVIEW_H */
149