• 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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_GESTURE_MODEL_IMPL_H
17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_GESTURE_MODEL_IMPL_H
18 
19 #include "core/components_ng/pattern/gesture/gesture_model.h"
20 #include "core/components_ng/gestures/gesture_info.h"
21 
22 namespace OHOS::Ace::Framework {
23 class GestureModelImpl : public OHOS::Ace::GestureModel {
24 public:
25     void Create(int32_t priorityNum, int32_t gestureMaskNum) override;
26     void Finish() override;
27     void Pop() override;
28     void SetOnGestureEvent(const GestureEventFunc& gestureEventFunc) override;
29     void SetOnActionFunc(const GestureEventFunc& gestureEventFunc, const Ace::GestureEventAction& action) override;
SetTag(const std::string & tag)30     void SetTag(const std::string& tag) override {}
SetAllowedTypes(const std::set<SourceTool> & allowedTypes)31     void SetAllowedTypes(const std::set<SourceTool>& allowedTypes) override {}
32 };
33 
34 class TapGestureModelImpl : public OHOS::Ace::TapGestureModel {
35 public:
36     void Create(int32_t countNum, int32_t fingersNum, double distanceThreshold, bool isLimitFingerCount) override;
37 };
38 
39 class LongPressGestureModelImpl : public OHOS::Ace::LongPressGestureModel {
40 public:
41     void Create(int32_t fingersNum, bool repeatResult, int32_t durationNum, bool isLimitFingerCount) override;
42 };
43 
44 class PanGestureModelImpl : public OHOS::Ace::PanGestureModel {
45 public:
46     void Create(
47         int32_t fingersNum, const PanDirection& panDirection, double distanceNum, bool isLimitFingerCount) override;
48     void Create(int32_t fingersNum, const PanDirection& panDirection, const PanDistanceMapDimension& distanceMap,
49         bool isLimitFingerCount) override;
50     void SetPanGestureOption(const RefPtr<PanGestureOption>& panGestureOption) override;
51 };
52 
53 class SwipeGestureModelImpl : public OHOS::Ace::SwipeGestureModel {
54 public:
55     void Create(
56         int32_t fingersNum, const SwipeDirection& slideDirection, double speedNum, bool isLimitFingerCount) override;
57 };
58 
59 class PinchGestureModelImpl : public OHOS::Ace::PinchGestureModel {
60 public:
61     void Create(int32_t fingersNum, double distanceNum, bool isLimitFingerCount) override;
62 };
63 
64 class RotationGestureModelImpl : public OHOS::Ace::RotationGestureModel {
65 public:
66     void Create(int32_t fingersNum, double angleNum, bool isLimitFingerCount) override;
67 };
68 
69 class GestureGroupModelImpl : public OHOS::Ace::GestureGroupModel {
70 public:
71     void Create(int32_t gestureMode) override;
72 };
73 
74 class ACE_EXPORT TimeoutGestureModelImpl : public OHOS::Ace::TimeoutGestureModel {
75 public:
76     RefPtr<GestureProcessor> GetGestureProcessor() override;
77 };
78 } // namespace OHOS::Ace::Framework
79 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_GESTURE_MODEL_IMPL_H
80