• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_REFRESH_MODEL_NG_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_REFRESH_MODEL_NG_H
18 
19 #include <string>
20 
21 #include "frameworks/base/geometry/dimension.h"
22 #include "frameworks/base/utils/macros.h"
23 #include "frameworks/core/components/common/properties/color.h"
24 #include "frameworks/core/components_ng/pattern/refresh/refresh_model.h"
25 #include "frameworks/core/components_ng/pattern/refresh/refresh_pattern.h"
26 
27 namespace OHOS::Ace::NG {
28 
29 class ACE_EXPORT RefreshModelNG : public RefreshModel {
30 public:
31     void Create() override;
32     void Pop() override;
33     void SetRefreshing(bool isRefreshing) override;
34     void SetRefreshDistance(const Dimension& refreshDistance) override;
35     void SetUseOffset(bool isUseOffset) override;
36     void SetIndicatorOffset(const Dimension& indicatorOffset) override;
37     void SetFriction(int32_t friction) override;
38     void IsRefresh(bool isRefresh) override;
39 
40     void SetLoadingDistance(const Dimension& loadingDistance) override;
41     void SetProgressDistance(const Dimension& progressDistance) override;
42     void SetProgressDiameter(const Dimension& progressDiameter) override;
43     void SetMaxDistance(const Dimension& maxDistance) override;
44     void SetIsShowLastTime(bool IsShowLastTime) override;
45     void SetShowTimeDistance(const Dimension& showTimeDistance) override;
46 
47     void SetTextStyle(const TextStyle& textStyle) override;
48     void SetProgressColor(const Color& progressColor) override;
49     void SetProgressBackgroundColor(const Color& backgroundColor) override;
50     void SetOnStateChange(StateChangeEvent&& stateChange) override;
51     void SetOnRefreshing(RefreshingEvent&& refreshing) override;
52     void SetChangeEvent(ChangeEvent&& changeEvent) override;
53 };
54 } // namespace OHOS::Ace::NG
55 
56 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_REFRESH_MODEL_NG_H