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_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) override;
29     void Create() override;
OnDidPop()30     void OnDidPop() override {}
31     void SetBorderRadius(const Dimension& borderRadius) override;
32     void SetType(const std::string& type) override;
33     void SetIsLazyCreating(bool isLazy) override;
34     void SetSticky(V2::StickyMode stickyMode) override;
35     void SetEditMode(uint32_t editMode) override;
36     void SetSelectable(bool selectable) override;
SetSelected(bool selected)37     void SetSelected(bool selected) override {};
SetSelectChangeEvent(std::function<void (bool)> && changeEvent)38     void SetSelectChangeEvent(std::function<void(bool)>&& changeEvent) override {};
39     void SetSwiperAction(std::function<void()>&& startAction, std::function<void()>&& endAction,
40         [[maybe_unused]] OnOffsetChangeFunc&& onOffsetChangeFunc, V2::SwipeEdgeEffect edgeEffect) override;
41     void SetSelectCallback(OnSelectFunc&& selectCallback) override;
42     void SetOnDragStart(NG::OnDragStartFunc&& onDragStart) override;
43     void SetDeleteArea(std::function<void()>&& builderAction, OnDeleteEvent&& onDelete,
44         OnEnterDeleteAreaEvent&& onEnterDeleteArea, OnExitDeleteAreaEvent&& onExitDeleteArea,
45         OnStateChangedEvent&& onStateChange, const Dimension& length, bool isStartArea) override;
46 };
47 
48 } // namespace OHOS::Ace::Framework
49 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_LIST_ITEM_MODEL_IMPL_H
50