1 /*
2  * Copyright (c) 2024 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 OH_AXIS_TYPE_H
17 #define OH_AXIS_TYPE_H
18 
19 /**
20  * @addtogroup input
21  * @{
22  *
23  * @brief Provides the C interface in the multi-modal input domain.
24  *
25  * @since 12
26  */
27 
28 /**
29  * @file oh_axis_type.h
30  *
31  * @brief Defines the axis event-specific structure and enumerations.
32  * @kit InputKit
33  * @syscap SystemCapability.MultimodalInput.Input.Core
34  * @library liboh_input.so
35  * @since 12
36  */
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /**
43  * @brief Enumerates axis types.
44  *
45  * @since 12
46  */
47 typedef enum InputEvent_AxisType {
48     /**
49      * Indicates an unknown axis type. It is generally used as the initial value.
50      *
51      * @since 12
52      */
53     AXIS_TYPE_UNKNOWN,
54 
55     /**
56      * Indicates the vertical scroll axis. When you scroll the mouse wheel or make certain gestures on the touchpad,
57      * the status of the vertical scroll axis changes.
58      *
59      * @since 12
60      */
61     AXIS_TYPE_SCROLL_VERTICAL,
62 
63     /**
64      * Indicates the horizontal scroll axis.
65      * When you scroll the mouse wheel or make certain gestures on the touchpad,
66      * the status of the horizontal scroll axis changes.
67      *
68      * @since 12
69      */
70     AXIS_TYPE_SCROLL_HORIZONTAL,
71 
72     /**
73      * Indicates the pinch axis, which is used to describe a pinch gesture on the touchscreen or touchpad.
74      *
75      * @since 12
76      */
77     AXIS_TYPE_PINCH,
78 
79     /**
80      * Indicates the rotate axis, which is used to describe a rotate gesture on the touchpad.
81      *
82      * @since 12
83      */
84     AXIS_TYPE_ROTATE
85 } InputEvent_AxisType;
86 
87 /**
88  * @brief Enumerates axis event types.
89  *
90  * @since 12
91  */
92 typedef enum InputEvent_AxisEventType {
93     /**
94      * @brief Enumerates two-finger pinch events. The axis value can be AXIS_TYPE_PINCH or AXIS_TYPE_ROTATE.
95      *
96      * @since 12
97      */
98     AXIS_EVENT_TYPE_PINCH = 1,
99     /**
100      * @brief Enumerates scroll axis events.
101      * The axis value can be AXIS_TYPE_SCROLL_VERTICAL or AXIS_TYPE_SCROLL_HORIZONTAL.
102      * Wherein, the value of AXIS_TYPE_SCROLL_HORIZONTAL is 0 for a mouse wheel event.
103      *
104      * @since 12
105      */
106     AXIS_EVENT_TYPE_SCROLL = 2
107 } InputEvent_AxisEventType;
108 
109 /**
110  * @brief Enumerates axis event actions.
111  *
112  * @since 12
113  */
114 typedef enum InputEvent_AxisAction {
115     /**
116      * Cancel action for the axis input event.
117      *
118      * @since 12
119      */
120     AXIS_ACTION_CANCEL = 0,
121     /**
122      * Start action for the axis input event.
123      *
124      * @since 12
125      */
126     AXIS_ACTION_BEGIN,
127     /**
128      * Update action for the axis input event.
129      *
130      * @since 12
131      */
132     AXIS_ACTION_UPDATE,
133     /**
134      * End action for the axis input event.
135      *
136      * @since 12
137      */
138     AXIS_ACTION_END,
139 } InputEvent_AxisAction;
140 #ifdef __cplusplus
141 }
142 #endif
143 /** @} */
144 #endif