1 /*
2  * Copyright (c) 2024 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_MAGNIFIER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_MAGNIFIER_H
18 
19 #include "base/memory/referenced.h"
20 #include "base/memory/type_info_base.h"
21 #include "core/components_ng/pattern/select_overlay/magnifier_controller.h"
22 
23 namespace OHOS::Ace::NG {
24 namespace {
25 constexpr Dimension MAGNIFIER_WIDTH = 112.0_vp;
26 constexpr Dimension MAGNIFIER_HEIGHT = 72.0_vp;
27 constexpr Dimension MAGNIFIER_OFFSETX = 0.0_vp;
28 constexpr Dimension MAGNIFIER_OFFSETY = 80.0_vp;
29 constexpr Dimension MAGNIFIER_BORDERWIDTH = 2.0_vp;
30 constexpr Dimension MAGNIFIER_CORNERRADIUS = 36.0_vp;
31 
32 constexpr Dimension MAGNIFIER_SHADOWOFFSETX = 0.0_vp;
33 constexpr Dimension MAGNIFIER_SHADOWOFFSETY = 8.0_vp;
34 constexpr Dimension MAGNIFIER_SHADOWSIZE = 10.0_vp;
35 constexpr float MAGNIFIER_FACTOR = 1.4f;
36 constexpr float MAGNIFIER_SHADOWSTRENGTH = 0.08f;
37 constexpr int32_t ANIMATION_DURATION_150 = 150;
38 } // namespace
39 class Magnifier : public virtual AceType {
40     DECLARE_ACE_TYPE(Magnifier, AceType);
41 
42 public:
GetMagnifierController()43     RefPtr<MagnifierController> GetMagnifierController()
44     {
45         return magnifierController_;
46     }
47     RefPtr<MagnifierController> magnifierController_;
48 };
49 } // namespace OHOS::Ace::NG
50 
51 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_MAGNIFIER_H