[ACR-1074][common appcontrol][Add] app_control operation about the input delegater 30/149230/5
authorsungwook79.park <sungwook79.park@samsung.com>
Tue, 12 Sep 2017 02:20:30 +0000 (11:20 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Tue, 12 Sep 2017 06:33:15 +0000 (09:33 +0300)
PS4: Reviewed
PS5: Fixed two typos

Change-Id: Iae90d36b55bd76220c6756e2bd31665e5502d8af
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
org.tizen.guides/html/native/app_management/common_appcontrol_n.htm
org.tizen.guides/html/web/app_management/common_appcontrol_w.htm

index 67122e8..8b8e9e4 100644 (file)
@@ -1456,13 +1456,21 @@ app_control_destroy(app_control);
                                                           <li><code>Go</code>: Set key label to <strong>Go</strong></li>
                                                           </ul>
                                                           </td>
-                                                          <td rowspan="2">This key is optional, and <strong>it is supported since Tizen 4.0.</strong></td>
+                                                          <td rowspan="4">This key is optional, and <strong>it is supported since Tizen 4.0.</strong></td>
                        </tr>
                        <tr>
                                <td><code>APP_CONTROL_DATA_INPUT_MAX_TEXT_LENGTH</code></td>
                                <td>The maximum text length allowed in the keyboard input type. This key must be passed as a string.</td>
                        </tr>
                        <tr>
+                               <td><code>APP_CONTROL_DATA_INPUT_CURSOR_POSITION_SET</code></td>
+                               <td>The position where the cursor is to be set in the keyboard input type. This key must be passed as a string.</td>
+                       </tr>
+                       <tr>
+                               <td><code>APP_CONTROL_DATA_INPUT_CURSOR_POSITION_GET</code></td>
+                               <td>The current position of the cursor in the keyboard input type. This key must be passed as a string.</td>
+                       </tr>
+                       <tr>
                                <td><code>APP_CONTROL_DATA_INPUT_REPLY_TYPE</code></td>
                                <td>The reply type. This key must be passed as a string. The available values are:
                                                           <ul>
@@ -1517,6 +1525,8 @@ input_selector(void *data, Evas_Object *obj, void *event_info)
     app_control_add_extra_data(app_control, APP_CONTROL_DATA_INPUT_RETURNKEY_TYPE, "Done");
     /* Extra data for setting limit of text length */
     app_control_add_extra_data(app_control, APP_CONTROL_DATA_INPUT_MAX_TEXT_LENGTH, "10");
+    /* Set cursor position */
+    app_control_add_extra_data(app_control, APP_CONTROL_DATA_INPUT_CURSOR_POSITION_SET, "3");
     app_control_send_launch_request(app_control, input_selector_result, NULL);
     app_control_destroy(app_control);
 }
@@ -1526,6 +1536,7 @@ input_selector_result(app_control_h request, app_control_h reply, app_control_re
 {
     char *value;
     char *type;
+    char *cursor_position;
     if (result == APP_CONTROL_RESULT_SUCCEEDED) {
         int ret = app_control_get_extra_data(reply, APP_CONTROL_DATA_TEXT, &amp;value);
         if (ret == APP_CONTROL_ERROR_NONE) {
@@ -1533,6 +1544,12 @@ input_selector_result(app_control_h request, app_control_h reply, app_control_re
         }
         /* To get input type of result from input delegator */
         app_control_get_extra_data(reply, APP_CONTROL_DATA_INPUT_REPLY_TYPE, &amp;type);
+        ret = app_control_get_extra_data(reply, APP_CONTROL_DATA_INPUT_CURSOR_POSITION_GET, &amp;cursor_position);
+        if (ret == APP_CONTROL_ERROR_NONE)
+        {
+             dlog_print(DLOG_INFO, LOG_TAG, "[cursor_position_get] Succeeded: cursor_position(%s)", cursor_position);
+             elm_entry_cursor_pos_set(entry, atoi(cursor_position));
+        }
         char **path_array = NULL;
         int path_array_len = -1;
         ret = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_PATH, &amp;path_array, &amp;path_array_len);
index dd6d8e8..708a356 100644 (file)
@@ -1388,13 +1388,21 @@ tizen.application.launchAppControl(appControl, null, function() {
                                                           <li><code>Go</code>: Set key label to <strong>Go</strong></li>
                                                           </ul>
                                                           </td>
-                                                          <td rowspan="2">This key is optional, and <strong>it is supported since Tizen 4.0.</strong></td>
+                                                          <td rowspan="4">This key is optional, and <strong>it is supported since Tizen 4.0.</strong></td>
                        </tr>
                        <tr>
                                <td><code>http://tizen.org/appcontrol/data/input_max_text_length</code></td>
                                <td>The maximum text length allowed in the keyboard input type. This key must be passed as a string.</td>
                        </tr>
                        <tr>
+                               <td><code>http://tizen.org/appcontrol/data/input_cursor_position_set</code></td>
+                               <td>The position where the cursor is to be set in the keyboard input type. This key must be passed as a string.</td>
+                       </tr>
+                       <tr>
+                               <td><code>http://tizen.org/appcontrol/data/input_cursor_position_get</code></td>
+                               <td>The current position of the cursor in the keyboard input type. This key must be passed as a string.</td>    
+                       </tr>
+                       <tr>
                                <td><code>http://tizen.org/appcontrol/data/input_reply_type</code></td>
                                <td>The reply type. This key must be passed as a string. The available values are:
                                                           <ul>