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 #ifndef HIAPPEVENT_INTERFACES_NATIVE_INNER_API_INCLUDE_APP_EVENT_PROCESSOR_H 16 #define HIAPPEVENT_INTERFACES_NATIVE_INNER_API_INCLUDE_APP_EVENT_PROCESSOR_H 17 18 #include <string> 19 20 #include "base_type.h" 21 22 namespace OHOS { 23 namespace HiviewDFX { 24 namespace HiAppEvent { 25 struct AppEventInfo { 26 std::string domain; 27 std::string name; 28 int eventType = 0; 29 uint64_t timestamp = 0; 30 std::string params; 31 }; 32 33 class AppEventProcessor { 34 public: 35 AppEventProcessor() = default; 36 virtual ~AppEventProcessor() = default; 37 38 virtual int OnReport( 39 int64_t processorSeq, 40 const std::vector<UserId>& userIds, 41 const std::vector<UserProperty>& userProperties, 42 const std::vector<AppEventInfo>& events) = 0; 43 virtual int ValidateUserId(const UserId& userId) = 0; 44 virtual int ValidateUserProperty(const UserProperty& userProperty) = 0; 45 virtual int ValidateEvent(const AppEventInfo& event) = 0; 46 }; 47 } // namespace HiAppEvent 48 } // namespace HiviewDFX 49 } // namespace OHOS 50 #endif // HIAPPEVENT_INTERFACES_NATIVE_INNER_API_INCLUDE_APP_EVENT_PROCESSOR_H 51