1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 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 #ifndef INTERFACES_CJ_INCLUDE_I18N_CALENDAR_FFI_H_ 16 #define INTERFACES_CJ_INCLUDE_I18N_CALENDAR_FFI_H_ 17 18 #include <cstdint> 19 #include "i18n_struct.h" 20 21 #define FFI_EXPORT __attribute__((visibility("default"))) 22 23 extern "C" { 24 FFI_EXPORT void FfiOHOSCalendarSetTime(int64_t id, double milliseconds); 25 FFI_EXPORT void FfiOHOSCalendarSetOfDay(int64_t id, int32_t hour, int32_t minute, int32_t second); 26 FFI_EXPORT void FfiOHOSCalendarSetTimeOfDay(int64_t id, int32_t hour, int32_t minute, int32_t second, 27 uint32_t flag); 28 FFI_EXPORT void FfiOHOSCalendarSetDate(int64_t id, int32_t year, int32_t month, int32_t day); 29 FFI_EXPORT void FfiOHOSCalendarSetTimeZone(int64_t id, const char* timeZone); 30 FFI_EXPORT char* FfiOHOSCalendarGetTimeZone(int64_t id); 31 FFI_EXPORT void FfiOHOSCalendarSetFirstDayOfWeek(int64_t id, int32_t firstDayOfWeek); 32 FFI_EXPORT int32_t FfiOHOSCalendarGetFirstDayOfWeek(int64_t id); 33 FFI_EXPORT void FfiOHOSCalendarSetMinimalDaysInFirstWeek(int64_t id, int32_t minimalDaysInFirstWeek); 34 FFI_EXPORT int32_t FfiOHOSCalendarGetMinimalDaysInFirstWeek(int64_t id); 35 FFI_EXPORT int32_t FfiOHOSCalendarGet(int64_t id, char* field); 36 FFI_EXPORT char* FfiOHOSCalendarGetDisplayName(int64_t id, char* locale); 37 FFI_EXPORT bool FfiOHOSCalendarIsWeekend(int64_t id, CDate date); 38 FFI_EXPORT void FfiOHOSCalendarAdd(int64_t id, char* field, int32_t amount, int32_t* errcode); 39 FFI_EXPORT double FfiOHOSCalendarGetTimeInMillis(int64_t id); 40 FFI_EXPORT int32_t FfiOHOSCalendarCompareDays(int64_t id, CDate date); 41 FFI_EXPORT int64_t FfiOHOSGetCalendar(const char* locale, const char* type); 42 } 43 44 #endif // INTERFACES_CJ_INCLUDE_I18N_CALENDAR_FFI_H_ 45