diff options
author | Yunhee Seo <yuni.seo@samsung.com> | 2024-10-04 11:32:44 +0900 |
---|---|---|
committer | Yunhee Seo <yuni.seo@samsung.com> | 2024-10-04 11:32:44 +0900 |
commit | 7153775f8a308de229a519d73780037fc4c23de4 (patch) | |
tree | 6203f254862fa19f49adadfdc385434b993fb532 /include | |
parent | ab41e4a2c795e7bd74f061b17c8dad7875cc420d (diff) | |
download | libsvi-accepted/tizen_unified.tar.gz libsvi-accepted/tizen_unified.tar.bz2 libsvi-accepted/tizen_unified.zip |
feedback: Enhance API descriptiontizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20241022.113455accepted/tizen/unified/x/20241017.170346accepted/tizen/unified/toolchain/20241022.122919accepted/tizen/unified/toolchain/20241022.122446accepted/tizen/unified/20241017.114634accepted/tizen/9.0/unified/20241030.233817accepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unifiedaccepted/tizen_9.0_unified
To improve readability and facilitate comprehension,
more detailed API descriptions are added.
Change-Id: Ibb7cc3cf7217207fa1ee6084fbb779cfcb992abd
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Diffstat (limited to 'include')
-rwxr-xr-x | include/feedback-internal.h | 235 | ||||
-rw-r--r-- | include/feedback.h | 107 |
2 files changed, 282 insertions, 60 deletions
diff --git a/include/feedback-internal.h b/include/feedback-internal.h index 2a9a02d..3de69d1 100755 --- a/include/feedback-internal.h +++ b/include/feedback-internal.h @@ -48,28 +48,34 @@ typedef enum { /** * - * @brief Plays specific type of reactions that are pre-defined. - * @details - * This function can be used to react to pre-defined actions. \n - * It play specific type of system pre-defined pattern. - * + * @brief Plays specific type of reactions that are pre-defined feedback pattern. + * @details This function can be used to react to pre-defined actions. \n + * It play specific type of system pre-defined pattern. * @since_tizen 2.3 - * - * @remarks - * Currently, there are two types of reactions: sound and vibration. - * + * @remarks Currently, there are two types of reactions: sound and vibration. * @param[in] type string The pattern type * @param[in] pattern string The pre-defined pattern - * * @return 0 on success, otherwise a negative error value. * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device + * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * feedback_play_type_by_name("FEEDBACK_TYPE_SOUND", "FEEDBACK_PATTERN_SCREEN_CAPTURE"); + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode */ int feedback_play_type_by_name(char *type, char *pattern); /** - * @brief Plays various types of reactions that are pre-defined. + * @brief Plays various types of reactions that are pre-defined feedback pattern. * @details This function can be used to react to pre-defined actions. \n * It play various types of system pre-defined media or vibration patterns. * @since_tizen 4.0 @@ -81,19 +87,30 @@ int feedback_play_type_by_name(char *type, char *pattern); * If you don't have the haptic privilege, it only works sound operation. * It does not return any error in this case. * @param[in] pattern The pre-defined internal pattern - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * feedback_play_internal(FEEDBACK_PATTERN_SCREEN_CAPTURE); + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_pattern_internal_e */ int feedback_play_internal(feedback_pattern_internal_e pattern); /** - * @brief Plays various types of reactions that are pre-defined. + * @brief Plays various types of reactions that are pre-defined feedback pattern. * @details This function can be used to react to pre-defined actions. \n * It play various types of system pre-defined media or vibration patterns. * @since_tizen 5.5 @@ -106,19 +123,30 @@ int feedback_play_internal(feedback_pattern_internal_e pattern); * It does not return any error in this case. * @param[in] pattern The pre-defined internal pattern * @param[in] soundpath The resource file path for sound (can't be NULL) - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * feedback_play_soundpath_internal(FEEDBACK_PATTERN_SCREEN_CAPTURE, "/usr/share/feedback/sound/operation/shutter.wav"); + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_pattern_internal_e */ int feedback_play_soundpath_internal(feedback_pattern_internal_e internal_pattern, const char *soundpath); /** - * @brief Plays specific type of reactions that are pre-defined. + * @brief Plays specific type of reactions that are pre-defined feedback pattern. * @details This function can be used to react to pre-defined actions. \n * It play specific type of system pre-defined pattern. * @since_tizen 4.0 @@ -129,8 +157,7 @@ int feedback_play_soundpath_internal(feedback_pattern_internal_e internal_patter * If you don't have the haptic privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error. * @param[in] type The pattern type * @param[in] pattern The pre-defined internal pattern - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter @@ -138,12 +165,25 @@ int feedback_play_soundpath_internal(feedback_pattern_internal_e internal_patter * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * feedback_play_type_internal(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_SCREEN_CAPTURE); + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_type_e + * @see feedback_pattern_internal_e */ int feedback_play_type_internal(feedback_type_e type, feedback_pattern_internal_e pattern); /** - * @brief Plays specific type of reactions that are pre-defined. + * @brief Plays specific type of reactions that are pre-defined feedback pattern. * @details This function can be used to react to pre-defined actions. \n * It play specific type of system pre-defined pattern. * @since_tizen 4.0 @@ -155,8 +195,7 @@ int feedback_play_type_internal(feedback_type_e type, feedback_pattern_internal_ * @param[in] type The pattern type * @param[in] pattern The pre-defined internal pattern * @param[in] soundpath The resource file path for sound - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter @@ -164,45 +203,82 @@ int feedback_play_type_internal(feedback_type_e type, feedback_pattern_internal_ * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * feedback_play_type_internal(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_SCREEN_CAPTURE, "/usr/share/feedback/sound/operation/shutter.wav"); + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_type_e + * @see feedback_pattern_internal_e */ int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pattern_internal_e internal_pattern, const char *soundpath); /** - * @brief Gets the number of theme supported. + * @brief Gets the number of themes supported as described in the configuration. * @details This function gets the number of theme described in the config file. * The range of counted theme will be 1~N according to conf file. * @since_tizen 7.0 + * @remarks If it is not properly defined in the configuration file, this fails from the feedback_initialize() step. * @param[in] type The feedback type * @param[out] count_of_theme The number of theme supported - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * unsigned int count_of_theme; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ret = feedback_get_count_of_theme_internal(FEEDBACK_TYPE_SOUND, &count_of_theme); + * ... + * } + * ... + * @endcode + * @see feedback_type_e */ int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned int *count_of_theme); /** - * @brief Gets the current id of theme selected. + * @brief Gets the current ID of the theme selected from available themes described in the conf file. * @details This function gets the current theme id selected. - * The theme id is positive value according to conf file. + * The theme ID is positive value according to conf file. * @since_tizen 7.0 + * @remarks If feedback_set_theme_id_internal() is never called, it will returns the default theme ID. * @param[in] type The feedback type - * @param[out] id_of_theme The current id of theme selected - * @return @c 0 on success, - * otherwise a negative error value + * @param[out] id_of_theme The current ID of theme selected + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device + * @code + * #include <feedback-internal.h> + * ... + * unsigned int id_of_theme; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * int ret = feedback_get_theme_id_internal(FEEDBACK_TYPE_SOUND, &id_of_theme); + * ... + * } + * ... + * @endcode + * @see feedback_type_e */ int feedback_get_theme_id_internal(feedback_type_e feedback_type, unsigned int *id_of_theme); /** - * @brief Sets the current id of theme. + * @brief Sets the current ID of the theme from available themes described in the conf file. * @details This function sets the theme id. * The theme id is positive value according to conf file. * Please put the accurate theme id value. @@ -211,62 +287,124 @@ int feedback_get_theme_id_internal(feedback_type_e feedback_type, unsigned int * * If app doesn't have the privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error. * @param[in] type The feedback type * @param[in] id_of_theme The id of theme will be selected - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied + * @code + * #include <feedback-internal.h> + * ... + * unsigned int id_of_theme = 1; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * int ret = feedback_set_theme_id_internal(FEEDBACK_TYPE_SOUND, id_of_theme); + * ... + * } + * ... + * @endcode + * @see feedback_type_e */ int feedback_set_theme_id_internal(feedback_type_e feedback_type, unsigned int id_of_theme); /** - * @brief Stops various types of reactions by feedback type. + * @brief Stops reactions of various types according to the feedback type. * @details This function can be used to stop reaction to pre-defined actions. * It stops system pre-defined vibration and sound patterns. * @since_tizen 7.0 * @remarks To stop vibrator feedback, the privilege should be set to, %http://tizen.org/privilege/haptic. * @param[in] feedback_type The feedback type - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied + * @code + * #include <feedback-internal.h> + * ... + * unsigned int id_of_theme = 1; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * feedback_play_type_internal(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_SCREEN_CAPTURE); + * ... + * feedback_stop_type_internal(FEEDBACK_TYPE_SOUND); + * } + * ... + * @endcode + * @see feedback_type_e */ int feedback_stop_type_internal(feedback_type_e feedback_type); /** - * @brief Gets the array of theme id supported. + * @brief Gets the array of theme ids supported described in the conf file. * @details This function gets all theme id as defined in the conf file. * The theme id is positive value according to conf file. * After using theme ids, it should be freed by caller. * @since_tizen 7.0 + * @remarks Ensure to free the memory allocated for theme ids by feedback_put_theme_ids_internal(). * @param[in] type The feedback type * @param[out] count_of_theme This means size of theme id array * @param[out] theme_ids The theme id array - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device + * @code + * #include <feedback-internal.h> + * ... + * unsigned int count_of_theme; + * unsigned int *theme_ids; + * int index = 0; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ret = feedback_get_theme_ids_internal(FEEDBACK_TYPE_SOUND, &count_of_theme, &theme_ids); + * if (ret != FEEDBACK_ERROR_NONE) { + * return -1; + * } + * for (int index = 0; index < count_of_theme; index++) { + * ... + * } + * ret = feedback_put_theme_ids_internal(&theme_ids); + * } + * ... + * @endcode * @see feedback_put_theme_ids_internal() + * @see feedback_type_e */ int feedback_get_theme_ids_internal(feedback_type_e feedback_type, unsigned int *count_of_theme, unsigned int **theme_ids); /** - * @brief Free the array of theme id. + * @brief Free the array of theme ids allocated by feedback_get_theme_ids_internal(). * @details This function free the array of theme ids from feedback_get_theme_ids_internal() * Also, it is possible for the user to release the array directly. * @since_tizen 7.0 + * @remarks Ensure @a theme_ids is valid address of theme id array from feedback_get_theme_ids_internal(). * @param[in] theme_ids The Address of theme id array - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter + * @code + * #include <feedback-internal.h> + * ... + * unsigned int count_of_theme; + * unsigned int *theme_ids; + * int index = 0; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ret = feedback_get_theme_ids_internal(FEEDBACK_TYPE_SOUND, &count_of_theme, &theme_ids); + * if (ret != FEEDBACK_ERROR_NONE) { + * return -1; + * } + * for (int index = 0; index < count_of_theme; index++) { + * ... + * } + * ret = feedback_put_theme_ids_internal(&theme_ids); + * } + * ... + * @endcode * @see feedback_get_theme_ids_internal() */ int feedback_put_theme_ids_internal(unsigned int **theme_ids); @@ -296,7 +434,20 @@ int feedback_put_theme_ids_internal(unsigned int **theme_ids); * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback-internal.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ret = feedback_play_type_with_flags_internal(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_SCREEN_CAPTURE, FEEDBACK_FLAG_PRIORITY_BASED_PLAY); + * ... + * } + * ... + * @endcode * @see feedback_play_type_internal() + * @see feedback_type_e + * @see feedback_pattern_internal_e + * @see feedback_flag_e */ int feedback_play_type_with_flags_internal(feedback_type_e type, feedback_pattern_internal_e internal_pattern, feedback_flag_e flag); /** diff --git a/include/feedback.h b/include/feedback.h index 7fc9cea..88b4e2a 100644 --- a/include/feedback.h +++ b/include/feedback.h @@ -56,43 +56,62 @@ typedef enum { /** - * @brief Initializes feedback API. + * @brief Initializes the feedback API before using the feedback module. + * @details This function must be called properly before calling feedback functions. * @since_tizen 2.4 * @remarks If this function is not called in advance, other function will return #FEEDBACK_ERROR_NOT_INITIALIZED. * And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic. * If you don't have the haptic privilege, this function initializes only sound. * It does not return any error in this case. - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @post feedback_deinitialize() + * @code + * #include <feedback.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode * @see feedback_deinitialize() */ int feedback_initialize(void); /** - * @brief Deinitializes feedback API. + * @brief Deinitializes the feedback API after using the feedback module. * @details This function must be called when feedback functions are no longer needed. * @since_tizen 2.4 * @remarks If you don't want to use feedback anymore, you need to deinitialize with this function. * And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic. * If you don't have the haptic privilege, this function deinitializes only sound. * It does not return any error in this case. - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @pre feedback_initialize() + * @code + * #include <feedback.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ... + * feedback_deinitialize(); + * } + * ... + * @endcode * @see feedback_initialize() */ int feedback_deinitialize(void); /** - * @brief Plays various types of reactions that are pre-defined. + * @brief Plays various types of reactions that are pre-defined feedback pattern. * @details This function can be used to react to pre-defined actions. \n * It play various types of system pre-defined media or vibration patterns. * @since_tizen 2.4 @@ -104,19 +123,30 @@ int feedback_deinitialize(void); * If you don't have the haptic privilege, it only works sound operation. * It does not return any error in this case. * @param[in] pattern The pre-defined pattern - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ... + * feedback_play(FEEDBACK_PATTERN_TAP); + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_pattern_e */ int feedback_play(feedback_pattern_e pattern); /** - * @brief Plays specific type of reactions that are pre-defined. + * @brief Plays specific type of reactions that are pre-defined feedback pattern. * @details This function can be used to react to pre-defined actions. \n * It play specific type of system pre-defined pattern. * @since_tizen 2.4 @@ -127,8 +157,7 @@ int feedback_play(feedback_pattern_e pattern); * If you don't have the haptic privilege, it returns FEEDBACK_ERROR_PERMISSION_DENIED error. * @param[in] type The pattern type * @param[in] pattern The pre-defined pattern - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter @@ -136,11 +165,24 @@ int feedback_play(feedback_pattern_e pattern); * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ... + * feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TAP); + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_type_e + * @see feedback_pattern_e */ int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern); /** - * @brief Stops various types of reactions. + * @brief Stops various types of reactions from the feedback module. * @details This function can be used to stop reaction to pre-defined actions. \n * It stops system pre-defined vibration patterns. * @since_tizen 2.4 @@ -149,34 +191,63 @@ int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern); * And for controlling haptic device, the privilege should be set to, %http://tizen.org/privilege/haptic. * If you don't have the haptic privilege, it only works sound operation. * It does not return any error in this case. - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_PERMISSION_DENIED Permission denied * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback.h> + * ... + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ... + * feedback_play_type(FEEDBACK_TYPE_HAPTIC, FEEDBACK_PATTERN_TAP); + * ... + * feedback_play_stop(); + * feedback_deinitialize(); + * } + * ... + * @endcode */ int feedback_stop(void); /** - * @brief Checks if the pattern is supported. + * @brief Checks if the pattern is supported in the given feedback type. * @details This function can be used to check if a specific pattern is supported. * @since_tizen 2.4 + * @remarks Ensure that the provided @a status pointer is valid and has enough memory allocated. * @param[in] type The pattern type * @param[in] pattern The pre-defined pattern * @param[out] status True means the pattern is supported, * otherwise not supported - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #FEEDBACK_ERROR_NONE Successful * @retval #FEEDBACK_ERROR_OPERATION_FAILED Operation not permitted * @retval #FEEDBACK_ERROR_INVALID_PARAMETER Invalid parameter * @retval #FEEDBACK_ERROR_NOT_SUPPORTED Not supported device * @retval #FEEDBACK_ERROR_NOT_INITIALIZED Not initialized * @pre feedback_initialize() + * @code + * #include <feedback.h> + * ... + * bool supported; + * int ret = feedback_initialize(); + * if (ret == FEEDBACK_ERROR_NONE) { + * ... + * ret = feedback_is_supported_pattern(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TAP, &supported); + * if (ret == FEEDBACK_ERROR_NONE && supported) { + * ... + * } + * feedback_deinitialize(); + * } + * ... + * @endcode + * @see feedback_type_e + * @see feedback_pattern_e */ int feedback_is_supported_pattern(feedback_type_e type, feedback_pattern_e pattern, bool *status); |