• 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_DEF_H
17 #define MAGNIFICATION_MANAGER_DEF_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace Accessibility {
23 
24 struct PointerPos {
25     int32_t posX;
26     int32_t posY;
27 };
28 
29 enum class AnnounceType : uint32_t {
30     ANNOUNCE_MAGNIFICATION_SCALE,
31     ANNOUNCE_MAGNIFICATION_DISABLE,
32     ANNOUNCE_SWITCH_FULL_SCREEN,
33     ANNOUNCE_SWITCH_WINDOW
34 };
35 
36 enum class RotationType : uint32_t {
37     LEFT_ROTATE = 0,
38     RIGHT_ROTATE,
39     FLIP_VERTICAL,
40     NO_CHANGE,
41     UNKNOWN
42 };
43 
44 constexpr float EPS = 1e-6;
45 constexpr float DEFAULT_SCALE = 2.0f;
46 constexpr float MAX_SCALE = 8.0f;
47 constexpr uint8_t BG_ALPHA = 254;
48 constexpr float CORNER_RADIUS = 75.0f;
49 constexpr float MENU_CORNER_RADIUS = 25.0f;
50 constexpr float PEN_WIDTH = 15.0f;
51 constexpr int32_t DIVISOR_TWO = 2;
52 constexpr int32_t ROUND_RECT_MARGIN = 5;
53 constexpr int32_t ANCHOR_OFFSET = 20;
54 constexpr float HALF = 0.5f;
55 constexpr float MIN_SCALE_DISTANCE = 200.0f;
56 constexpr int32_t SCROLL_SHOT_POINTER_ID = 20001;
57 constexpr int32_t DEFAULT_POINTER_ID = 0;
58 constexpr uint32_t TAP_COUNT_TWO = 2;
59 
60 constexpr uint32_t MAGNIFY_WINDOW_WIDTH = 940;
61 constexpr uint32_t MAGNIFY_WINDOW_HEIGHT = 550;
62 constexpr uint32_t BAR_MARGIN = 40;
63 constexpr uint32_t HOT_AREA_WIDTH = 60;
64 constexpr int32_t GESTURE_OFFSET = 100;
65 constexpr int32_t BAR_START = 400;
66 constexpr int32_t BAR_END = 550;
67 
68 constexpr uint32_t FULL_SCREEN_MAGNIFICATION = 1;
69 constexpr uint32_t WINDOW_MAGNIFICATION = 2;
70 constexpr uint32_t SWITCH_MAGNIFICATION = 3;
71 constexpr uint32_t INPUT_METHOD_WINDOW_TYPE = 2105;
72 constexpr uint32_t ORANGE_COLOR = 0xFFFFA500;
73 
74 constexpr uint32_t INVALID_GESTURE_TYPE = 0;
75 constexpr uint32_t LEFT_BACK_GESTURE = 1; // Swipe from the left side of the screen inward
76 constexpr uint32_t RIGHT_BACK_GESTURE = 2; // Swipe from the right side of the screen inward
77 constexpr uint32_t BOTTOM_BACK_GESTURE = 3; // Swipe from the bottom side of the screen inward
78 } // namespace Accessibility
79 } // namespace OHOS
80 #endif // MAGNIFICATION_MANAGER_DEF_H