1 /* 2 * Copyright (c) 2021-2022 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 BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_JS_NAPI_INCLUDE_REMINDER_PUBLISH_H 16 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_JS_NAPI_INCLUDE_REMINDER_PUBLISH_H 17 18 #include "reminder/reminder_common.h" 19 20 namespace OHOS { 21 namespace ReminderAgentNapi { 22 /** 23 * @brief Cancels a reminder. 24 * 25 * @param env Indicates the context. 26 * @param info Indicates the opaque datatype about the context. 27 * @return opaque pointer that is used to represent a JavaScript value 28 */ 29 napi_value CancelReminder(napi_env env, napi_callback_info info); 30 31 /** 32 * @brief Cancels all reminders of current bundle. 33 * 34 * @param env Indicates the context. 35 * @param info Indicates the opaque datatype about the context. 36 * @return opaque pointer that is used to represent a JavaScript value 37 */ 38 napi_value CancelAllReminders(napi_env env, napi_callback_info info); 39 40 /** 41 * @brief Obtains all reminders of current bundle. 42 * 43 * @param env Indicates the context. 44 * @param info Indicates the opaque datatype about the context. 45 * @return opaque pointer that is used to represent a JavaScript value 46 */ 47 napi_value GetValidReminders(napi_env env, napi_callback_info info); 48 49 /** 50 * @brief Obtains all reminders of current bundle,support returning reminderId. 51 * 52 * @param env Indicates the context. 53 * @param info Indicates the opaque datatype about the context. 54 * @return opaque pointer that is used to represent a JavaScript value 55 */ 56 napi_value GetAllValidReminders(napi_env env, napi_callback_info info); 57 58 /** 59 * @brief Publishes a reminder. 60 * 61 * @param env Indicates the context. 62 * @param info Indicates the opaque datatype about the context. 63 * @return opaque pointer that is used to represent a JavaScript value 64 */ 65 napi_value PublishReminder(napi_env env, napi_callback_info info); 66 67 /** 68 * @brief Adds a slot type. 69 * 70 * @param env Indicates the context. 71 * @param info Indicates the opaque datatype about the context. 72 * @return opaque pointer that is used to represent a JavaScript value. 73 */ 74 napi_value AddSlot(napi_env env, napi_callback_info info); 75 76 /** 77 * @brief Cancels a reminder(designed for error code). 78 * 79 * @param env Indicates the context. 80 * @param info Indicates the opaque datatype about the context. 81 * @return opaque pointer that is used to represent a JavaScript value 82 */ 83 napi_value CancelReminderMgr(napi_env env, napi_callback_info info); 84 85 /** 86 * @brief Cancels all reminders of current bundle(designed for error code). 87 * 88 * @param env Indicates the context. 89 * @param info Indicates the opaque datatype about the context. 90 * @return opaque pointer that is used to represent a JavaScript value 91 */ 92 napi_value CancelAllRemindersMgr(napi_env env, napi_callback_info info); 93 94 /** 95 * @brief Obtains all reminders of current bundle(designed for error code). 96 * 97 * @param env Indicates the context. 98 * @param info Indicates the opaque datatype about the context. 99 * @return opaque pointer that is used to represent a JavaScript value 100 */ 101 napi_value GetValidRemindersMgr(napi_env env, napi_callback_info info); 102 103 /** 104 * @brief Obtains all reminders of current bundle(designed for error code),support returning reminderId. 105 * 106 * @param env Indicates the context. 107 * @param info Indicates the opaque datatype about the context. 108 * @return opaque pointer that is used to represent a JavaScript value 109 */ 110 napi_value GetAllValidRemindersMgr(napi_env env, napi_callback_info info); 111 112 /** 113 * @brief Publishes a reminder(designed for error code). 114 * 115 * @param env Indicates the context. 116 * @param info Indicates the opaque datatype about the context. 117 * @return opaque pointer that is used to represent a JavaScript value 118 */ 119 napi_value PublishReminderMgr(napi_env env, napi_callback_info info); 120 121 /** 122 * @brief Adds a slot type(designed for error code). 123 * 124 * @param env Indicates the context. 125 * @param info Indicates the opaque datatype about the context. 126 * @return opaque pointer that is used to represent a JavaScript value. 127 */ 128 napi_value AddSlotMgr(napi_env env, napi_callback_info info); 129 130 /** 131 * @brief Add exclude date. 132 * 133 * @param env Indicates the context. 134 * @param info Indicates the opaque datatype about the context. 135 * @return opaque pointer that is used to represent a JavaScript value. 136 */ 137 napi_value AddExcludeDate(napi_env env, napi_callback_info info); 138 139 /** 140 * @brief Del exclude dates. 141 * 142 * @param env Indicates the context. 143 * @param info Indicates the opaque datatype about the context. 144 * @return opaque pointer that is used to represent a JavaScript value. 145 */ 146 napi_value DelExcludeDates(napi_env env, napi_callback_info info); 147 148 /** 149 * @brief Get exclude dates. 150 * 151 * @param env Indicates the context. 152 * @param info Indicates the opaque datatype about the context. 153 * @return opaque pointer that is used to represent a JavaScript value. 154 */ 155 napi_value GetExcludeDates(napi_env env, napi_callback_info info); 156 } // namespace ReminderAgentNapi 157 } // namespace OHOS 158 159 #endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_FRAMEWORKS_JS_NAPI_INCLUDE_REMINDER_PUBLISH_H 160