• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 MAGNIFICATION_MANAGER_H
17 #define MAGNIFICATION_MANAGER_H
18 
19 #include "window_magnification_manager.h"
20 #include "full_screen_magnification_manager.h"
21 #include "magnification_menu_manager.h"
22 #include "magnification_window_proxy.h"
23 
24 namespace OHOS {
25 namespace Accessibility {
26 class MagnificationManager {
27 public:
28     MagnificationManager();
29     ~MagnificationManager() = default;
30 
31     std::shared_ptr<WindowMagnificationManager> GetWindowMagnificationManager();
32     std::shared_ptr<FullScreenMagnificationManager> GetFullScreenMagnificationManager();
33     std::shared_ptr<MagnificationMenuManager> GetMenuManager();
34     void OnMagnificationTypeChanged(uint32_t magnificationType);
35     void OnModeChanged(uint32_t mode);
36     void DisableMagnification();
37     void TriggerMagnification(uint32_t type, uint32_t mode);
38     bool GetMagnificationState();
39     void RefreshWindowParam(RotationType type);
40     void FollowFocuseElement(int32_t centerX, int32_t centerY);
ResetCurrentMode()41     inline void ResetCurrentMode()
42     {
43         currentMode_ = 0;
44     }
45 private:
46     std::shared_ptr<WindowMagnificationManager> windowMagnificationManager_ = nullptr;
47     std::shared_ptr<FullScreenMagnificationManager> fullScreenMagnificationManager_ = nullptr;
48     std::shared_ptr<MagnificationMenuManager> menuManager_ = nullptr;
49     uint32_t currentMode_ = 0;
50     std::shared_ptr<MagnificationWindowProxy> windowProxy_ = nullptr;
51 };
52 } // namespace Accessibility
53 } // namespace OHOS
54 #endif // MAGNIFICATION_MANAGER_H