feedback: Add feedback theme index range description
[platform/core/system/libsvi.git] / include / feedback-internal.h
1 /*
2  * libfeedback
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18
19 #ifndef __FEEDBACK_INTERNAL_H__
20 #define __FEEDBACK_INTERNAL_H__
21
22 #include <tizen_error.h>
23 #include <feedback-ids.h>
24 #include "feedback-ids-internal.h"
25 #include "feedback-ids-product.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * @file feedback-internal.h
33  * @brief This file contains the feedback internal API
34  */
35
36 #define FEEDBACK_SUCCEEDED(n)                ((n) == FEEDBACK_ERROR_NONE)
37 #define FEEDBACK_FAILED(n)                   ((n) != FEEDBACK_ERROR_NONE)
38
39 /**
40  *
41  * @brief Plays specific type of reactions that are pre-defined.
42  * @details
43  * This function can be used to react to pre-defined actions. \n
44  * It play specific type of system pre-defined pattern.
45  *
46  * @since_tizen 2.3
47  *
48  * @remarks
49  * Currently, there are two types of reactions: sound and vibration.
50  *
51  * @param[in] type string      The pattern type
52  * @param[in] pattern string   The pre-defined pattern
53  *
54  * @return 0 on success, otherwise a negative error value.
55  * @retval #FEEDBACK_ERROR_NONE               Successful
56  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER  Invalid parameter
57  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED      Not supported device
58  */
59 int feedback_play_type_by_name(char *type, char *pattern);
60
61 /**
62  * @brief Plays various types of reactions that are pre-defined.
63  * @details This function can be used to react to pre-defined actions. \n
64  *          It play various types of system pre-defined media or vibration patterns.
65  * @since_tizen 4.0
66  * @remarks Currently, there are two types of reactions: sound and vibration. \n
67  *          Depending on the settings, some types cannot operate.
68  *          For example, when set to silent mode, the device doesn't produce any sound.
69  *          If to play one of the devices is successful, this function regards as success.
70  *          And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
71  *          If you don't have the haptic privilege, it only works sound operation.
72  *          It does not return any error in this case.
73  * @param[in] pattern The pre-defined internal pattern
74  * @return @c 0 on success,
75  *         otherwise a negative error value
76  * @retval #FEEDBACK_ERROR_NONE Successful
77  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
78  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
79  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
80  * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
81  * @pre feedback_initialize()
82  */
83 int feedback_play_internal(feedback_pattern_internal_e pattern);
84
85 /**
86  * @brief Plays various types of reactions that are pre-defined.
87  * @details This function can be used to react to pre-defined actions. \n
88  *          It play various types of system pre-defined media or vibration patterns.
89  * @since_tizen 5.5
90  * @remarks Currently, there are two types of reactions: sound and vibration. \n
91  *          Depending on the settings, some types cannot operate.
92  *          For example, when set to silent mode, the device doesn't produce any sound.
93  *          If to play one of the devices is successful, this function regards as success.
94  *          And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
95  *          If you don't have the haptic privilege, it only works sound operation.
96  *          It does not return any error in this case.
97  * @param[in] pattern The pre-defined internal pattern
98  * @param[in] soundpath The resource file path for sound (can't be NULL)
99  * @return @c 0 on success,
100  *         otherwise a negative error value
101  * @retval #FEEDBACK_ERROR_NONE Successful
102  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
103  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
104  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
105  * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
106  * @pre feedback_initialize()
107  */
108 int feedback_play_soundpath_internal(feedback_pattern_internal_e internal_pattern, const char *soundpath);
109
110 /**
111  * @brief Plays specific type of reactions that are pre-defined.
112  * @details This function can be used to react to pre-defined actions. \n
113  *          It play specific type of system pre-defined pattern.
114  * @since_tizen 4.0
115  * @remarks Currently, there are two types of reactions: sound and vibration. \n
116  *          Depending on the settings, some types cannot operate.
117  *          For example, when set to silent mode, the device doesn't produce any sound.
118  *          And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
119  *          If you don't have the haptic privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
120  * @param[in] type The pattern type
121  * @param[in] pattern The pre-defined internal pattern
122  * @return @c 0 on success,
123  *         otherwise a negative error value
124  * @retval #FEEDBACK_ERROR_NONE Successful
125  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
126  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
127  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
128  * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
129  * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
130  * @pre feedback_initialize()
131  */
132 int feedback_play_type_internal(feedback_type_e type, feedback_pattern_internal_e pattern);
133
134
135 /**
136  * @brief Plays specific type of reactions that are pre-defined.
137  * @details This function can be used to react to pre-defined actions. \n
138  *          It play specific type of system pre-defined pattern.
139  * @since_tizen 4.0
140  * @remarks Currently, there are two types of reactions: sound and vibration. \n
141  *          Depending on the settings, some types cannot operate.
142  *          For example, when set to silent mode, the device doesn't produce any sound.
143  *          And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic.
144  *          If you don't have the haptic privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
145  * @param[in] type The pattern type
146  * @param[in] pattern The pre-defined internal pattern
147  * @param[in] soundpath The resource file path for sound
148  * @return @c 0 on success,
149  *         otherwise a negative error value
150  * @retval #FEEDBACK_ERROR_NONE Successful
151  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
152  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
153  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
154  * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
155  * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
156  * @pre feedback_initialize()
157  */
158 int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pattern_internal_e internal_pattern, const char *soundpath);
159
160 /**
161  * @brief Gets the number of theme supported.
162  * @details This function gets the number of theme described in the config file.
163  *          The range of counted theme will be 1~N according to conf file.
164  * @since_tizen 7.0
165  * @param[in] type The feedback type
166  * @param[out] count_of_theme The number of theme supported
167  * @return @c 0 on success,
168  *         otherwise a negative error value
169  * @retval #FEEDBACK_ERROR_NONE Successful
170  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
171  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
172  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
173  * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized
174  * @pre feedback_initialize()
175  */
176 int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned int *count_of_theme);
177
178 /**
179  * @brief Gets the current index of theme selected.
180  * @details This function gets the current index of theme selected.
181  *          The range of theme index will be 1~N according to conf file.
182  * @since_tizen 7.0
183  * @param[in] type The feedback type
184  * @param[out] index_of_theme The current index of theme selected
185  * @return @c 0 on success,
186  *         otherwise a negative error value
187  * @retval #FEEDBACK_ERROR_NONE Successful
188  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
189  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
190  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
191  */
192 int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigned int *index_of_theme);
193
194 /**
195  * @brief Sets the current index of theme.
196  * @details This function sets the index of theme.
197  *          The range of theme index will be 1~N according to conf file.
198  *          Please put the accurate index_of_theme value.
199  * @since_tizen 7.0
200  * @remarks For setting feedback theme index, the privilege should be set to, %http://tizen.org/privilege/systemsettings.admin.
201  *          If app doesn't have the privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error.
202  * @param[in] type The feedback type
203  * @param[in] index_of_theme The index of theme will be selected
204  * @return @c 0 on success,
205  *         otherwise a negative error value
206  * @retval #FEEDBACK_ERROR_NONE Successful
207  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
208  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
209  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
210  * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
211  */
212 int feedback_set_theme_index_internal(feedback_type_e feedback_type, unsigned int index_of_theme);
213
214 /**
215  * @brief Stops various types of reactions by feedback type.
216  * @details This function can be used to stop reaction to pre-defined actions.
217  *          It stops system pre-defined vibration and sound patterns.
218  * @since_tizen 7.0
219  * @remarks To stop vibrator feedback, the privilege should be set to, %http://tizen.org/privilege/haptic.
220  * @param[in] feedback_type The feedback type
221  * @return @c 0 on success,
222  *         otherwise a negative error value
223  * @retval #FEEDBACK_ERROR_NONE Successful
224  * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted
225  * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter
226  * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device
227  * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied
228  */
229 int feedback_stop_type_internal(feedback_type_e feedback_type);
230
231 /**
232  * @}
233  */
234
235 #ifdef __cplusplus
236 }
237 #endif
238
239 #endif //__FEEDBACK_INTERNAL_H__