Merge "Remove unused code" into tizen
[platform/core/api/gesture.git] / include / gesture_common.h
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_UIX_GESTURE_COMMON_H__
18 #define __TIZEN_UIX_GESTURE_COMMON_H__
19
20 #include <tizen.h>
21 #include <gesture_data_info.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #ifndef TIZEN_ERROR_GESTURE
28 #define TIZEN_ERROR_GESTURE             -0x03090000
29 #endif
30
31 /*
32  * @file gesture_common.h
33  * @brief This file contains gesture's common struct info.
34  */
35
36 /**
37  * @addtogroup CAPI_UIX_GESTURE_MODULE
38  * @{
39  */
40
41 /**
42  * @brief Delivery through hand_gesture_recognition_cb() of gesture data handle.
43  * @since_tizen @if WEARABLE 6.0 @endif
44  */
45 typedef struct hand_gesture_data_s* hand_gesture_data_h;
46
47 /**
48  * @brief Enumerations for hand gesture function error.
49  *
50  * @since_tizen @if WEARABLE 6.0 @endif
51  */
52 typedef enum {
53         HAND_GESTURE_ERROR_NONE         = TIZEN_ERROR_NONE,                     /**< Successful */
54         HAND_GESTURE_ERROR_NOT_SUPPORTED        = TIZEN_ERROR_NOT_SUPPORTED,            /**< Not supported */
55         HAND_GESTURE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,   /**< Invalid function parameter */
56         HAND_GESTURE_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,   /**< Function not implemented */
57         HAND_GESTURE_ERROR_OUT_OF_MEMORY        = TIZEN_ERROR_OUT_OF_MEMORY,            /**< Out of memory */
58         HAND_GESTURE_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,   /**< Permission denied */
59         HAND_GESTURE_ERROR_ALREADY_STARTED      = TIZEN_ERROR_GESTURE | 0x01,           /**< Recognition is already started */
60         HAND_GESTURE_ERROR_NOT_STARTED  = TIZEN_ERROR_GESTURE | 0x02,           /**< Recognition is not started */
61         HAND_GESTURE_ERROR_OPERATION_FAILED     = TIZEN_ERROR_GESTURE | 0x04,           /**< Operation failed because of a system error */
62 } hand_gesture_error_e;
63
64 /**
65  * @brief Enumerations for hand gesture types.
66  * @since_tizen @if WEARABLE 6.0 @endif
67  */
68 typedef enum {
69         HAND_GESTURE_NONE                       = 1,    /**< Nothing type */
70         HAND_GESTURE_WRIST_UP           = 2,    /**< The wearable device is moved and faced up */
71 } hand_gesture_type_e;
72
73 /**
74  * @brief Enumerations for gesture recognition option.
75  * @details If the default option is used, the system tries to reduce power consumption.
76  *          For example, the recognition engine may stop detecting gestures if the display is turned off.
77  *          Using #HAND_GESTURE_OPTION_ALWAYS_ON disables such power-saving functionalities.
78  *
79  * @since_tizen @if WEARABLE 6.0 @endif
80  */
81 typedef enum {
82         HAND_GESTURE_OPTION_DEFAULT             = 1,    /**< Running in the default setting */
83         HAND_GESTURE_OPTION_ALWAYS_ON   = 2,    /**< Trying to detect gestures always */
84 } hand_gesture_option_e;
85
86
87 /**
88  * @}
89  */
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /* __TIZEN_UIX_GESTURE_COMMON_H__ */