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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SWIPER_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SWIPER_MODEL_IMPL_H 18 19 #include "core/components_ng/pattern/swiper/swiper_model.h" 20 21 namespace OHOS::Ace::Framework { 22 23 class ACE_EXPORT SwiperModelImpl : public OHOS::Ace::SwiperModel { 24 public: 25 RefPtr<SwiperController> Create() override; 26 void SetDirection(Axis axis) override; 27 void SetIndex(uint32_t index) override; 28 void SetAutoPlay(bool autoPlay) override; 29 void SetAutoPlayInterval(uint32_t interval) override; 30 void SetDuration(uint32_t duration) override; 31 void SetCurve(const RefPtr<Curve>& curve) override; 32 void SetLoop(bool loop) override; 33 void SetEnabled(bool enabled) override; 34 void SetDisableSwipe(bool disableSwipe) override; 35 void SetEdgeEffect(EdgeEffect EdgeEffect) override; 36 void SetDisplayMode(SwiperDisplayMode displayMode) override; 37 void SetDisplayCount(int32_t displayCount) override; SetMinSize(const Dimension & minSize)38 void SetMinSize(const Dimension& minSize) override {}; 39 void SetShowIndicator(bool showIndicator) override; 40 void SetItemSpace(const Dimension& itemSpace) override; 41 void SetCachedCount(int32_t cachedCount) override; 42 void SetOnChange(std::function<void(const BaseEventInfo* info)>&& onChange) override; 43 void SetOnAnimationStart(std::function<void(const BaseEventInfo* info)>&& onAnimationStart) override; 44 void SetOnAnimationEnd(std::function<void(const BaseEventInfo* info)>&& onAnimationEnd) override; 45 46 void SetRemoteMessageEventId(RemoteCallback&& remoteCallback) override; 47 void SetOnClick( 48 std::function<void(const BaseEventInfo* info, const RefPtr<V2::InspectorFunctionImpl>& impl)>&& value) override; 49 void SetMainSwiperSizeWidth() override; 50 void SetMainSwiperSizeHeight() override; 51 void SetIndicatorStyle(const SwiperParameters& swiperParameters) override; SetOnChangeEvent(std::function<void (const BaseEventInfo * info)> && onChangeEvent)52 void SetOnChangeEvent(std::function<void(const BaseEventInfo* info)>&& onChangeEvent) override {}; 53 }; 54 55 } // namespace OHOS::Ace::Framework 56 57 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SWIPER_MODEL_IMPL_H 58