1 /* 2 * Copyright (C) 2025-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 FULL_SCREEN_MAGNIFICATION_MANAGER_H 17 #define FULL_SCREEN_MAGNIFICATION_MANAGER_H 18 19 #include "hilog_wrapper.h" 20 #include "magnification_def.h" 21 #include "ffrt.h" 22 #include "magnification_window_proxy.h" 23 24 namespace OHOS { 25 namespace Accessibility { 26 27 class FullScreenMagnificationManager { 28 public: 29 FullScreenMagnificationManager(); 30 explicit FullScreenMagnificationManager(std::shared_ptr<MagnificationWindowProxy> proxy); 31 ~FullScreenMagnificationManager() = default; 32 33 void EnableMagnification(int32_t centerX, int32_t centerY); 34 void ShowMagnification(); 35 void ShowMagnificationWithPosition(PointerPos pos); 36 void DisableMagnification(bool needClear = false); 37 PointerPos ConvertCoordinates(int32_t posX, int32_t posY); 38 void RefreshWindowParam(RotationType type); 39 void SetScale(float scaleSpan); 40 void MoveMagnification(int32_t deltaX, int32_t deltaY); 41 void PersistScale(); 42 PointerPos ConvertGesture(uint32_t type, PointerPos coordinates); 43 uint32_t CheckTapOnHotArea(int32_t posX, int32_t posY); 44 void FollowFocuseElement(int32_t centerX, int32_t centerY); 45 PointerPos GetSourceCenter(); 46 bool IsMagnificationWindowShow(); 47 float GetScale(); 48 private: 49 ffrt::mutex mutex_; 50 std::shared_ptr<MagnificationWindowProxy> windowProxy_ = nullptr; 51 }; 52 } // namespace Accessibility 53 } // namespace OHOS 54 #endif // FULL_SCREEN_MAGNIFICATION_MANAGER_H