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_SCALE_VIEW_H 17 #define HI_GV_SCALE_VIEW_H 18 #include "hi_gv_widget.h" 19 #include "hi_type.h" 20 #include "hi_gv_conf.h" 21 22 #ifdef HIGV_USE_WIDGET_SCALEVIEW 23 /* add include here */ 24 #include "hi_gv_resm.h" 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 typedef struct HIGV_SCALEVIEW_STYLE_S { 31 HIGV_HANDLE dataModel; /* Data Model Handle */ 32 HI_U32 rowNum; /* The count of display item */ 33 HI_U32 leftMargin; /* Left margin */ 34 HI_U32 rightMargin; /* Right margin */ 35 HI_U32 topMargin; /* Up margin */ 36 HI_U32 bottomMargin; /* Bottom margin */ 37 HI_U32 imgDecIndex; /* imgDecIndex */ 38 HI_U32 lineHeight; /* ˮƽ߸߶ */ 39 HI_U32 lineWidth; /* ˮƽ߿ */ 40 HI_U32 lineDistance; /* ˮƽߵĿݵľ */ 41 HI_U32 hlineColor; /* hlineColor */ 42 HI_U32 type; /* type */ 43 HIGV_HANDLE scaleFont; /* scaleFont */ 44 HI_COLOR tapTxtColor; /* tapTxtColor */ 45 HI_DOUBLE sizeGrain; /* С仯 */ 46 HI_BOOL isNeedTransform; /* ĿǷҪת */ 47 HI_BOOL tapAutoMove; /* ĿǷҪԶ */ 48 HI_U32 imageSize; /* ԪͼƬ߶ */ 49 HI_DOUBLE imageSizeGrain; /* ͼƬС仯 */ 50 HI_BOOL horDisplayMode; /* Ƿʾģʽ */ 51 } HIGV_SCALEVIEW_STYLE; 52 53 /* 54 * brief Initiatlize the scaleview. 55 * attention : Set the head of ScaleView and row num. 56 * 57 * param[out] handleScaleView ScaleView handle. 58 * param[in] creatInfo: widget info of ScaleView. 59 * retval ::HI_SUCCESS 60 * retval ::HI_ERR_COMM_LOST 61 * retval ::HI_ERR_COMM_INVAL 62 */ 63 HI_S32 HI_GV_SCALEVIEW_Create(const HIGV_WCREATE_S *creatInfo, HIGV_HANDLE *handleScaleView); 64 65 /* 66 \brief Set selected item of ScaleView. 67 \attention \n 68 69 \param[in] handleScaleView ScaleView handle. 70 \param[in] item Item index. 71 \retval ::HI_SUCCESS 72 \retval ::HI_ERR_COMM_LOST 73 \retval ::HI_ERR_COMM_INVAL 74 \see \n 75 ::HI_GV_SCALEVIEW_SetSelItem 76 */ 77 HI_S32 HI_GV_SCALEVIEW_SetSelItem(HIGV_HANDLE handleScaleView, HI_U32 item); 78 79 /* 80 \brief Get the item of ScaleView. 81 \attention \n 82 N/A. 83 \param[in] handleScaleView ScaleView handle. 84 \param[out] selItem Item index. 85 \retval ::HI_SUCCESS 86 \retval ::HI_ERR_COMM_LOST 87 \retval ::HI_ERR_COMM_INVAL 88 89 \see \n 90 ::HI_GV_SCALEVIEW_GetSelItem 91 */ 92 HI_S32 HI_GV_SCALEVIEW_GetSelItem(HIGV_HANDLE handleScaleView, HI_U32 *selItem); 93 94 /* 95 \brief Get the total item number of ScaleView. 96 \attention \n 97 N/A. 98 \param[in] handleScaleView ScaleView handle. 99 \param[out] itemNum Toal item number. 100 \retval ::HI_SUCCESS 101 \retval ::HI_ERR_COMM_LOST 102 \retval ::HI_ERR_COMM_INVAL 103 \see \n 104 N/A. 105 */ 106 HI_S32 HI_GV_SCALEVIEW_GetItemNum(HIGV_HANDLE handleScaleView, HI_U32 *itemNum); 107 108 /* 109 brief Get the item of ScaleView. 110 \attention \n 111 N/A. 112 \param[in] handleScaleView ScaleView handle. 113 \param[out] tapItem Item index. 114 \retval ::HI_SUCCESS 115 \retval ::HI_ERR_COMM_LOST 116 \retval ::HI_ERR_COMM_INVAL 117 \see \n 118 ::HI_GV_SCALEVIEW_GetTapItem 119 */ 120 HI_S32 HI_GV_SCALEVIEW_GetTapItem(HIGV_HANDLE handleScaleView, HI_U32 *tapItem); 121 122 /* 123 brief Get the item of ScaleView. 124 \attention \n 125 N/A. 126 \param[in] handleScaleView ScaleView handle. 127 \param[out] itemNum Item index. 128 \retval ::HI_SUCCESS 129 \retval ::HI_ERR_COMM_LOST 130 \retval ::HI_ERR_COMM_INVAL 131 \see \n 132 ::HI_GV_SCALEVIEW_GetFoucItem 133 */ 134 HI_S32 HI_GV_SCALEVIEW_GetFoucItem(HIGV_HANDLE handleScaleView, HI_U32 *itemNum); 135 136 #ifdef __cplusplus 137 } 138 #endif 139 #endif 140 #endif /* HI_GV_SCALEVIEW_H */ 141