• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_SCROLLABLE_SCROLLABLE_MODEL_NG_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_SCROLLABLE_SCROLLABLE_MODEL_NG_H
18 
19 #include "base/utils/macros.h"
20 #include "core/components_ng/base/frame_node.h"
21 #include "core/components/common/layout/constants.h"
22 #include "core/components_ng/pattern/scrollable/scrollable_properties.h"
23 
24 namespace OHOS::Ace::NG {
25 class ACE_EXPORT ScrollableModelNG {
26 public:
27     static void SetEdgeEffect(EdgeEffect edgeEffect, bool alwaysEnabled);
28 
29     static void SetScrollBarMode(DisplayMode value);
30     static void SetScrollBarColor(const std::string& value);
31     static void SetScrollBarWidth(const std::string& value);
32 
33     static void SetOnScroll(OnScrollEvent&& onScroll);
34     static void SetOnScrollStart(OnScrollStartEvent&& onScrollStart);
35     static void SetOnScrollStop(OnScrollStopEvent&& onScrollStop);
36     static void SetOnReachStart(OnReachEvent&& onReachStart);
37     static void SetOnReachEnd(OnReachEvent&& onReachEnd);
38     static void SetOnScrollFrameBegin(OnScrollFrameBeginEvent&& ScrollFrameBegin);
39 
40     static void SetEdgeEffect(FrameNode* frameNode, EdgeEffect edgeEffect, bool alwaysEnabled);
41     static void SetScrollBarMode(FrameNode* frameNode, int32_t displayNumber);
42     static void SetScrollBarWidth(FrameNode* frameNode, const std::string& value);
43     static void SetScrollBarColor(FrameNode* frameNode, const std::string& value);
44     static void SetMaxFlingSpeed(double max);
45 };
46 } // namespace OHOS::Ace::NG
47 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_SCROLLABLE_SCROLLABLE_MODEL_H
48