/* * Copyright (c) 2022-2023 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. */ #ifndef RESSCHED_PLUGINS_SOCPERF_PLUGIN_INCLUDE_SOCPERF_PLUGIN_H #define RESSCHED_PLUGINS_SOCPERF_PLUGIN_INCLUDE_SOCPERF_PLUGIN_H #ifdef RESSCHED_RESOURCESCHEDULE_SOC_PERF_ENABLE #include #include #include "plugin.h" #include "single_instance.h" #include "socperf_client.h" namespace OHOS { namespace ResourceSchedule { class SocPerfPlugin : public Plugin { DECLARE_SINGLE_INSTANCE(SocPerfPlugin) public: void Init() override; void Disable() override; void DispatchResource(const std::shared_ptr& resData) override; private: std::set resTypes; std::unordered_map& data)>> functionMap; void InitFunctionMap(); void InitResTypes(); void HandleWindowFocus(const std::shared_ptr& data); void HandleEventClick(const std::shared_ptr& data); void HandleLoadPage(const std::shared_ptr& data); void HandlePopPage(const std::shared_ptr& data); void HandleEventSlide(const std::shared_ptr& data); void HandleEventWebGesture(const std::shared_ptr& data); void HandleAppAbilityStart(const std::shared_ptr& data); void HandleResizeWindow(const std::shared_ptr& data); void HandleMoveWindow(const std::shared_ptr& data); void HandleRemoteAnimation(const std::shared_ptr& data); bool InitFeatureSwitch(std::string featureName); void HandleDragStatusBar(const std::shared_ptr& data); void HandleWebGestureMove(const std::shared_ptr& data); void HandleWebSlideNormal(const std::shared_ptr& data); void HandleLoadUrl(const std::shared_ptr& data); void HandleMousewheel(const std::shared_ptr& data); void HandleAppStateChange(const std::shared_ptr& data); }; } // namespace ResourceSchedule } // namespace OHOS #endif //RESSCHED_RESOURCESCHEDULE_SOC_PERF_ENABLE #endif // RESSCHED_PLUGINS_SOCPERF_PLUGIN_INCLUDE_SOCPERF_PLUGIN_H