Added multi-callback for system-settings keys
[platform/core/api/system-settings.git] / include / system_settings.h
index 86b0fe9..26795e6 100644 (file)
@@ -346,6 +346,43 @@ int system_settings_add_value_string(system_settings_key_e key, const char *valu
  */
 int system_settings_delete_value_string(system_settings_key_e key, const char *value);
 
+
+/**
+ * @brief Adds a change event callback for the given system settings key.
+ * @details The difference between this function and system_settings_set_changed_cb() is that system_settings_set_changed_cb() can set only one callback for a given key, while system_settings_add_changed_cb() can set multiple callbacks for a given key.
+ * @since_tizen 5.0
+ * @remarks The @a key cannot be #SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE. When the feature related to the @a key is not supported on the device, #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED will be returned.
+
+ * @param[in] key The key name of the system settings
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return     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_NOT_SUPPORTED The related feature is not supported on the device
+ * @post system_settings_changed_cb() will be invoked.
+ *
+ * @see system_settings_remove_changed_cb()
+ * @see system_settings_changed_cb()
+ *
+*/
+int system_settings_add_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data);
+
+/**
+ * @brief Removes a change event callback function.
+ * @details The difference between this function and system_settings_unset_changed_cb() is that system_settings_unset_changed_cb() unsets the callback set with system_settings_set_changed_cb(), while system_settings_remove_changed_cb() removes callbacks added with system_settings_add_changed_cb()
+ * @since_tizen 5.0
+ * @remarks The @a key cannot be #SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE. When the feature related to the @a key is not supported on the device, #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED will be returned.
+ * @param[in] key The key name of the system settings
+ * @param[in] callback The callback function to be removed
+ * @return     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_NOT_SUPPORTED The related feature is not supported on the device
+ *
+ * @see system_settings_add_changed_cb()
+ */
+int system_settings_remove_changed_cb(system_settings_key_e key, system_settings_changed_cb callback);
 /**
  * @}
  */