Add Ringtone List API
[platform/core/api/system-settings.git] / include / system_settings.h
index 4fee4a2..634b34e 100644 (file)
@@ -43,7 +43,7 @@ typedef enum {
        SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
        SYSTEM_SETTINGS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
        SYSTEM_SETTINGS_ERROR_IO_ERROR =  TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
-       SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED =  TIZEN_ERROR_PERMISSION_DENIED, /**< Permition denied */
+       SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED =  TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
        SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED =  TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported @if MOBILE (Since 2.3.1) @endif */
        SYSTEM_SETTINGS_ERROR_CALL_UNSUPPORTED_API = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported @if MOBILE (Since 2.3.1) @endif */
 
@@ -256,6 +256,66 @@ int system_settings_unset_changed_cb(system_settings_key_e key);
 
 
 /**
+ * @platform
+ * @brief Called to get each string value from string typed list.
+ * @since_tizen 3.0
+ * @param[in] index zero based number indicating index of node in a list
+ * @param[in] value value returned from the list
+ * @param[in] cb_data  The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, otherwise false to break out of the loop
+ */
+typedef bool (*system_settings_iter_cb)(int index, const char* value, void *cb_data);
+
+/**
+ * @platform
+ * @brief Iterate the system settings value associated with the given key as a string type.
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] key The key name of the system settings
+ * @param[in] callback The callback-function name for iteration
+ * @param[in] user_data  The user data passed from caller-side
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval     #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval     #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval     #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval     #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_settings_foreach_value_string(system_settings_key_e key, system_settings_iter_cb callback, void *user_value);
+
+/**
+ * @platform
+ * @brief Adds the system settings value associated with the given key as a string type if it supports List iteration.
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] key The key name of the system settings
+ * @param[in] value string typed value to be appended
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval     #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval     #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval     #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval     #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_settings_add_value_string(system_settings_key_e key, const char *value);
+
+/**
+ * @platform
+ * @brief Delete the system settings value associated with the given key as an string type if it supports List iteration.
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] key The key name of the system settings
+ * @param[in] value string typed value to be removed
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval     #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval     #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval     #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval     #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_settings_delete_value_string(system_settings_key_e key, const char *value);
+
+/**
  * @}
  */