diff --git a/NotificationKit/BUILD.gn b/NotificationKit/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..eff7eea6e08463b4c96eb12e3c44da7da587fbff --- /dev/null +++ b/NotificationKit/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") +ohos_ndk_headers("ohnotification_header") { + dest_dir = "$ndk_headers_out_dir/NotificationKit/" + sources = [ "./notification.h" ] +} + +ohos_ndk_library("libnotification_ndk") { + output_name = "ohnotification" + output_extension = "so" + ndk_description_file = "./libohnotification.ndk.json" + min_compact_version = "13" + system_capability = "SystemCapability.Notification.Notification" + system_capability_headers = [ "NotificationKit/notification.h" ] +} diff --git a/NotificationKit/libohnotification.ndk.json b/NotificationKit/libohnotification.ndk.json new file mode 100644 index 0000000000000000000000000000000000000000..24b56b30a00063e07790c859328c2a8420f99f74 --- /dev/null +++ b/NotificationKit/libohnotification.ndk.json @@ -0,0 +1,6 @@ +[ + { + "first_introduced": "13", + "name": "OH_Notification_IsNotificationEnabled" + } +] diff --git a/NotificationKit/notification.h b/NotificationKit/notification.h new file mode 100644 index 0000000000000000000000000000000000000000..d7a31be18c4125e1a1326dc294847d20ca24cc33 --- /dev/null +++ b/NotificationKit/notification.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup NOTIFICATION + * @{ + * + * @brief Provides the definition of the C interface for the notification service. + * + * @since 13 + */ +/** + * @file notification.h + * + * @brief Declares the APIs of notification service. + * + * @library libohnotification.so + * @kit NotificationKit + * @syscap SystemCapability.Notification.Notification + * @since 13 + */ + +#ifndef OH_NOTIFICATION_H +#define OH_NOTIFICATION_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Checks whether this application is allowed to publish notifications. + * + * @return true - This application is allowed to publish notifications. + * false - This application is not allowed to publish notifications. + * @since 13 + */ +bool OH_Notification_IsNotificationEnabled(void); + +#ifdef __cplusplus +} +#endif +#endif // OH_NOTIFICATION_H +/** @} */