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