• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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_JS_GRID_H
17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_GRID_H
18 
19 #include "frameworks/bridge/declarative_frontend/jsview/js_container_base.h"
20 #include "frameworks/core/components/grid_layout/grid_layout_component.h"
21 
22 namespace OHOS::Ace::Framework {
23 
24 class JSGrid : public JSContainerBase {
25 public:
26     static void Create(const JSCallbackInfo& info);
27     static void JSBind(BindingTarget globalObj);
28 
29     static void PopGrid(const JSCallbackInfo& info);
30     static void UseProxy(const JSCallbackInfo& args);
31     static void SetColumnsTemplate(const std::string& value);
32     static void SetRowsTemplate(const std::string& value);
33     static void SetColumnsGap(const JSCallbackInfo& info);
34     static void SetRowsGap(const JSCallbackInfo& info);
35     static void SetScrollBar(int32_t displayMode);
36     static void SetScrollBarColor(const std::string& color);
37     static void SetScrollBarWidth(const std::string& scrollWidth);
38     static void JsOnScrollIndex(const JSCallbackInfo& info);
39     static void SetCachedCount(int32_t cachedCount);
40     static void SetEditMode(bool editMode);
41     static void SetMultiSelectable(bool multiSelectable);
42     static void SetMaxCount(double maxCount);
43     static void SetMinCount(double minCount);
44     static void CellLength(int32_t cellLength);
45     static void SetLayoutDirection(int32_t value);
46     static void SetDirection(const std::string& dir);
47     static void SetSupportAnimation(bool supportAnimation);
48     static void SetDragAnimation(bool value);
49     static void SetEdgeEffect(int32_t value);
50     static void JsOnGridDragEnter(const JSCallbackInfo& info);
51     static void JsOnGridDragMove(const JSCallbackInfo& info);
52     static void JsOnGridDragLeave(const JSCallbackInfo& info);
53     static void JsOnGridDragStart(const JSCallbackInfo& info);
54     static void JsOnGridDrop(const JSCallbackInfo& info);
55     static void JsGridHeight(const JSCallbackInfo& info);
56 };
57 
58 } // namespace OHOS::Ace::Framework
59 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_GRID_H
60