1 /* 2 * Copyright (c) 2022-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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_LIST_ITEM_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_LIST_ITEM_MODEL_IMPL_H 18 19 #include "core/components_ng/pattern/list/list_item_model.h" 20 21 namespace OHOS::Ace::Framework { 22 23 class ListItemModelImpl : public ListItemModel { 24 public: 25 ListItemModelImpl() = default; 26 ~ListItemModelImpl() override = default; 27 28 void Create(std::function<void(int32_t)>&& deepRenderFunc, V2::ListItemStyle listItemStyle, 29 bool isCreateArc = false) override; 30 void Create(bool isCreateArc = false) override; OnDidPop()31 void OnDidPop() override {} 32 void SetBorderRadius(const Dimension& borderRadius) override; 33 void SetType(const std::string& type) override; 34 void SetIsLazyCreating(bool isLazy) override; 35 void SetSticky(V2::StickyMode stickyMode) override; 36 void SetEditMode(uint32_t editMode) override; 37 void SetSelectable(bool selectable) override; SetSelected(bool selected)38 void SetSelected(bool selected) override {}; SetSelectChangeEvent(std::function<void (bool)> && changeEvent)39 void SetSelectChangeEvent(std::function<void(bool)>&& changeEvent) override {}; 40 void SetSwiperAction(std::function<void()>&& startAction, std::function<void()>&& endAction, 41 [[maybe_unused]] OnOffsetChangeFunc&& onOffsetChangeFunc, V2::SwipeEdgeEffect edgeEffect, 42 NG::FrameNode* node = nullptr) override; 43 void SetSelectCallback(OnSelectFunc&& selectCallback) override; 44 void SetOnDragStart(NG::OnDragStartFunc&& onDragStart) override; 45 void SetDeleteArea(std::function<void()>&& builderAction, OnDeleteEvent&& onDelete, 46 OnEnterDeleteAreaEvent&& onEnterDeleteArea, OnExitDeleteAreaEvent&& onExitDeleteArea, 47 OnStateChangedEvent&& onStateChange, const Dimension& length, bool isStartArea, 48 NG::FrameNode* node = nullptr) override; 49 void SetDeleteAreaWithFrameNode(const RefPtr<NG::UINode>& builderComponent, OnDeleteEvent&& onDelete, 50 OnEnterDeleteAreaEvent&& onEnterDeleteArea, OnExitDeleteAreaEvent&& onExitDeleteArea, 51 OnStateChangedEvent&& onStateChange, const Dimension& length, bool isStartArea, NG::FrameNode* node) override; 52 }; 53 54 } // namespace OHOS::Ace::Framework 55 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_LIST_ITEM_MODEL_IMPL_H 56