tizen 2.3 release
[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 unlimited duration for the Haptic Module API.
55  */
56 typedef enum {
57         HAPTIC_MODULE_DURATION_UNLIMITED = 0x7FFFFFFF,
58 } haptic_module_duration;
59
60 /**
61  * @brief Enumerations of iteration count for the Haptic Module API.
62  */
63 typedef enum
64 {
65     HAPTIC_MODULE_ITERATION_ONCE = 1,
66     HAPTIC_MODULE_ITERATION_INFINITE = 256,
67 } haptic_module_iteration;
68
69 /**
70  * @brief Enumerations of effect or device state for the Haptic Module API.
71  */
72 typedef enum
73 {
74     HAPTIC_MODULE_STATE_STOP = 0,
75     HAPTIC_MODULE_STATE_PLAYING,
76 } haptic_module_state;
77
78 /* Error and Return value codes */
79 #define HAPTIC_MODULE_ERROR_NONE                                                         0
80 #define HAPTIC_MODULE_NOT_INITIALIZED                                                   -1
81 #define HAPTIC_MODULE_ALREADY_INITIALIZED                                               -2
82 #define HAPTIC_MODULE_INVALID_ARGUMENT                                                  -3
83 #define HAPTIC_MODULE_OPERATION_FAILED                                                  -4
84 #define HAPTIC_MODULE_NOT_SUPPORTED                                                             -5
85
86 /**
87  * @par Description:
88  *      effect element for haptic module.
89  */
90 typedef struct {
91     int haptic_duration;           /**< Start time of the effect element in millisecond */
92     int haptic_level;        /**< Duration of the effect element in millisecond */
93 } haptic_module_effect_element;
94
95 #endif  /* __HAPTIC_MODULE_H__ */