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_SCROLLTEXT_H 17 #define HI_GV_SCROLLTEXT_H 18 19 /* add include here */ 20 #include "hi_type.h" 21 #include "hi_go.h" 22 #include "hi_gv_resm.h" 23 #include "hi_gv_conf.h" 24 25 #ifdef HIGV_USE_WIDGET_SCROLLTEXT 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif 30 31 #define ST_STYLE_ALWAYSSCROLL 0x4 32 33 #define HIGV_ST_STYLE_ALWAYSSCROLL HIGV_STYLE_DEFINE(HIGV_WIDGET_SCROLLTEXT, ST_STYLE_ALWAYSSCROLL) 34 35 /* scroll direction */ 36 typedef enum { 37 /* left scroll */ 38 HIGV_DIRECTION_LEFT = 0, 39 /* right scroll */ 40 HIGV_DIRECTION_RIGHT, 41 HIGV_DIRECTION_BUTT 42 } HIGV_DIRECTION_E; 43 44 /* 45 * brief Set content of scrolltext. 46 * param[in] scrollTextHandle Scrolltext handle. 47 * param[in] image Picture resource ID. 48 * param[in] string String. 49 * retval ::HI_SUCCESS 50 * retval ::HI_ERR_COMM_LOST 51 * retval ::HI_ERR_COMM_INVAL 52 * see ::HI_GV_ScrollText_GetContent 53 */ 54 HI_S32 HI_GV_ScrollText_SetContent(HIGV_HANDLE scrollTextHandle, HI_RESID image, const HI_CHAR *string); 55 56 /* 57 * brief Set content of scrolltext. 58 * param[in] scrollTextHandle Scrolltext handle. 59 * param[in] image Picture resource ID. 60 * param[in] string resource ID. 61 * retval ::HI_SUCCESS 62 * retval ::HI_ERR_COMM_LOST 63 * retval ::HI_ERR_COMM_INVAL 64 * see ::HI_GV_ScrollText_GetContentByID 65 */ 66 HI_S32 HI_GV_ScrollText_SetContentByID(HIGV_HANDLE scrollTextHandle, HI_RESID image, HI_U32 strID); 67 68 /* 69 * brief Get content of scrolltext. 70 * param[in] scrollTextHandle Scrolltext handle. 71 * param[out] image Picture resource ID. 72 * param[out] string String. 73 * param[in] textBufLen String length. 74 * retval ::HI_SUCCESS 75 * retval ::HI_ERR_COMM_LOST 76 * retval ::HI_ERR_COMM_INVAL 77 * see ::HI_GV_ScrollText_SetContent 78 */ 79 HI_S32 HI_GV_ScrollText_GetContent(HIGV_HANDLE scrollTextHandle, HI_RESID *image, HI_CHAR *string, HI_U32 textBufLen); 80 81 /* 82 * brief Set start position of scrolltext. 83 * param[in] scrollTextHandle Scrolltext handle. 84 * param[in] x the x coordinate of picture. 85 * param[in] y the y coordinate of picture. 86 * retval ::HI_SUCCESS 87 * retval ::HI_ERR_COMM_LOST 88 */ 89 HI_S32 HI_GV_ScrollText_SetImagePos(HIGV_HANDLE scrollTextHandle, HI_S32 x, HI_S32 y); 90 91 /* 92 * brief Set start position of scrolltext. 93 * param[in] scrollTextHandle Scrolltext handle. 94 * param[in] x the x coordinate of text. 95 * param[in] y the y coordinate of text. 96 * retval ::HI_SUCCESS 97 * retval ::HI_ERR_COMM_LOST 98 */ 99 HI_S32 HI_GV_ScrollText_SetTextPos(HIGV_HANDLE scrollTextHandle, HI_S32 x, HI_S32 y); 100 101 /* 102 * brief Set interval of scrolltext. 103 * param[in] scrollTextHandle Scrolltext handle. 104 * param[in] timeInterval Time interval. 105 * retval ::HI_SUCCESS 106 * retval ::HI_ERR_COMM_LOST 107 */ 108 HI_S32 HI_GV_ScrollText_SetTimeInterval(HIGV_HANDLE scrollTextHandle, HI_U32 timeInterval); 109 110 /* 111 * brief Set step of scrolltext. 112 * param[in] scrollTextHandle 113 * param[in] step Scroll step. 114 * retval ::HI_SUCCESS 115 * retval ::HI_ERR_COMM_LOST 116 */ 117 HI_S32 HI_GV_ScrollText_SetStep(HIGV_HANDLE scrollTextHandle, HI_U32 step); 118 119 /* 120 * brief Set direction of scrolltext. 121 * param[in] scrollTextHandle Scrolltext handle. 122 * param[in] direction Scroll direction. 123 * retval ::HI_SUCCESS 124 * retval ::HI_ERR_COMM_LOST 125 */ 126 HI_S32 HI_GV_ScrollText_SetDirection(HIGV_HANDLE scrollTextHandle, HIGV_DIRECTION_E direction); 127 128 /* 129 * brief Set widget content. 130 * param[in] scrollTextHandle Scrolltext handle. 131 * param[in] status The satus of scrolltext. 132 * retval ::HI_SUCCESS 133 * retval ::HI_ERR_COMM_LOST 134 */ 135 HI_S32 HI_GV_ScrollText_SetStatus(HIGV_HANDLE scrollTextHandle, HI_BOOL status); 136 137 /* 138 * brief Get the position of the content. 139 * param[in] scrollTextHandle Scrolltext handle. 140 * param[out] x x coordinate. 141 * param[out] y y coordinate. 142 * retval ::HI_SUCCESS 143 * retval ::HI_ERR_COMM_LOST 144 */ 145 HI_S32 HI_GV_ScrollText_GetCurPos(HIGV_HANDLE scrollTextHandle, HI_S32 *x, HI_S32 *y); 146 147 /* 148 * brief Reset the position of the content. 149 * param[in] scrollTextHandle Scrolltext handle. 150 * retval ::HI_SUCCESS 151 * retval ::HI_ERR_COMM_LOST 152 */ 153 HI_S32 HI_GV_ScrollText_ResetPos(HIGV_HANDLE scrollTextHandle); 154 155 #ifdef __cplusplus 156 } 157 #endif 158 #endif 159 #endif /* HI_GV_SCROLLTEXT_H */ 160