[ACR-1585][gesture][Initial version of codes]
[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  * @brief Delivery through hand_gesture_recognition_cb() of gesture data handle.
38  * @since_tizen @if WEARABLE 6.0 @endif
39  */
40 typedef struct hand_gesture_data_s* hand_gesture_data_h;
41
42 /**
43  * @brief Enumerations for hand gesture function error.
44  *
45  * @since_tizen @if WEARABLE 6.0 @endif
46  */
47 typedef enum {
48         HAND_GESTURE_ERROR_NONE         = TIZEN_ERROR_NONE,                     /**< Successful */
49         HAND_GESTURE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,   /**< Invalid function parameter */
50         HAND_GESTURE_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,   /**< Function not implemented */
51         HAND_GESTURE_ERROR_OUT_OF_MEMORY        = TIZEN_ERROR_OUT_OF_MEMORY,            /**< Out of memory */
52         HAND_GESTURE_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,   /**< Permission denied */
53         HAND_GESTURE_ERROR_NOT_SUPPORTED        = TIZEN_ERROR_NOT_SUPPORTED,            /**< Not supported */
54         HAND_GESTURE_ERROR_ALREADY_STARTED      = TIZEN_ERROR_GESTURE | 0x01,           /**< Recognition is already started */
55         HAND_GESTURE_ERROR_NOT_STARTED  = TIZEN_ERROR_GESTURE | 0x02,           /**< Recognition is not started */
56         HAND_GESTURE_ERROR_OPERATION_FAILED     = TIZEN_ERROR_GESTURE | 0x04,           /**< Operation failed because of a system error */
57 } hand_gesture_error_e;
58
59 /**
60  * @brief Enumerations for hand gesture types.
61  * @since_tizen @if WEARABLE 6.0 @endif
62  */
63 typedef enum {
64         HAND_GESTURE_NONE                       = 1,    /**< Nothing type */
65         HAND_GESTURE_WRIST_UP           = 2,    /**< The wearable device is moved and faced up */
66 } hand_gesture_type_e;
67
68 /**
69  * @brief Enumerations for gesture recognition option.
70  * @details If the default option is used, the system tries to reduce power consumption.
71  *          For example, the recognition engine may stop detecting gestures if the display is turned off.
72  *          Using #HAND_GESTURE_OPTION_ALWAYS_ON disables such power-saving functionalities.
73  *
74  * @since_tizen @if WEARABLE 6.0 @endif
75  */
76 typedef enum {
77         HAND_GESTURE_OPTION_DEFAULT             = 1,    /**< Running in the default setting */
78         HAND_GESTURE_OPTION_ALWAYS_ON   = 2,    /**< Trying to detect gestures always */
79 } hand_gesture_option_e;
80
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 #endif /* __TIZEN_UIX_GESTURE_COMMON_H__ */