1 /* 2 * Copyright (c) 2023 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 SYSTEM_EVENT_WRAPPER 17 #define SYSTEM_EVENT_WRAPPER 18 19 #include <stdint.h> 20 21 typedef void (*OnPackageRemoved)(int32_t, const uint8_t *, uint32_t, const uint8_t *, int32_t); 22 typedef void (*OnUserRemoved)(int32_t); 23 typedef void (*OnScreenOff)(void); 24 typedef void (*OnCharging)(void); 25 typedef void (*OnAppRestore)(int32_t, const uint8_t *, int32_t); 26 typedef void (*OnUserUnlocked)(int32_t); 27 28 typedef struct { 29 OnPackageRemoved onPackageRemoved; 30 OnUserRemoved onUserRemoved; 31 OnScreenOff onScreenOff; 32 OnCharging onCharging; 33 OnAppRestore onAppRestore; 34 OnUserUnlocked onUserUnlocked; 35 } EventCallBack; 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 bool SubscribeSystemEvent(const EventCallBack eventCallBack); 42 bool UnSubscribeSystemEvent(void); 43 44 #ifdef __cplusplus 45 } 46 #endif 47 48 #endif // SYSTEM_EVENT_WRAPPER_H 49