3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef __FEEDBACK_INTERNAL_H__
20 #define __FEEDBACK_INTERNAL_H__
22 #include <tizen_error.h>
23 #include <feedback-ids.h>
24 #include "feedback-ids-internal.h"
25 #include "feedback-ids-product.h"
32 * @file feedback-internal.h
33 * @brief This file contains the feedback internal API
36 #define FEEDBACK_SUCCEEDED(n) ((n) == FEEDBACK_ERROR_NONE)
37 #define FEEDBACK_FAILED(n) ((n) != FEEDBACK_ERROR_NONE)
41 * @brief Plays specific type of reactions that are pre-defined.
43 * This function can be used to react to pre-defined actions. \n
44 * It play specific type of system pre-defined pattern.
49 * Currently, there are two types of reactions: sound and vibration.
51 * @param[in] type string The pattern type
52 * @param[in] pattern string The pre-defined pattern
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
59 int feedback_play_type_by_name(char *type, char *pattern);
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.
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()
83 int feedback_play_internal(feedback_pattern_internal_e pattern);
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.
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()
108 int feedback_play_soundpath_internal(feedback_pattern_internal_e internal_pattern, const char *soundpath);
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.
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()
132 int feedback_play_type_internal(feedback_type_e type, feedback_pattern_internal_e pattern);
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.
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()
158 int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pattern_internal_e internal_pattern, const char *soundpath);
168 #endif //__FEEDBACK_INTERNAL_H__