• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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_SWIPER_SWIPER_MODEL_NG_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_SWIPER_SWIPER_MODEL_NG_H
18 
19 #include "base/geometry/axis.h"
20 #include "base/geometry/dimension.h"
21 #include "base/memory/referenced.h"
22 #include "base/utils/macros.h"
23 #include "core/components/common/layout/constants.h"
24 #include "core/components/common/properties/scroll_bar.h"
25 #include "core/components/declaration/swiper/swiper_declaration.h"
26 #include "core/components_ng/pattern/swiper/swiper_event_hub.h"
27 #include "core/components_ng/pattern/swiper/swiper_model.h"
28 
29 namespace OHOS::Ace::NG {
30 
31 class ACE_EXPORT SwiperModelNG : public OHOS::Ace::SwiperModel {
32 public:
33     RefPtr<SwiperController> Create() override;
34     void SetDirection(Axis axis) override;
35     void SetIndex(uint32_t index) override;
36     void SetAutoPlay(bool autoPlay) override;
37     void SetAutoPlayInterval(uint32_t interval) override;
38     void SetDuration(uint32_t duration) override;
39     void SetCurve(const RefPtr<Curve>& curve) override;
40     void SetLoop(bool loop) override;
41     void SetEnabled(bool enabled) override;
42     void SetDisableSwipe(bool disableSwipe) override;
43     void SetEdgeEffect(EdgeEffect EdgeEffect) override;
44     void SetDisplayMode(SwiperDisplayMode displayMode) override;
45     void SetDisplayCount(int32_t displayCount) override;
46     void SetShowIndicator(bool showIndicator) override;
47     void SetItemSpace(const Dimension& itemSpace) override;
48     void SetCachedCount(int32_t cachedCount) override;
49     void SetOnChange(std::function<void(const BaseEventInfo* info)>&& onChange) override;
50     void SetOnAnimationStart(std::function<void(const BaseEventInfo* info)>&& onAnimationStart) override;
51     void SetOnAnimationEnd(std::function<void(const BaseEventInfo* info)>&& onAnimationEnd) override;
52 
53     void SetRemoteMessageEventId(RemoteCallback&& remoteCallback) override;
54     void SetOnClick(
55         std::function<void(const BaseEventInfo* info, const RefPtr<V2::InspectorFunctionImpl>& impl)>&& value) override;
56     void SetMainSwiperSizeWidth() override;
57     void SetMainSwiperSizeHeight() override;
58     void SetIndicatorStyle(const SwiperParameters& swiperParameters) override;
59 };
60 
61 } // namespace OHOS::Ace::NG
62 
63 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_SWIPER_SWIPER_MODEL_NG_H
64