1 /* 2 * Copyright (c) 2021 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 BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_NOTIFICATION_FILTER_H 17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_NOTIFICATION_FILTER_H 18 19 #include <memory> 20 21 #include "errors.h" 22 23 #include "notification_record.h" 24 25 namespace OHOS { 26 namespace Notification { 27 class INotificationFilter { 28 public: INotificationFilter()29 INotificationFilter() {}; ~INotificationFilter()30 virtual ~INotificationFilter() {}; 31 32 /** 33 * @brief Start the filter. 34 */ 35 virtual void OnStart() = 0; 36 37 /** 38 * @brief Stop the filter. 39 */ 40 virtual void OnStop() = 0; 41 42 /** 43 * @brief Filters the publish operation. 44 * 45 * @param record Indicates the NotificationRecord. 46 * @return Returns the filter result. 47 */ 48 virtual ErrCode OnPublish(const std::shared_ptr<NotificationRecord> &record) = 0; 49 }; 50 } // namespace Notification 51 } // namespace OHOS 52 53 #endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_NOTIFICATION_FILTER_H