summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2019-01-30 18:55:44 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2019-01-30 18:55:44 +0900
commit2eccc5244940f41628548e0ab933e1b76eec599c (patch)
treed4e207cc93d117d17f40465d7b9a22b0a5e94d5f
parent2137154d2a7d5aed1cebf4ee7cbf198280f718d9 (diff)
docs: introduce how to receive media content
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h71
1 files changed, 68 insertions, 3 deletions
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 85c4323..777b89b 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -47,6 +47,8 @@ extern "C" {
47 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions 47 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
48 * @ingroup Ecore_IMF_Lib_Group 48 * @ingroup Ecore_IMF_Lib_Group
49 * 49 *
50 * @section intro Introduction
51 *
50 * Functions that operate on Ecore Input Method Context objects. 52 * Functions that operate on Ecore Input Method Context objects.
51 53
52 * Ecore Input Method Context Function defines the interface for EFL input methods. 54 * Ecore Input Method Context Function defines the interface for EFL input methods.
@@ -64,8 +66,44 @@ extern "C" {
64 * ecore_imf_init() should be called to initialize and load immodule.@n 66 * ecore_imf_init() should be called to initialize and load immodule.@n
65 * ecore_imf_shutdown() is used for shutdowning and unloading immodule. 67 * ecore_imf_shutdown() is used for shutdowning and unloading immodule.
66 * 68 *
67 * An example of usage of these functions can be found at: 69 * @section how-to-compose How to process key event for composition or prediction
70 *
71 * To input Chinese, Japanese, Korean and other complex languages, the editor widget (as known as entry) should be connected with input method framework.@n
72 * Each editor widget should have each input context to connect with input service framework.@n
73 * Key event is processed by input method engine. The result is notified to application through ECORE_IMF_CALLBACK_PREEDIT_CHANGED and ECORE_IMF_CALLBACK_COMMIT event.@n
74 * @n
75 * The following example demonstrates how to connect input method framework and handle preedit and commit string from input method framework.
68 * @li @ref ecore_imf_example_c 76 * @li @ref ecore_imf_example_c
77 *
78 * @section media-content How to receive media contents from input method editor
79 *
80 * Users sometimes wants to send images and other rich content with their input method editor (as known as virtual keyboard or soft keyboard).@n
81 * According to this requirement, the way to receive the media content URI such as images and other rich content as well as text have been provided since 1.20.@n
82 * @n
83 * The following code shows how to receive the media content URI.
84 *
85 * @code
86 * #include <glib.h>
87 *
88 * static void
89 * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
90 * {
91 * Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event;
92 * if (!commit_content) return;
93 *
94 * // convert URI to filename
95 * gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
96 * printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
97 *
98 * // do something to use filepath
99 *
100 * if (filepath)
101 * g_free(filepath);
102 * }
103 *
104 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
105 * @endcode
106 *
69 */ 107 */
70 108
71/** 109/**
@@ -1451,8 +1489,10 @@ EAPI void ecore_imf_context_delete_surrounding_event_ad
1451 * 1489 *
1452 * The event type @p type to trigger the function may be one of 1490 * The event type @p type to trigger the function may be one of
1453 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END, 1491 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
1454 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT and 1492 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT,
1455 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING. 1493 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING, #ECORE_IMF_CALLBACK_SELECTION_SET,
1494 * #ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, #ECORE_IMF_CALLBACK_COMMIT_CONTENT,
1495 * #ECORE_IMF_CALLBACK_TRANSACTION_START, and #ECORE_IMF_CALLBACK_TRANSACTION_END.
1456 * 1496 *
1457 * @param ctx Ecore_IMF_Context to attach a callback to. 1497 * @param ctx Ecore_IMF_Context to attach a callback to.
1458 * @param type The type of event that will trigger the callback 1498 * @param type The type of event that will trigger the callback
@@ -1463,6 +1503,9 @@ EAPI void ecore_imf_context_delete_surrounding_event_ad
1463 * 1503 *
1464 * Example 1504 * Example
1465 * @code 1505 * @code
1506 * #include <glib.h>
1507 *
1508 * // example for handling commit event from input framework
1466 * static void 1509 * static void
1467 * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info) 1510 * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1468 * { 1511 * {
@@ -1471,6 +1514,28 @@ EAPI void ecore_imf_context_delete_surrounding_event_ad
1471 * } 1514 * }
1472 * 1515 *
1473 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data); 1516 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
1517 *
1518 * // example for receiving media content URI from input framework
1519 * @code
1520 * #include <glib.h>
1521 *
1522 * static void
1523 * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1524 * {
1525 * Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event;
1526 * if (!commit_content) return;
1527 *
1528 * // convert URI to filename
1529 * gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
1530 * printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
1531 *
1532 * // do something to use filepath
1533 *
1534 * if (filepath)
1535 * g_free(filepath);
1536 * }
1537 *
1538 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
1474 * @endcode 1539 * @endcode
1475 */ 1540 */
1476EAPI void ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data); 1541EAPI void ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data);