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_GRID_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_GRID_MODEL_IMPL_H 18 19 #include "core/components_ng/pattern/grid/grid_model.h" 20 #include "frameworks/bridge/declarative_frontend/jsview/js_interactable_view.h" 21 22 namespace OHOS::Ace::Framework { 23 24 class GridModelImpl : public OHOS::Ace::GridModel { 25 public: 26 void Create( 27 const RefPtr<ScrollControllerBase>& positionController, const RefPtr<ScrollProxy>& scrollBarProxy) override; 28 void Pop() override; 29 void SetColumnsTemplate(const std::string& value) override; 30 void SetRowsTemplate(const std::string& value) override; 31 void SetColumnsGap(const Dimension& value) override; 32 void SetRowsGap(const Dimension& value) override; 33 void SetGridHeight(const Dimension& value) override; 34 void SetScrollBarMode(int32_t value) override; 35 void SetScrollBarColor(const std::string& value) override; 36 void SetScrollBarWidth(const std::string& value) override; 37 void SetCachedCount(int32_t value) override; 38 void SetIsRTL(bool rightToLeft) override; 39 void SetLayoutDirection(FlexDirection value) override; 40 void SetMaxCount(int32_t value) override; 41 void SetMinCount(int32_t value) override; 42 void SetCellLength(int32_t value) override; 43 void SetEditable(bool value) override; 44 void SetMultiSelectable(bool value) override; 45 void SetSupportAnimation(bool value) override; 46 void SetSupportDragAnimation(bool value) override; 47 void SetEdgeEffect(EdgeEffect edgeEffect) override; 48 void SetOnScrollToIndex(std::function<void(const BaseEventInfo*)>&& value) override; 49 void SetOnItemDragStart(std::function<void(const ItemDragInfo&, int32_t)>&& value) override; 50 void SetOnItemDragEnter(std::function<void(const ItemDragInfo&)>&& value) override; 51 void SetOnItemDragMove(std::function<void(const ItemDragInfo&, int32_t, int32_t)>&& value) override; 52 void SetOnItemDragLeave(std::function<void(const ItemDragInfo&, int32_t)>&& value) override; 53 void SetOnItemDrop(std::function<void(const ItemDragInfo&, int32_t, int32_t, bool)>&& value) override; 54 RefPtr<ScrollControllerBase> CreatePositionController() override; 55 RefPtr<ScrollProxy> CreateScrollBarProxy() override; 56 }; 57 58 } // namespace OHOS::Ace::Framework 59 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_GRID_MODEL_IMPL_H 60