#define APP_CONTROL_DATA_INPUT_MAX_TEXT_LENGTH "http://tizen.org/appcontrol/data/input_max_text_length"
-/* @brief Definition for app_control data: Send value to set cursor position to entry in keyboard input type.
+/**
+ * @brief Definition for app_control data: Send value to set cursor position to entry in keyboard input type.
* @since_tizen 4.0
*/
#define APP_CONTROL_DATA_INPUT_CURSOR_POSITION_SET "http://tizen.org/appcontrol/data/input_cursor_position_set"
*
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @param[in] app_control The app_control handle
- * @param[in] package The package name of the application that can handle the launch request of the given app_control
+ * @param[in] appid The name of the application that can handle the launch request of the given app_control
* @param[in] user_data The user data passed from the foreach function
* @return @c true to continue with the next iteration of the loop,
* otherwise @c false to break out of the loop
typedef void (*app_control_result_cb)(app_control_h request, app_control_error_e result, void *user_data);
-typedef int (*app_control_host_res_fn)(void *data);
-
/**
* @brief Creates an app_control handle.
*
/**
+ * @brief Creates an app_control handle and sets its attributes.
+ *
+ * @details Extra data of array type cannot be added with this function. If you need to add arrays to the app_control handle,
+ * create the handle with app_control_create_with_parameters() and then add arrays with app_control_add_extra_data_array().
+ * For details on key-value pairs that app_control_create_with_parameters() allows,
+ * their types and constraints, see app_control_add_extra_data().
+ * @since_tizen 5.5
+ * @remarks The @a app_control must be released using app_control_destroy().
+ * @remarks Setting the type of key-value extra data that the value is an array of strings is not allowed.
+ * @param[out] app_control The app_control handle to be newly created on success
+ * @param[in] operation The operation to be performed
+ * @param[in] uri The URI of the data this app_control is operating on
+ * @param[in] mime The explicit MIME type of the data this app_control is operating on
+ * @param[in] category The explicit category
+ * @param[in] app_id The ID of the application to explicitly launch
+ * @param[in] mode The launch mode of the application
+ * @param[in] extra_data_count The count of a extra data
+ * @param[in] ... The key-value pair list of app control extra data
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_CONTROL_ERROR_KEY_REJECTED Key not available
+ * @see app_control_destroy()
+ * @see app_control_add_extra_data()
+ * @code
+
+static int create_app_control()
+{
+ app_control_h control;
+ int ret = app_control_create_with_parameter(&control, NULL, NULL, NULL, NULL,
+ "org.tizen.test", APP_CONTROL_LAUNCH_MODE_SINGLE, 2, "key1", "value1", "key2", "value2");
+ return ret;
+}
+ * @endcode
+ */
+int app_control_create_with_parameters(app_control_h *app_control,
+ const char *operation, const char *uri, const char *mime,
+ const char *category, const char *app_id,
+ app_control_launch_mode_e mode, int extra_data_count, ...);
+
+
+/**
* @brief Destroys the app_control handle and releases all its resources.
*
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @brief Gets the explicit MIME type of the data.
*
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a uri must be released using free().
+ * @remarks The @a mime must be released using free().
* @param[in] app_control The app_control handle
* @param[out] mime The explicit MIME type of the data this app_control is operating on
* @return @c 0 on success,
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/appmanager.launch
- * @remarks The function returns #APP_CONTROL_ERROR_LAUNCH_REJECTED if the operation value is #APP_CONTROL_OPERATION_LAUNCH_ON_EVENT which is only for handling the event from the platform or other application, refer to the @a Event module.
+ * @remarks The function returns #APP_CONTROL_ERROR_LAUNCH_REJECTED if the operation value is #APP_CONTROL_OPERATION_LAUNCH_ON_EVENT which is only for handling the event from the platform or other application, refer to the @ref Event module.
* @remarks Since Tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, the launch request of the service application over out of packages is restricted by the platform. Also, implicit launch requests are NOT delivered to service applications since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. To launch a service application, an explicit launch request with application ID given by the app_control_set_app_id() must be sent.
* @param[in] app_control The app_control handle
* @param[in] callback The callback function to be called when the reply is delivered
* @remarks The @a id must be released using free().
* @param[in] app_control The app_control handle from app_control_cb()
* @param[out] id The application ID of the caller
- * @return @a 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
* @retval #APP_CONTROL_ERROR_NONE Successful
* @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
* @details The function allows to receive the #APP_CONTROL_RESULT_APP_STARTED event on\n
* application get launched by the app_control.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks app_control_reply_cb() will be called on the APP_CONTROL_RESULT_APP_STARTED event received.
+ * @remarks app_control_reply_cb() will be called on the #APP_CONTROL_RESULT_APP_STARTED event received.
* @param[in] app_control The app_control handle
* @return @c 0 on success,
* otherwise a negative error value
* @since_tizen 5.0
* @privlevel public
* @privilege %http://tizen.org/privilege/appmanager.launch
- * @remarks The function returns #APP_CONTROL_ERROR_LAUNCH_REJECTED if the operation value is #APP_CONTROL_OPERATION_LAUNCH_ON_EVENT which is only for handling the event from the platform or other application, refer to the @a Event Module.
+ * @remarks The function returns #APP_CONTROL_ERROR_LAUNCH_REJECTED if the operation value is #APP_CONTROL_OPERATION_LAUNCH_ON_EVENT which is only for handling the event from the platform or other application, refer to the @ref Event Module.
* @remarks The launch request of the service application over out of packages is restricted by the platform. Also, implicit launch requests are NOT delivered to service applications since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. To launch a service application, an explicit launch request with application ID given by the app_control_set_app_id() must be sent.
* @param[in] app_control The app_control handle
* @param[in] result_cb The callback function to be called when the result is delivered
return app_control_create_request(NULL, app_control);
}
+int app_control_create_with_parameters(app_control_h *app_control,
+ const char *operation, const char *uri, const char *mime,
+ const char *category, const char *app_id,
+ app_control_launch_mode_e mode, int extra_data_count, ...)
+{
+ app_control_h tmp_control;
+ int ret;
+ va_list vl;
+ char *val;
+ char *key;
+
+ ret = app_control_create_request(NULL, &tmp_control);
+ if (ret != APP_CONTROL_ERROR_NONE)
+ return ret;
+
+ ret = app_control_set_operation(tmp_control, operation);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ ret = app_control_set_uri(tmp_control, uri);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ ret = app_control_set_mime(tmp_control, mime);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ ret = app_control_set_category(tmp_control, category);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ ret = app_control_set_app_id(tmp_control, app_id);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ ret = app_control_set_launch_mode(tmp_control, mode);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ va_start(vl, extra_data_count);
+ for (int i = 0; i < extra_data_count; i++) {
+ key = va_arg(vl, char *);
+ ret = app_control_validate_extra_data(key);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ val = va_arg(vl, char *);
+ ret = app_control_validate_extra_data(val);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+
+ ret = app_control_add_extra_data(tmp_control, key, val);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(tmp_control);
+ return ret;
+ }
+ }
+ va_end(vl);
+ *app_control = tmp_control;
+
+ return ret;
+}
+
int app_control_create_event(bundle *data, struct app_control_s **app_control)
{
struct app_control_s *app_control_event;
return APP_CONTROL_ERROR_NONE;
}
-
int app_control_add_extra_data(app_control_h app_control, const char *key, const char *value)
{
if (app_control_validate(app_control) || app_control_validate_extra_data(key) || app_control_validate_extra_data(value))
return APP_CONTROL_ERROR_NONE;
}
-
int app_control_add_extra_data_array(app_control_h app_control, const char *key, const char* value[], int length)
{
if (app_control_validate(app_control) || app_control_validate_extra_data(key))