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 GestureEventNoParameter& gestureEventNoParameter) 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) override;
37 };
38 
39 class LongPressGestureModelImpl : public OHOS::Ace::LongPressGestureModel {
40 public:
41     void Create(int32_t fingersNum, bool repeatResult, int32_t durationNum) override;
42 };
43 
44 class PanGestureModelImpl : public OHOS::Ace::PanGestureModel {
45 public:
46     void Create(int32_t fingersNum, const PanDirection& panDirection, double distanceNum) override;
47     void SetPanGestureOption(const RefPtr<PanGestureOption>& panGestureOption) override;
48 };
49 
50 class SwipeGestureModelImpl : public OHOS::Ace::SwipeGestureModel {
51 public:
52     void Create(int32_t fingersNum, const SwipeDirection& slideDirection, double speedNum) override;
53 };
54 
55 class PinchGestureModelImpl : public OHOS::Ace::PinchGestureModel {
56 public:
57     void Create(int32_t fingersNum, double distanceNum) override;
58 };
59 
60 class RotationGestureModelImpl : public OHOS::Ace::RotationGestureModel {
61 public:
62     void Create(int32_t fingersNum, double angleNum) override;
63 };
64 
65 class GestureGroupModelImpl : public OHOS::Ace::GestureGroupModel {
66 public:
67     void Create(int32_t gestureMode) override;
68 };
69 
70 class ACE_EXPORT TimeoutGestureModelImpl : public OHOS::Ace::TimeoutGestureModel {
71 public:
72     RefPtr<GestureProcessor> GetGestureProcessor() override;
73 };
74 } // namespace OHOS::Ace::Framework
75 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_GESTURE_MODEL_IMPL_H
76