• 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_LIST_H
17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_LIST_H
18 
19 #include "bridge/declarative_frontend/engine/functions/js_function.h"
20 #include "bridge/declarative_frontend/jsview/js_container_base.h"
21 #include "bridge/declarative_frontend/jsview/js_scroller.h"
22 
23 namespace OHOS::Ace::Framework {
24 
25 class JSList : public JSContainerBase {
26 public:
27     static void JSBind(BindingTarget globalObj);
28     static void SetScroller(RefPtr<JSScroller> scroller);
29     static void Create(const JSCallbackInfo& args);
30 
31     static void JsWidth(const JSCallbackInfo& info);
32     static void JsHeight(const JSCallbackInfo& info);
33     static void ScrollCallback(const JSCallbackInfo& args);
34     static void ReachStartCallback(const JSCallbackInfo& args);
35     static void ReachEndCallback(const JSCallbackInfo& args);
36     static void ScrollStartCallback(const JSCallbackInfo& args);
37     static void ScrollStopCallback(const JSCallbackInfo& args);
38     static void ItemDeleteCallback(const JSCallbackInfo& args);
39     static void ItemMoveCallback(const JSCallbackInfo& args);
40     static void ScrollIndexCallback(const JSCallbackInfo& args);
41     static void ScrollBeginCallback(const JSCallbackInfo& args);
42     static void ScrollFrameBeginCallback(const JSCallbackInfo& args);
43 
44     static void SetDivider(const JSCallbackInfo& args);
45     static void SetDirection(int32_t direction);
46     static void SetScrollBar(const JSCallbackInfo& info);
47     static void SetEdgeEffect(int32_t edgeEffect);
48     static void SetEditMode(bool editMode);
49     static void SetCachedCount(const JSCallbackInfo& info);
50     static void SetChainAnimation(bool enableChainAnimation);
51     static void SetChainAnimationOptions(const JSCallbackInfo& info);
52     static void SetMultiSelectable(bool multiSelectable);
53     static void SetListItemAlign(int32_t itemAlignment);
54     static void SetLanes(const JSCallbackInfo& info);
55     static void SetSticky(int32_t sticky);
56     static void SetContentStartOffset(float startOffset);
57     static void SetContentEndOffset(float endOffset);
58     static void SetNestedScroll(const JSCallbackInfo& args);
59     static void SetScrollEnabled(const JSCallbackInfo& args);
60     static void SetScrollSnapAlign(int32_t scrollSnapAlign);
61     static void SetFriction(const JSCallbackInfo& info);
62 
63     static void ItemDragStartCallback(const JSCallbackInfo& info);
64     static void ItemDragEnterCallback(const JSCallbackInfo& info);
65     static void ItemDragMoveCallback(const JSCallbackInfo& info);
66     static void ItemDragLeaveCallback(const JSCallbackInfo& info);
67     static void ItemDropCallback(const JSCallbackInfo& info);
68 };
69 
70 } // namespace OHOS::Ace::Framework
71 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_LIST_H
72