1 /* 2 * Copyright (c) 2021-2025 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 16 #ifndef HIAPPEVENT_C_H 17 #define HIAPPEVENT_C_H 18 19 #include "hiappevent/hiappevent.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 ParamList HiAppEventCreateParamList(); 25 void HiAppEventDestroyParamList(ParamList list); 26 27 ParamList AddBoolParamValue(ParamList list, const char* name, bool boolean); 28 ParamList AddBoolArrayParamValue(ParamList list, const char* name, const bool* booleans, int arrSize); 29 ParamList AddInt8ParamValue(ParamList list, const char* name, int8_t num); 30 ParamList AddInt8ArrayParamValue(ParamList list, const char* name, const int8_t* nums, int arrSize); 31 ParamList AddInt16ParamValue(ParamList list, const char* name, int16_t num); 32 ParamList AddInt16ArrayParamValue(ParamList list, const char* name, const int16_t* nums, int arrSize); 33 ParamList AddInt32ParamValue(ParamList list, const char* name, int32_t num); 34 ParamList AddInt32ArrayParamValue(ParamList list, const char* name, const int32_t* nums, int arrSize); 35 ParamList AddInt64ParamValue(ParamList list, const char* name, int64_t num); 36 ParamList AddInt64ArrayParamValue(ParamList list, const char* name, const int64_t* nums, int arrSize); 37 ParamList AddFloatParamValue(ParamList list, const char* name, float num); 38 ParamList AddFloatArrayParamValue(ParamList list, const char* name, const float* nums, int arrSize); 39 ParamList AddDoubleParamValue(ParamList list, const char* name, double num); 40 ParamList AddDoubleArrayParamValue(ParamList list, const char* name, const double* nums, int arrSize); 41 ParamList AddStringParamValue(ParamList list, const char* name, const char* str); 42 ParamList AddStringArrayParamValue(ParamList list, const char* name, const char* const *strs, int arrSize); 43 44 bool HiAppEventInnerConfigure(const char* name, const char* value); 45 46 int HiAppEventInnerWrite(const char* domain, const char* name, enum EventType type, const ParamList list); 47 48 void ClearData(); 49 50 HiAppEvent_Config* HiAppEventCreateConfig(); 51 int HiAppEventSetConfigItem(HiAppEvent_Config* config, const char* itemName, const char* itemValue); 52 int HiAppEventSetEventConfig(const char* name, HiAppEvent_Config* config); 53 void HiAppEventDestroyConfig(HiAppEvent_Config* config); 54 #ifdef __cplusplus 55 } 56 #endif 57 #endif // HIAPPEVENT_C_H 58