return action;
}
-API int modes_action_set_id(modes_action_h action, const char *id)
-{
- RETV_IF(NULL == action, MODES_ERROR_INVALID_PARAMETER);
- RETV_IF(NULL == id, MODES_ERROR_INVALID_PARAMETER);
-
- action->id = strdup(id);
- return MODES_ERROR_NONE;
-}
-
API int modes_mode_add_action(modes_mode_h mode, modes_action_h action)
{
RETV_IF(NULL == mode, MODES_ERROR_INVALID_PARAMETER);
#include <modes_types.h>
#include <modes_errors.h>
-
/**
* @file modes.h
*/
-
/**
* @addtogroup CAPI_MODE_SUPERVISOR_MODULE
* @{
* @since_tizen 6.0
* @privlevel public
* @param[out] Action handle pointer to get handle
- * @param[in] Action
+ * @param[in] A name of Action rule
* @param[in] Value to do action.
* @return @c 0 on success,
* @return @c Action handle pointer on success,
* otherwise NULL value
* @retval NULL Failed to create the action handler
*/
-modes_action_h modes_create_action(const char *name, const char *value);
-
-
-/**
- * @brief Add Action to Mode.
- * @details Calls this function to set ID to action.
- * @since_tizen 6.0
- * @privlevel public
- * @param[in] Action handle
- * @param[in] Action id
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #MODES_ERROR_NONE Successful
- * @retval #MODES_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int modes_action_set_id(modes_action_h action, const char *id);
+modes_action_h modes_create_action(const char *rule, const char *value);
/**
* @brief Add Action to Mode.
*/
void modes_destroy_mode(modes_mode_h mode);
-
/**
* @brief Specifies the type of function passed to modes_noti_connect().
* @details When the Modes apply/undo a mode, it is called, immediately.
* @}
*/
-
#ifdef __cplusplus
}
#endif
-
#endif //__MODE_SUPERVISOR_H__
modes_mode_h created_mode = modes_create_mode("created", MODES_TYPE_MODE_NORMAL);
modes_action_h action_handle[2];
action_handle[0] = modes_create_action("test.printBool", "on");
- modes_action_set_id(action_handle[0], "printBoolOn");
action_handle[1] = modes_create_action("test.printBool", "off");
- modes_action_set_id(action_handle[1], "printBoolOff");
for (int i = 0; i < 2; i++) {
result = modes_mode_add_action(created_mode, action_handle[i]);