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 16 #ifndef NOTIFICATION_MANAGER_FFI_H 17 #define NOTIFICATION_MANAGER_FFI_H 18 19 #include "native/ffi_remote_data.h" 20 #include "notification_manager_impl.h" 21 #include "notification_utils.h" 22 #include "inner_errors.h" 23 24 #include <cstdint> 25 26 extern "C" { 27 FFI_EXPORT int32_t FfiOHOSNotificationManagerPublishV2(CNotificationRequestV2 request); 28 FFI_EXPORT int32_t FfiOHOSNotificationManagerCancelV2(int32_t id, const char* label); 29 FFI_EXPORT int32_t FfiOHOSNotificationManagerCancelAllV2(); 30 FFI_EXPORT int32_t FfiOHOSNotificationManagerAddSlotV2(int32_t type); 31 FFI_EXPORT CNotificationSlotV2 FfiOHOSNotificationManagerGetSlot(int32_t type, int32_t* errCode); 32 FFI_EXPORT CArrayNotificationSlotsV2 FfiOHOSNotificationManagerGetSlots(int32_t* errCode); 33 FFI_EXPORT int32_t FfiOHOSNotificationManagerRemoveSlot(int32_t type); 34 FFI_EXPORT int32_t FfiOHOSNotificationManagerRemoveAllSlots(); 35 FFI_EXPORT RetDataUI32 FfiOHOSNotificationManagerGetActiveNotificationCount(); 36 FFI_EXPORT CArrayNotificationRequestV2 FfiOHOSNotificationManagerGetActiveNotifications(int32_t* errCode); 37 FFI_EXPORT int32_t FfiOHOSNotificationManagerCancelGroup(const char* cGroupName); 38 FFI_EXPORT RetDataBool FfiOHOSNotificationManagerIsSupportTemplate(const char* cTemplateName); 39 FFI_EXPORT RetDataBool FfiOHOSNotificationManagerIsNotificationEnabledV2(); 40 FFI_EXPORT int32_t FfiOHOSNotificationManagerSetBadgeNumberV2(int32_t badgeNumber); 41 FFI_EXPORT int32_t FfiOHOSNotificationManagerRequestEnableNotificationV2(); 42 FFI_EXPORT int32_t FfiOHOSNotificationManagerRequestEnableNotificationWithContextV2(int64_t id); 43 FFI_EXPORT RetDataBool FfiOHOSNotificationManagerIsDistributedEnabledV2(); 44 45 // systemAPI 46 FFI_EXPORT int32_t FfiOHOSNotificationManagerSetNotificationEnable(CNotificationBundleOptionV2 option, bool enable); 47 FFI_EXPORT int32_t FfiOHOSNotificationManagerDisplayBadge(CNotificationBundleOptionV2 option, bool enable); 48 FFI_EXPORT RetDataBool FfiOHOSNotificationManagerIsBadgeDisplayed(CNotificationBundleOptionV2 option); 49 FFI_EXPORT int32_t FfiOHOSNotificationManagerSetSlotFlagsByBundle(CNotificationBundleOptionV2 option, 50 int32_t slotFlags); 51 FFI_EXPORT RetDataUI32 FfiOHOSNotificationManagerGetSlotFlagsByBundle(CNotificationBundleOptionV2 option); 52 FFI_EXPORT RetDataUI32 FfiOHOSNotificationManagerGetSlotNumByBundle(CNotificationBundleOptionV2 option); 53 FFI_EXPORT int32_t FfiOHOSNotificationManagerRemoveGroupByBundle(CNotificationBundleOptionV2 option, 54 const char* cGroupName); 55 } 56 57 #endif // NOTIFICATION_MANAGER_FFI_H