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_CLOCK_H 17 #define HI_GV_CLOCK_H 18 19 /* add include here */ 20 #include <time.h> 21 #include "hi_gv_widget.h" 22 #ifdef HIGV_USE_WIDGET_CLOCK 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 typedef struct hiHIG_TIME_S { 28 HI_U32 year; /* Year , */ 29 HI_U32 month; /* Month , */ 30 HI_U32 day; /* Day , */ 31 HI_U32 week; /* Week , */ 32 HI_U32 hour; /* Hour , */ 33 HI_U32 minute; /* Minute, */ 34 HI_U32 second; /* Second , */ 35 } HIGV_TIME_S; 36 37 typedef enum { 38 HIGV_CURSORRES_TYPE_COLOR = 0, 39 HIGV_CURSORRES_TYPE_IMAGE = 1, 40 HIGV_CURSORRES_TYPE_BUTT, 41 } HIGV_CURSORRES_TYPE_E; 42 43 typedef enum { 44 HIGV_CLOCK_MODE_TEXT = 0, 45 /* User set time information by text , */ 46 HIGV_CLOCK_MODE_FORMAT, 47 /* User set time information by time format , */ 48 HIGV_CLOCK_MODE_BUTT, 49 } HIGV_CLOCK_MODE_E; 50 51 typedef struct { 52 HIGV_CLOCK_MODE_E DispMode; /* display mode ; */ 53 HIGV_CURSORRES_TYPE_E CursorResType; /* The cursor resource type ; */ 54 /* The resource ID of cursor ; */ 55 HI_U32 CursorRes; 56 } HIGV_CLOCK_STYLE_S; 57 58 HI_S32 HI_GV_Clock_Init(HIGV_HANDLE clockHandle, const HIGV_CLOCK_STYLE_S *style); 59 60 HI_S32 HI_GV_Clock_SetFlash(HIGV_HANDLE clockHandle, HI_BOOL flash); 61 62 HI_S32 HI_GV_Clock_SetTimeUnit(HIGV_HANDLE clockHandle, const HI_CHAR *unit); 63 64 HI_S32 HI_GV_Clock_Run(HIGV_HANDLE clockHandle, HI_BOOL run); 65 66 HI_S32 HI_GV_Clock_ClearContent(HIGV_HANDLE clockHandle); 67 68 HI_S32 HI_GV_Clock_SetUTC(HIGV_HANDLE clockHandle, time_t t); 69 70 HI_S32 HI_GV_Clock_GetUTC(HIGV_HANDLE clockHandle, time_t *t); 71 72 HI_S32 HI_GV_Clock_SetSwitchItemStep(HIGV_HANDLE clockHandle, HI_U32 step, HI_U32 interval); 73 74 #ifdef __cplusplus 75 } 76 #endif 77 #endif 78 #endif /* HI_GV_SPIN_H */ 79