1 /* 2 * Copyright (c) 2024-2025 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 HIAPPEVENT_NDK_APPEVENT_PROCESSOR_H 17 #define HIAPPEVENT_NDK_APPEVENT_PROCESSOR_H 18 19 #include "base_type.h" 20 21 namespace OHOS { 22 namespace HiviewDFX { 23 class NdkAppEventProcessor { 24 public: 25 explicit NdkAppEventProcessor(const std::string& name); 26 NdkAppEventProcessor(const NdkAppEventProcessor&) = delete; 27 NdkAppEventProcessor(const NdkAppEventProcessor&&) = delete; 28 NdkAppEventProcessor& operator= (const NdkAppEventProcessor&) = delete; 29 NdkAppEventProcessor& operator= (const NdkAppEventProcessor&&) = delete; 30 31 int SetReportRoute(const char* appId, const char* routeInfo); 32 int SetReportPolicy(int periodReport, int batchReport, bool onStartReport, bool onBackgroundReport); 33 int SetReportEvent(const char* domain, const char* name, bool isRealTime); 34 int SetCustomConfig(const char* key, const char* value); 35 int SetConfigId(int configId); 36 int SetConfigName(const std::string& configName); 37 int SetReportUserId(const char* const * userIdNames, int size); 38 int SetReportUserProperty(const char* const * userPropertyNames, int size); 39 40 HiAppEvent::ReportConfig GetConfig(); 41 private: 42 HiAppEvent::ReportConfig config_; 43 }; 44 } // namespace HiviewDFX 45 } // namespace OHOS 46 #endif // HIAPPEVENT_NDK_APPEVENT_PROCESSOR_H 47