Initialize Tizen 2.3
[framework/system/deviced.git] / src / deviced / haptic-module.h
1 /*
2  * deviced
3  *
4  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License);
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19
20 #ifndef __HAPTIC_MODULE_H__
21 #define __HAPTIC_MODULE_H__
22
23 /**
24  * @brief Enumerations of device id for the Haptic Module API.
25  * @details We support two motors now.
26  */
27 typedef enum {
28     HAPTIC_MODULE_DEVICE_0 = 0x0,             /**< 1st motor */
29     HAPTIC_MODULE_DEVICE_1 = 0x1,             /**< 2nd motor */
30     HAPTIC_MODULE_DEVICE_ALL = 0x4,           /**< both of them */
31 } haptic_module_device;
32
33 /**
34  * @brief Enumerations of priority level for the Haptic Module API.
35  */
36 typedef enum
37 {
38     HAPTIC_MODULE_PRIORITY_MIN = 0,        /**< Minimum effect priority for developers (default) */
39     HAPTIC_MODULE_PRIORITY_MIDDLE,         /**< Maximum effect priority for developers */
40     HAPTIC_MODULE_PRIORITY_HIGH,           /**< Maximum effect priority for OEMs */
41 } haptic_module_priority;
42
43 /**
44  * @brief Enumerations of feedback level for the Haptic Module API.
45  * @details Haptic level means vibration power (intensity).
46  */
47 typedef enum
48 {
49     HAPTIC_MODULE_FEEDBACK_MIN = 0,
50     HAPTIC_MODULE_FEEDBACK_MAX = 100,
51 } haptic_module_feedback;
52
53 /**
54  * @brief Enumerations of iteration count for the Haptic Module API.
55  */
56 typedef enum
57 {
58     HAPTIC_MODULE_ITERATION_ONCE = 1,
59     HAPTIC_MODULE_ITERATION_INFINITE = 256,
60 } haptic_module_iteration;
61
62 /**
63  * @brief Enumerations of effect or device state for the Haptic Module API.
64  */
65 typedef enum
66 {
67     HAPTIC_MODULE_STATE_STOP = 0,
68     HAPTIC_MODULE_STATE_PLAYING,
69 } haptic_module_state;
70
71 /* Error and Return value codes */
72 #define HAPTIC_MODULE_ERROR_NONE                                                         0
73 #define HAPTIC_MODULE_NOT_INITIALIZED                                                   -1
74 #define HAPTIC_MODULE_ALREADY_INITIALIZED                                               -2
75 #define HAPTIC_MODULE_INVALID_ARGUMENT                                                  -3
76 #define HAPTIC_MODULE_OPERATION_FAILED                                                  -4
77 #define HAPTIC_MODULE_NOT_SUPPORTED                                                             -5
78
79 /**
80  * @par Description:
81  *      effect element for haptic module.
82  */
83 typedef struct {
84     int haptic_duration;           /**< Start time of the effect element in millisecond */
85     int haptic_level;        /**< Duration of the effect element in millisecond */
86 } haptic_module_effect_element;
87
88 #endif  /* __HAPTIC_MODULE_H__ */