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_PATTERN_SWIPER_SWIPER_HELPER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_SWIPER_SWIPER_HELPER_H
18 #include "swiper_pattern.h"
19 
20 #include "core/components/swiper/swiper_controller.h"
21 namespace OHOS::Ace::NG {
22 /* implements helper functions for SwiperPattern */
23 class SwiperHelper {
24 public:
25     /* Init controller of swiper, controller support showNext, showPrevious and finishAnimation interface. */
26     static void InitSwiperController(const RefPtr<SwiperController>& controller, const WeakPtr<SwiperPattern>& weak);
27 
28     static void SaveDigitIndicatorProperty(const RefPtr<FrameNode>& indicatorNode, SwiperPattern& swiper);
29     static void SaveDotIndicatorProperty(const RefPtr<FrameNode>& indicatorNode, SwiperPattern& swiper);
30 
31     static void DumpAdvanceInfo(SwiperPattern& swiper);
32 
33     static std::string GetDotIndicatorStyle(const std::shared_ptr<SwiperParameters>& params);
34     static std::string GetDigitIndicatorStyle(const std::shared_ptr<SwiperDigitalParameters>& params);
35 
36 private:
37     static void DumpInfoAddPositionDesc(SwiperPattern& swiper);
38     static void DumpInfoAddGestureDesc(SwiperPattern& swiper);
39     static void DumpInfoAddAnimationDesc(SwiperPattern& swiper);
40 };
41 } // namespace OHOS::Ace::NG
42 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_SWIPER_SWIPER_HELPER_H
43