From 1310eb0febc771cdad5b99c3fecf012cd7afea8c Mon Sep 17 00:00:00 2001 From: "jinwang.an" Date: Mon, 18 Sep 2017 21:42:24 +0900 Subject: [PATCH] Added SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS Change-Id: I471397bec467072f4f301d3a249f1a053bd85504 Signed-off-by: jinwang.an --- include/system_settings.h | 1 + include/system_settings_private.h | 27 +++++++++++++++++++++++++++ src/system_setting_platform.c | 26 ++++++++++++++++++++++++++ src/system_settings.c | 14 ++++++++++++++ 4 files changed, 68 insertions(+) diff --git a/include/system_settings.h b/include/system_settings.h index 86dfbad..f3e96bc 100644 --- a/include/system_settings.h +++ b/include/system_settings.h @@ -88,6 +88,7 @@ typedef enum { SYSTEM_SETTINGS_KEY_ADS_ID, /**< (string) Indicates Ads ID for each device (Since 3.0) */ SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE, /**< (int) Indicates Ultra Data Save status, one of #system_settings_uds_state_e values (Since 4.0) */ SYSTEM_SETTINGS_KEY_ULTRA_DATA_SAVE_PKG_LIST, /**< (string) Indicates Ultra Data Save Package List (Since 4.0), the list is a string containing whitelisted package names separated with semicolons (;) */ + SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, /**< GET (bool) Indicates whether the accessibility TTS is enabled on the device. (Since 4.0) */ SYSTEM_SETTINGS_KEY_MAX, } system_settings_key_e; diff --git a/include/system_settings_private.h b/include/system_settings_private.h index 849bf3c..f638a93 100644 --- a/include/system_settings_private.h +++ b/include/system_settings_private.h @@ -1409,6 +1409,33 @@ int system_setting_unset_changed_callback_uds_state(system_settings_key_e key); int system_setting_set_changed_callback_uds_pkg_list(system_settings_key_e key, system_settings_changed_cb callback, void *user_data); +/** + * @internal + * @since_tizen 4.0 + * @return 0 on success, otherwise a negative error value + * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful + * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error + * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error + */ +int system_setting_get_accessibility_tts(system_settings_key_e key, system_setting_data_type_e data_type, void **value); +/** + * @internal + * @since_tizen 4.0 + * @return 0 on success, otherwise a negative error value + * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful + * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error + * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error + */ +int system_setting_set_changed_callback_accessibility_tts(system_settings_key_e key, system_settings_changed_cb callback, void *user_data); +/** + * @internal + * @since_tizen 4.0 + * @return 0 on success, otherwise a negative error value + * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful + * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error + * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error + */ +int system_setting_unset_changed_callback_accessibility_tts(system_settings_key_e key); /** * @internal diff --git a/src/system_setting_platform.c b/src/system_setting_platform.c index 3b1856b..3f77713 100644 --- a/src/system_setting_platform.c +++ b/src/system_setting_platform.c @@ -2342,3 +2342,29 @@ int system_setting_unset_changed_callback_uds_pkg_list(system_settings_key_e key } /* LCOV_EXCL_STOP */ +/* SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS */ +int system_setting_get_accessibility_tts(system_settings_key_e key, system_setting_data_type_e data_type, void **value) +{ + SETTING_TRACE_BEGIN; + bool vconf_value; + + int ret = system_setting_vconf_get_value_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &vconf_value); + if (ret != SYSTEM_SETTINGS_ERROR_NONE) { + return ret; + } + *value = (void *)vconf_value; + return ret; +} + +int system_setting_set_changed_callback_accessibility_tts(system_settings_key_e key, system_settings_changed_cb callback, void *user_data) +{ + SETTING_TRACE_BEGIN; + return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, 2, user_data); +} + +int system_setting_unset_changed_callback_accessibility_tts(system_settings_key_e key) +{ + SETTING_TRACE_BEGIN; + return system_setting_vconf_unset_changed_cb(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, 2); +} + diff --git a/src/system_settings.c b/src/system_settings.c index a5f095e..fd3898e 100644 --- a/src/system_settings.c +++ b/src/system_settings.c @@ -480,6 +480,20 @@ system_setting_s system_setting_table[] = { NULL, /* user data */ }, { + SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS, + SYSTEM_SETTING_DATA_TYPE_BOOL, + system_setting_get_accessibility_tts, + NULL, + system_setting_set_changed_callback_accessibility_tts, + system_setting_unset_changed_callback_accessibility_tts, + NULL, + NULL, /* ADD */ + NULL, /* DEL */ + NULL, /* LIST */ + NULL, /* feature check */ + NULL, /* user data */ + }, + { SYSTEM_SETTINGS_MAX, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; -- 2.7.4