summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf/Ecore_IMF.h
blob: a7923511395cb521c12d572f6b6c1b4822ba488b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
#ifndef _ECORE_IMF_H
#define _ECORE_IMF_H

#include <Eina.h>

#include <ecore_imf_api.h>

#ifdef __cplusplus
extern "C" {
#endif

#define ECORE_IMF_INPUT_HINT_AUTOFILL_MASK 0xff00 /* @deprecated since 1.24 */

/**
 * @defgroup Ecore_IMF_Lib_Group Ecore_IMF - Ecore Input Method Library Functions
 * @ingroup Ecore
 *
 * Utility functions that set up and shut down the Ecore Input Method
 * library.
 */

/**
 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
 * @ingroup Ecore_IMF_Lib_Group
 *
 * @section ecore_imf_intro Introduction
 *
 * Functions that operate on Ecore Input Method Context objects.

 * Ecore Input Method Context Function defines the interface for EFL input methods.
 * An input method is used by EFL text input widgets like elm_entry
 * (based on edje_entry) to map from key events to Unicode character strings.
 *
 * The default input method can be set through setting the ECORE_IMF_MODULE environment variable.
 * eg) export ECORE_IMF_MODULE=xim (or scim or ibus)
 *
 * An input method may consume multiple key events in sequence and finally output the composed result.
 * This is called preediting, and an input method may provide feedback about
 * this process by displaying the intermediate composition states as preedit text.
 *
 * Immodule is plugin to connect your application and input method framework such as SCIM, ibus, and so on.@n
 * ecore_imf_init() should be called to initialize and load immodule.@n
 * ecore_imf_shutdown() is used for shutdowning and unloading immodule.
 *
 * @section how-to-compose How to process key event for composition or prediction
 *
 * To input Chinese, Japanese, Korean and other complex languages, the editor widget (as known as entry) should be connected with input method framework.@n
 * Each editor widget should have each input context to connect with input service framework.@n
 * 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
 * @n
 * The following example demonstrates how to connect input method framework and handle preedit and commit string from input method framework.
 * @li @ref ecore_imf_example_c
 *
 * @section media-content How to receive media contents from input method editor
 *
 * Users sometimes wants to send images and other rich content with their input method editor (as known as virtual keyboard or soft keyboard).@n
 * 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
 * @n
 * The following code shows how to receive the media content URI.
 *
 * @code
 * #include <glib.h>
 *
 * static void
 * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
 * {
 *    Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event_info;
 *    if (!commit_content) return;
 *
 *    // convert URI to filename
 *    gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
 *    printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
 *
 *    // do something to use filepath
 *
 *    if (filepath)
 *       g_free(filepath);
 * }
 *
 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
 * @endcode
 *
 */

/**
 * @addtogroup Ecore_IMF_Context_Group
 *
 * @{
 */

/**
 * @example ecore_imf_example.c
 * Shows how to write simple editor using the Ecore_IMF library.
 */

/* ecore_imf_context_input_panel_event_callback_add() flag */

/**
 * @typedef Ecore_IMF_Input_Panel_Event
 * Enum containing input panel events.
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_STATE_EVENT,              /**< called when the state of the input panel is changed. @since 1.7 */
   ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT,           /**< called when the language of the input panel is changed. @since 1.7 */
   ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT,         /**< called when the shift key state of the input panel is changed @since 1.7 */
   ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT,           /**< called when the size of the input panel is changed. @since 1.7 */
   ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT,          /**< called when the state of the candidate word panel is changed. @since 1.7 */
   ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT,       /**< called when the size of the candidate word panel is changed. @since 1.7 */
   ECORE_IMF_INPUT_PANEL_KEYBOARD_MODE_EVENT       /**< called when the keyboard mode state of the input panel is changed @since 1.20 */
} Ecore_IMF_Input_Panel_Event;

/**
 * @typedef Ecore_IMF_Input_Panel_State
 * Enum containing input panel state notifications.
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_STATE_SHOW,        /**< Notification after the display of the input panel @since 1.7 */
   ECORE_IMF_INPUT_PANEL_STATE_HIDE,        /**< Notification prior to the dismissal of the input panel @since 1.7 */
   ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW    /**< Notification prior to the display of the input panel @since 1.7 */
} Ecore_IMF_Input_Panel_State;

/**
 * @typedef Ecore_IMF_Input_Panel_Shift_Mode
 * Enum containing input shift mode states.
 */
typedef enum
{
    ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF, /**< @since 1.7 */
    ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON   /**< @since 1.7 */
} Ecore_IMF_Input_Panel_Shift_Mode;

/**
 * @typedef Ecore_IMF_Candidate_Panel_State
 * Enum containing candidate word panel state notifications.
 */
typedef enum
{
   ECORE_IMF_CANDIDATE_PANEL_SHOW,        /**< Notification after the display of the candidate word panel @since 1.7 */
   ECORE_IMF_CANDIDATE_PANEL_HIDE         /**< Notification prior to the dismissal of the candidate word panel @since 1.7 */
} Ecore_IMF_Candidate_Panel_State;

/**
 * @typedef Ecore_IMF_Input_Panel_Keyboard_Mode
 * Enum containing keyboard mode states.
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_HW_KEYBOARD_MODE, /**< @since 1.20 */
   ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE  /**< @since 1.20 */
} Ecore_IMF_Input_Panel_Keyboard_Mode;

/* Events sent by the Input Method */
typedef struct _Ecore_IMF_Event_Preedit_Start      Ecore_IMF_Event_Preedit_Start;
typedef struct _Ecore_IMF_Event_Preedit_End        Ecore_IMF_Event_Preedit_End;
typedef struct _Ecore_IMF_Event_Preedit_Changed    Ecore_IMF_Event_Preedit_Changed;
typedef struct _Ecore_IMF_Event_Commit             Ecore_IMF_Event_Commit;
typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
typedef struct _Ecore_IMF_Event_Selection          Ecore_IMF_Event_Selection;
typedef struct _Ecore_IMF_Event_Commit_Content     Ecore_IMF_Event_Commit_Content;

/* Events to filter */
typedef struct _Ecore_IMF_Event_Mouse_Down         Ecore_IMF_Event_Mouse_Down;
typedef struct _Ecore_IMF_Event_Mouse_Up           Ecore_IMF_Event_Mouse_Up;
typedef struct _Ecore_IMF_Event_Mouse_In           Ecore_IMF_Event_Mouse_In;
typedef struct _Ecore_IMF_Event_Mouse_Out          Ecore_IMF_Event_Mouse_Out;
typedef struct _Ecore_IMF_Event_Mouse_Move         Ecore_IMF_Event_Mouse_Move;
typedef struct _Ecore_IMF_Event_Mouse_Wheel        Ecore_IMF_Event_Mouse_Wheel;
typedef struct _Ecore_IMF_Event_Key_Down           Ecore_IMF_Event_Key_Down;
typedef struct _Ecore_IMF_Event_Key_Up             Ecore_IMF_Event_Key_Up;
typedef union  _Ecore_IMF_Event                    Ecore_IMF_Event;

typedef struct _Ecore_IMF_Context                  Ecore_IMF_Context;                  /**< An Input Method Context */
typedef struct _Ecore_IMF_Context_Class            Ecore_IMF_Context_Class;            /**< An Input Method Context class */
typedef struct _Ecore_IMF_Context_Info             Ecore_IMF_Context_Info;             /**< An Input Method Context info */

/* Preedit attribute info */
typedef struct _Ecore_IMF_Preedit_Attr             Ecore_IMF_Preedit_Attr;

ECORE_IMF_API extern int ECORE_IMF_EVENT_PREEDIT_START;
ECORE_IMF_API extern int ECORE_IMF_EVENT_PREEDIT_END;
ECORE_IMF_API extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
ECORE_IMF_API extern int ECORE_IMF_EVENT_COMMIT;
ECORE_IMF_API extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;

/**
 * @typedef Ecore_IMF_Event_Cb
 *
 * @brief Called when a Ecore_IMF event happens.
 *
 * @see  ecore_imf_context_event_callback_add()
 */
typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);

/**
 * @typedef Ecore_IMF_Callback_Type
 *
 * Ecore IMF Event callback types.
 *
 * @see ecore_imf_context_event_callback_add()
 */
typedef enum
{
   ECORE_IMF_CALLBACK_PREEDIT_START,      /**< "PREEDIT_START" is called when a new preediting sequence starts. @since 1.2 */
   ECORE_IMF_CALLBACK_PREEDIT_END,        /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. @since 1.2 */
   ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. @since 1.2 */
   ECORE_IMF_CALLBACK_COMMIT,             /**< "COMMIT" is called when a complete input sequence has been entered by the user @since 1.2 */
   ECORE_IMF_CALLBACK_DELETE_SURROUNDING, /**< "DELETE_SURROUNDING" is called when the input method needs to delete all or part of the context surrounding the cursor @since 1.2 */
   ECORE_IMF_CALLBACK_SELECTION_SET,      /**< "SELECTION_SET" is called when the input method needs to set the selection @since 1.9 */
   ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, /**< "PRIVATE_COMMAND_SEND" is called when the input method sends a private command @since 1.12 */
   ECORE_IMF_CALLBACK_COMMIT_CONTENT,     /**< "COMMIT_CONTENT" is called when the input method commits content such as an image @since 1.20 */
   ECORE_IMF_CALLBACK_TRANSACTION_START,  /**< "TRANSACTION_START" is called when a new transaction sequence starts. @since 1.21 */
   ECORE_IMF_CALLBACK_TRANSACTION_END     /**< "TRANSACTION_END" is called when a new transaction sequence starts. @since 1.21 */
} Ecore_IMF_Callback_Type;

/**
 * @typedef Ecore_IMF_Event_Type
 *
 * Ecore IMF event types.
 *
 * @see ecore_imf_context_filter_event()
 */
typedef enum
{
   ECORE_IMF_EVENT_MOUSE_DOWN,  /**< Mouse Down event */
   ECORE_IMF_EVENT_MOUSE_UP,    /**< Mouse Up event */
   ECORE_IMF_EVENT_MOUSE_IN,    /**< Mouse In event */
   ECORE_IMF_EVENT_MOUSE_OUT,   /**< Mouse Out event */
   ECORE_IMF_EVENT_MOUSE_MOVE,  /**< Mouse Move event */
   ECORE_IMF_EVENT_MOUSE_WHEEL, /**< Mouse Wheel event */
   ECORE_IMF_EVENT_KEY_DOWN,    /**< Key Down event */
   ECORE_IMF_EVENT_KEY_UP       /**< Key Up event */
} Ecore_IMF_Event_Type;
/**
 * @typedef Ecore_IMF_Keyboard_Modifiers
 * Types for Ecore_IMF keyboard modifiers
 */
typedef enum
{
   ECORE_IMF_KEYBOARD_MODIFIER_NONE  = 0,      /**< No active modifiers */
   ECORE_IMF_KEYBOARD_MODIFIER_CTRL  = 1 << 0, /**< "Control" is pressed */
   ECORE_IMF_KEYBOARD_MODIFIER_ALT   = 1 << 1, /**< "Alt" is pressed */
   ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
   ECORE_IMF_KEYBOARD_MODIFIER_WIN   = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
   ECORE_IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4  /**< "AltGr" is pressed @since 1.7 */
} Ecore_IMF_Keyboard_Modifiers;

/**
 * @typedef Ecore_IMF_Keyboard_Locks
 * Types for Ecore_IMF keyboard locks
 */
typedef enum
{
   ECORE_IMF_KEYBOARD_LOCK_NONE      = 0,      /**< No locks are active */
   ECORE_IMF_KEYBOARD_LOCK_NUM       = 1 << 0, /**< "Num" lock is active */
   ECORE_IMF_KEYBOARD_LOCK_CAPS      = 1 << 1, /**< "Caps" lock is active */
   ECORE_IMF_KEYBOARD_LOCK_SCROLL    = 1 << 2  /**< "Scroll" lock is active */
} Ecore_IMF_Keyboard_Locks;

/**
 * @typedef Ecore_IMF_Mouse_Flags
 * Types for Ecore_IMF mouse flags
 */
typedef enum
{
   ECORE_IMF_MOUSE_NONE              = 0,      /**< A single click */
   ECORE_IMF_MOUSE_DOUBLE_CLICK      = 1 << 0, /**< A double click */
   ECORE_IMF_MOUSE_TRIPLE_CLICK      = 1 << 1  /**< A triple click */
} Ecore_IMF_Mouse_Flags;

/**
 * @typedef Ecore_IMF_Input_Mode
 * Types for Ecore_IMF input mode
 */
typedef enum
{
   ECORE_IMF_INPUT_MODE_ALPHA        = 1 << 0,
   ECORE_IMF_INPUT_MODE_NUMERIC      = 1 << 1,
   ECORE_IMF_INPUT_MODE_SPECIAL      = 1 << 2,
   ECORE_IMF_INPUT_MODE_HEXA         = 1 << 3,
   ECORE_IMF_INPUT_MODE_TELE         = 1 << 4,
   ECORE_IMF_INPUT_MODE_FULL         = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
   ECORE_IMF_INPUT_MODE_INVISIBLE    = 1 << 29,
   ECORE_IMF_INPUT_MODE_AUTOCAP      = 1 << 30
} Ecore_IMF_Input_Mode;

/**
 * @typedef Ecore_IMF_Preedit_Type
 *
 * Ecore IMF Preedit style types
 *
 * @see ecore_imf_context_preedit_string_with_attributes_get()
 */
typedef enum
{
   ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style @since 1.1 */
   ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 @since 1.1 */
   ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 @since 1.1 */
   ECORE_IMF_PREEDIT_TYPE_SUB3, /**< Substring style 3 @since 1.1 */
   ECORE_IMF_PREEDIT_TYPE_SUB4, /**< Substring style 4 @since 1.8 */
   ECORE_IMF_PREEDIT_TYPE_SUB5, /**< Substring style 5 @since 1.8 */
   ECORE_IMF_PREEDIT_TYPE_SUB6, /**< Substring style 6 @since 1.8 */
   ECORE_IMF_PREEDIT_TYPE_SUB7  /**< Substring style 7 @since 1.8 */
} Ecore_IMF_Preedit_Type;

/**
 * @typedef Ecore_IMF_Autocapital_Type
 *
 * Autocapitalization Types.
 *
 * @see ecore_imf_context_autocapital_type_set()
 */
typedef enum
{
   ECORE_IMF_AUTOCAPITAL_TYPE_NONE,         /**< No auto-capitalization when typing @since 1.1 */
   ECORE_IMF_AUTOCAPITAL_TYPE_WORD,         /**< Autocapitalize each word typed @since 1.1 */
   ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,     /**< Autocapitalize the start of each sentence @since 1.1 */
   ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters @since 1.1 */
} Ecore_IMF_Autocapital_Type;

/**
 * @typedef Ecore_IMF_Input_Panel_Layout
 *
 * Input panel (virtual keyboard) layout types.
 *
 * @see ecore_imf_context_input_panel_layout_set()
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,          /**< Default layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,          /**< Number layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,           /**< Email layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_URL,             /**< URL layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,     /**< Phone Number layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_IP,              /**< IP layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,           /**< Month layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,      /**< Number Only layout */
   ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID,         /**< Never use this */
   ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,             /**< Hexadecimal layout @since 1.2 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,        /**< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization) @since 1.2 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD,        /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME,        /**< Date and time layout @since 1.8 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_EMOTICON,        /**< Emoticon layout @since 1.10 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_VOICE            /**< Voice layout, but if the IME does not support voice layout, then normal layout will be shown @since 1.19 */
} Ecore_IMF_Input_Panel_Layout;

/**
 * @typedef Ecore_IMF_Input_Panel_Lang
 *
 * Input panel (virtual keyboard) language modes.
 *
 * @see ecore_imf_context_input_panel_language_set()
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC,    /**< Automatic @since 1.2 */
   ECORE_IMF_INPUT_PANEL_LANG_ALPHABET      /**< Alphabet @since 1.2 */
} Ecore_IMF_Input_Panel_Lang;

/**
 * @typedef Ecore_IMF_Input_Panel_Return_Key_Type
 *
 * "Return" Key types on the input panel (virtual keyboard).
 *
 * @see ecore_imf_context_input_panel_return_key_type_set()
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,    /**< Done @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,      /**< Go @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,    /**< Join @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,   /**< Login @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,    /**< Next @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,  /**< Search or magnifier icon @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND,    /**< Send @since 1.2 */
   ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN   /**< Sign-in @since 1.8 */
} Ecore_IMF_Input_Panel_Return_Key_Type;

/**
 * @typedef Ecore_IMF_Input_Hints
 * @brief Enumeration for defining the types of Ecore_IMF Input Hints.
 * @since 1.12
 */
typedef enum
{
   ECORE_IMF_INPUT_HINT_NONE                = 0,        /**< No active hints @since 1.12 */
   ECORE_IMF_INPUT_HINT_AUTO_COMPLETE       = 1 << 0,   /**< Suggest word auto completion @since 1.12 */
   ECORE_IMF_INPUT_HINT_SENSITIVE_DATA      = 1 << 1,   /**< Typed text should not be stored. @since 1.12 */
   ECORE_IMF_INPUT_HINT_MULTILINE           = 1 << 2,   /**< Multiline text @since 1.18 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DATE   = 0x100, /**< Autofill hint for a credit card expiration date @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_DAY    = 0x200, /**< Autofill hint for a credit card expiration day @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_MONTH  = 0x300, /**< Autofill hint for a credit card expiration month @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_EXPIRATION_YEAR   = 0x400, /**< Autofill hint for a credit card expiration year @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_CREDIT_CARD_NUMBER            = 0x500, /**< Autofill hint for a credit card number @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_EMAIL_ADDRESS                 = 0x600, /**< Autofill hint for an email address @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_NAME                          = 0x700, /**< Autofill hint for a user's real name @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_PHONE                         = 0x800, /**< Autofill hint for a phone number @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_ADDRESS                = 0x900, /**< Autofill hint for a postal address @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_POSTAL_CODE                   = 0xA00, /**< Autofill hint for a postal code @deprecated since 1.24 */
   ECORE_IMF_INPUT_HINT_AUTOFILL_ID                            = 0xB00  /**< Autofill hint for a user's ID @deprecated since 1.24 */
} Ecore_IMF_Input_Hints;

/**
 * @typedef Ecore_IMF_Input_Panel_Layout_Normal_Variation
 * @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for normal variation.
 * @since 1.12
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL,            /**< The plain normal layout @since 1.12 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME,          /**< Filename layout. Symbols such as '/' should be disabled. @since 1.12 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME        /**< The name of a person. @since 1.12 */
} Ecore_IMF_Input_Panel_Layout_Normal_Variation;

/**
 * @typedef Ecore_IMF_Input_Panel_Layout_Numberonly_Variation
 * @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for numberonly variation
 * @since 1.8
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL,            /**< The plain normal number layout @since 1.8 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED,            /**< The number layout to allow a positive or negative sign at the start @since 1.8 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL,           /**< The number layout to allow decimal point to provide fractional value @since 1.8 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL /**< The number layout to allow decimal point and negative sign @since 1.8 */
} Ecore_IMF_Input_Panel_Layout_Numberonly_Variation;

/**
 * @typedef Ecore_IMF_Input_Panel_Layout_Password_Variation
 * @brief Enumeration for defining the types of Ecore_IMF Input Panel layout for password variation
 * @since 1.12
 */
typedef enum
{
   ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL,          /**< The normal password layout @since 1.12 */
   ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY       /**< The password layout to allow only number @since 1.12 */
} Ecore_IMF_Input_Panel_Layout_Password_Variation;

/**
 * @typedef Ecore_IMF_BiDi_Direction
 * @brief Enumeration for defining the types of Ecore_IMF bidirectionality.
 * @since 1.12
 */
typedef enum
{
   ECORE_IMF_BIDI_DIRECTION_NEUTRAL,    /**< The Neutral mode @since 1.12 */
   ECORE_IMF_BIDI_DIRECTION_LTR,        /**< The Left to Right mode @since 1.12 */
   ECORE_IMF_BIDI_DIRECTION_RTL         /**< The Right to Left mode @since 1.12 */
} Ecore_IMF_BiDi_Direction;

/**
 * @enum _Ecore_IMF_Device_Class
 * @brief Enumeration for defining the types of Ecore_IMF_Device_Class
 * @since 1.14
 */
typedef enum _Ecore_IMF_Device_Class
{
   ECORE_IMF_DEVICE_CLASS_NONE, /**< Not a device @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_SEAT, /**< The user/seat (the user themselves) @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_KEYBOARD, /**< A regular keyboard, numberpad or attached buttons @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_MOUSE, /**< A mouse, trackball or touchpad relative motion device @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_TOUCH, /**< A touchscreen with fingers or stylus @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_PEN, /**< A special pen device @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_POINTER, /**< A laser pointer, wii-style or "minority report" pointing device @since 1.14 */
   ECORE_IMF_DEVICE_CLASS_GAMEPAD /**<  A gamepad controller or joystick @since 1.14 */
} Ecore_IMF_Device_Class; /**< A general class of device @since 1.14 */

/**
 * @enum _Ecore_IMF_Device_Subclass
 * @brief Enumeration for defining the types of Ecore_IMF_Device_Subclass
 * @since 1.14
 */
typedef enum _Ecore_IMF_Device_Subclass
{
   ECORE_IMF_DEVICE_SUBCLASS_NONE, /**< Not a device @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_FINGER, /**< The normal flat of your finger @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_FINGERNAIL, /**< A fingernail @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_KNUCKLE, /**< A Knuckle @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_PALM, /**< The palm of a users hand @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_HAND_SIZE, /**< The side of your hand @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_HAND_FLAT, /**< The flat of your hand @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_PEN_TIP, /**< The tip of a pen @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_TRACKPAD, /**< A trackpad style mouse @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_TRACKPOINT, /**< A trackpoint style mouse @since 1.14 */
   ECORE_IMF_DEVICE_SUBCLASS_TRACKBALL, /**< A trackball style mouse @since 1.14 */
} Ecore_IMF_Device_Subclass; /**< A general subclass of device @since 1.14 */

/**
 * @struct _Ecore_IMF_Event_Preedit_Start
 * @brief The structure type used with the Preedit_Start Input Method event
 */
struct _Ecore_IMF_Event_Preedit_Start
{
   Ecore_IMF_Context *ctx;
};

/**
 * @struct _Ecore_IMF_Event_Preedit_End
 * @brief The structure type used with the Preedit_End Input Method event
 */
struct _Ecore_IMF_Event_Preedit_End
{
   Ecore_IMF_Context *ctx;
};

/**
 * @struct _Ecore_IMF_Event_Preedit_Changed
 * @brief The structure type used with the Preedit_Changed Input Method event
 */
struct _Ecore_IMF_Event_Preedit_Changed
{
   Ecore_IMF_Context *ctx;
};

/**
 * @struct _Ecore_IMF_Event_Commit
 * @brief The structure type used with the Commit Input Method event
 */
struct _Ecore_IMF_Event_Commit
{
   Ecore_IMF_Context *ctx;
   char              *str;
};

/**
 * @struct _Ecore_IMF_Event_Delete_Surrounding
 * @brief The structure type used with the Delete_Surrounding Input Method event
 */
struct _Ecore_IMF_Event_Delete_Surrounding
{
   Ecore_IMF_Context *ctx;
   int                offset;
   int                n_chars;
};

/**
 * @struct _Ecore_IMF_Event_Selection
 * @brief The structure type used with the Selection Input Method event
 */
struct _Ecore_IMF_Event_Selection
{
   Ecore_IMF_Context *ctx;
   int                start;
   int                end;
};

/**
 * @struct _Ecore_IMF_Event_Commit_Content
 * @brief The structure type used with the Commit_Content Input Method event
 * @since 1.20
 */
struct _Ecore_IMF_Event_Commit_Content
{
   Ecore_IMF_Context *ctx;                  /**< The associated Ecore IMF Context */
   const char        *content_uri;          /**< The content URI */
   const char        *description;          /**< The content description */
   const char        *mime_types;           /**< The content MIME types */
};

/**
 * @struct _Ecore_IMF_Event_Mouse_Down
 * @brief The structure type used with the Mouse_Down event
 */
struct _Ecore_IMF_Event_Mouse_Down
{
   int button;                             /**< The button which has been pressed */
   struct {
      int x, y;
   } output;
   struct {
      int x, y;
   } canvas;
   Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
   Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
   unsigned int                 timestamp; /**< The timestamp when the event occurred */
};

/**
 * @struct _Ecore_IMF_Event_Mouse_Up
 * @brief The structure type used with the Mouse_Up event
 */
struct _Ecore_IMF_Event_Mouse_Up
{
   int button;                             /**< The button which has been released */
   struct {
      int x, y;
   } output;
   struct {
      int x, y;
   } canvas;
   Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
   Ecore_IMF_Mouse_Flags        flags;     /**< The flags corresponding the mouse click (single, double or triple click) */
   unsigned int                 timestamp; /**< The timestamp when the event occurred */
};

/**
 * @struct _Ecore_IMF_Event_Mouse_In
 * @brief The structure type used with the Mouse_In event
 */
struct _Ecore_IMF_Event_Mouse_In
{
   int buttons;
   struct {
      int x, y;
   } output;
   struct {
      int x, y;
   } canvas;
   Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
   unsigned int                 timestamp; /**< The timestamp when the event occurred */
};

/**
 * @struct _Ecore_IMF_Event_Mouse_Out
 * @brief The structure type used with the Mouse_Out event
 */
struct _Ecore_IMF_Event_Mouse_Out
{
   int buttons;
   struct {
      int x, y;
   } output;
   struct {
      int x, y;
   } canvas;
   Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
   unsigned int                 timestamp; /**< The timestamp when the event occurred */
};

/**
 * @struct _Ecore_IMF_Event_Mouse_Move
 * @brief The structure type used with the Mouse_Move event
 */
struct _Ecore_IMF_Event_Mouse_Move
{
   int buttons;
   struct {
      struct {
         int x, y;
      } output;
      struct {
         int x, y;
      } canvas;
   } cur, prev;
   Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
   unsigned int                 timestamp; /**< The timestamp when the event occurred */
};

/**
 * @struct _Ecore_IMF_Event_Mouse_Wheel
 * @brief The structure type used with the Mouse_Wheel event
 */
struct _Ecore_IMF_Event_Mouse_Wheel
{
   int direction;                         /* 0 = default up/down wheel */
   int z;                                 /* ...,-2,-1 = down, 1,2,... = up */
   struct {
      int x, y;
   } output;
   struct {
      int x, y;
   } canvas;
   Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks     locks;     /**< The keyboard locks active when the event has been emitted */
   unsigned int                 timestamp; /**< The timestamp when the event occurred */
};

/**
 * @struct _Ecore_IMF_Event_Key_Down
 * @brief The structure type used with the Key_Down event
 */
struct _Ecore_IMF_Event_Key_Down
{
   const char                   *keyname;   /**< The string name of the key pressed */
   Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
   const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
   const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
   const char                   *compose;   /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
   unsigned int                  timestamp; /**< The timestamp when the event occurred */
   const char                   *dev_name;  /**< The device name of the key pressed @since 1.14 */
   Ecore_IMF_Device_Class        dev_class; /**< The device class of the key pressed @since 1.14 */
   Ecore_IMF_Device_Subclass     dev_subclass; /**< The device subclass of the key pressed @since 1.14 */
   unsigned int                  keycode;   /**< Key scan code numeric value @since 1.22 */
};

/**
 * @struct _Ecore_IMF_Event_Key_Up
 * @brief The structure type used with the Key_Up event
 */
struct _Ecore_IMF_Event_Key_Up
{
   const char                   *keyname;   /**< The string name of the key released */
   Ecore_IMF_Keyboard_Modifiers  modifiers; /**< The keyboard modifiers active when the event has been emitted */
   Ecore_IMF_Keyboard_Locks      locks;     /**< The keyboard locks active when the event has been emitted */
   const char                   *key;       /**< The logical key : (eg shift+1 == exclamation) */
   const char                   *string;    /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
   const char                   *compose;   /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
   unsigned int                  timestamp; /**< The timestamp when the event occurred */
   const char                   *dev_name;  /**< The device name of the key released @since 1.14 */
   Ecore_IMF_Device_Class        dev_class; /**< The device class of the key released @since 1.14 */
   Ecore_IMF_Device_Subclass     dev_subclass; /**< The device subclass of the key released @since 1.14 */
   unsigned int                  keycode;   /**< Key scan code numeric value @since 1.22 */
};

/**
 * @brief A union of IMF events.
 */
union _Ecore_IMF_Event
{
   Ecore_IMF_Event_Mouse_Down  mouse_down;
   Ecore_IMF_Event_Mouse_Up    mouse_up;
   Ecore_IMF_Event_Mouse_In    mouse_in;
   Ecore_IMF_Event_Mouse_Out   mouse_out;
   Ecore_IMF_Event_Mouse_Move  mouse_move;
   Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
   Ecore_IMF_Event_Key_Down    key_down;
   Ecore_IMF_Event_Key_Up      key_up;
};

/**
 * @struct _Ecore_IMF_Preedit_Attr
 * @brief Structure that contains preedit attribute information.
 */
struct _Ecore_IMF_Preedit_Attr
{
   Ecore_IMF_Preedit_Type preedit_type; /**< preedit style type */
   unsigned int start_index;            /**< start index of the range (in bytes) */
   unsigned int end_index;              /**< end index of the range (in bytes) */
};

/**
 * @struct _Ecore_IMF_Context_Class
 * @brief Structure used when creating a new Input Method Context. This
 * structure is mainly used by modules implementing the Input Method Context
 * interface.
 *
 */
struct _Ecore_IMF_Context_Class
{
   void (*add)                 (Ecore_IMF_Context *ctx); /**< Create the Input Method Context */
   void (*del)                 (Ecore_IMF_Context *ctx); /**< Delete the Input Method Context */
   void (*client_window_set)   (Ecore_IMF_Context *ctx, void *window); /**< Set the client window for the Input Method Context */
   void (*client_canvas_set)   (Ecore_IMF_Context *ctx, void *canvas); /**< Set the client canvas for the Input Method Context */
   void (*show)                (Ecore_IMF_Context *ctx); /**< Show the Input Method Context */
   void (*hide)                (Ecore_IMF_Context *ctx); /**< Hide the Input Method Context */
   void (*preedit_string_get)  (Ecore_IMF_Context *ctx, char **str, int *cursor_pos); /**< Return current preedit string and cursor position */
   void (*focus_in)            (Ecore_IMF_Context *ctx); /**< Input Method context widget has gained focus */
   void (*focus_out)           (Ecore_IMF_Context *ctx); /**< Input Method context widget has lost focus */
   void (*reset)               (Ecore_IMF_Context *ctx); /**< A change has been made */
   void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos); /**< Cursor position changed */
   void (*use_preedit_set)     (Ecore_IMF_Context *ctx, Eina_Bool use_preedit); /**< Use preedit string to display feedback */
   void (*input_mode_set)      (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); /**< Set the input mode */
   Eina_Bool (*filter_event)   (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); /**< Internally handle an event */
   void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); /**<  return current preedit string, attributes, and cursor position */
   void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction); /**< Allow text prediction */
   void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type); /**< Set auto-capitalization type */
   void (*control_panel_show)   (Ecore_IMF_Context *ctx); /**< Show the control panel */
   void (*control_panel_hide)   (Ecore_IMF_Context *ctx); /**< Hide the control panel */
   void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); /**< Set the layout of the input panel */
   Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx); /**< Return the current layout of the input panel */
   void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); /**< Set the language of the input panel */
   Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx); /**< Get the current language of the input panel */
   void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h); /**< Set the cursor location */
   void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len); /**< Set panel-specific data to the input panel */
   void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len); /**< Get current panel-specific data from the input panel */
   void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type); /**< Set the return key theme of the input panel based on return key type provided */
   void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled); /**< Disable return key of the input panel */
   void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode); /**< Set input panel caps lock mode */
   void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); /**< Return input panel geometry */
   Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx); /**< Return input panel state */
   void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), void *data); /**< Add a callback on input panel state,language,mode change */
   void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value)); /**< Delete the input panel event callback */
   void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang); /**< Return the current language locale */
   void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); /**< Return the candidate panel geometry */
   void (*input_hint_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints); /**< Sets input hint to fine-tune input methods behavior */
   void (*bidi_direction_set) (Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction); /**< Set bidirectionality at the cursor position */
   Ecore_IMF_Input_Panel_Keyboard_Mode (*keyboard_mode_get) (Ecore_IMF_Context *ctx); /**< Return the current keyboard mode of the input panel */
   void (*prediction_hint_set) (Ecore_IMF_Context *ctx, const char *prediction_hint); /**< Set the prediction hint to the input panel */
   void (*mime_type_accept_set) (Ecore_IMF_Context *ctx, const char *mime_type); /**< Set the MIME type to the input panel */
   void (*input_panel_position_set) (Ecore_IMF_Context *ctx, int x, int y); /**< Set the position of the input panel */
};

/**
 * @struct _Ecore_IMF_Context_Info
 * @brief A IMF structure containing context information.
 */
struct _Ecore_IMF_Context_Info
{
   const char *id;              /* ID */
   const char *description;     /* Human readable description */
   const char *default_locales; /* Languages for which this context is the default, separated by : */
   const char *canvas_type;     /* The canvas type used by the input method. Eg.: evas */
   int         canvas_required; /* Whether the canvas usage is required for this input method */
};

/**
 * @}
 */

/**
 * @ingroup Ecore_IMF_Lib_Group
 * @brief Initialises the Ecore_IMF library.
 * @return  Number of times the library has been initialised without being
 *          shut down.
 */
ECORE_IMF_API int                           ecore_imf_init(void);

/**
 * @ingroup Ecore_IMF_Lib_Group
 * @brief Shuts down the Ecore_IMF library.
 * @return  Number of times the library has been initialised without being
 *          shut down.
 */
ECORE_IMF_API int                           ecore_imf_shutdown(void);

/**
 * @ingroup Ecore_IMF_Lib_Group
 * @brief Registers an Ecore_IMF module.
 *
 * @param info              An Ecore_IMF_Context_Info structure
 * @param imf_module_create A function to call at the creation
 * @param imf_module_exit   A function to call when exiting
 *
 */
ECORE_IMF_API void                          ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void));

/**
 * @ingroup Ecore_IMF_Lib_Group
 * @brief Hides the input panel.
 * @return  EINA_TRUE if the input panel will be hidden
            EINA_FALSE if the input panel is already in hidden state
 * @since 1.8.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_input_panel_hide(void);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the list of the available Input Method Context ids.
 *
 * Note that the caller is responsible for freeing the Eina_List
 * when finished with it. There is no need to finish the list strings.
 *
 * @return Return an Eina_List of strings;
 *         on failure it returns NULL.
 */
ECORE_IMF_API Eina_List                    *ecore_imf_context_available_ids_get(void);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the list of the available Input Method Context ids by canvas type.
 *
 * Note that the caller is responsible for freeing the Eina_List
 * when finished with it. There is no need to finish the list strings.
 *
 * @param  canvas_type A string containing the canvas type.
 * @return Return an Eina_List of strings;
 *         on failure it returns NULL.
 */
ECORE_IMF_API Eina_List                    *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the id of the default Input Method Context.
 * The id may to used to create a new instance of an Input Method
 * Context object.
 *
 * @return Return a string containing the id of the default Input
 *         Method Context; on failure it returns NULL.
 */
ECORE_IMF_API const char                   *ecore_imf_context_default_id_get(void);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the id of the default Input Method Context corresponding to a canvas
 * type.
 * The id may be used to create a new instance of an Input Method
 * Context object.
 *
 * @param  canvas_type A string containing the canvas type.
 * @return Return a string containing the id of the default Input
 *         Method Context; on failure it returns NULL.
 */
ECORE_IMF_API const char                   *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Retrieves the info for the Input Method Context with @p id.
 *
 * @param id The Input Method Context id to query for.
 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
 *         on failure it returns NULL.
 *
 * Example
 * @code
 *
 * const char *ctx_id;
 * const Ecore_IMF_Context_Info *ctx_info;
 * Ecore_IMF_Context *imf_context;
 * ctx_id = ecore_imf_context_default_id_get();
 * if (ctx_id)
 *   {
 *      ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
 *      if (!ctx_info->canvas_type ||
 *          strcmp(ctx_info->canvas_type, "evas") == 0)
 *        {
 *           imf_context = ecore_imf_context_add(ctx_id);
 *        }
 *      else
 *        {
 *           ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
 *           if (ctx_id)
 *             {
 *                imf_context = ecore_imf_context_add(ctx_id);
 *             }
 *        }
 *   }
 * @endcode
 */
ECORE_IMF_API const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Creates a new Input Method Context defined by the given id.
 *
 * @param id The Input Method Context id.
 * @return A newly allocated Input Method Context;
 *         on failure it returns NULL.
 */
ECORE_IMF_API Ecore_IMF_Context            *ecore_imf_context_add(const char *id);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Retrieves the info for the given Input Method Context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
 *         on failure it returns NULL.
 */
ECORE_IMF_API const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Deletes the given Input Method Context and free its memory.
 *
 * @param ctx An #Ecore_IMF_Context.
 */
ECORE_IMF_API void                          ecore_imf_context_del(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the client window for the Input Method Context; this is the
 * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
 * This window is used in order to correctly position status windows, and may
 * also be used for purposes internal to the Input Method Context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param window The client window. This may be @c NULL to indicate
 *               that the previous client window no longer exists.
 */
ECORE_IMF_API void                          ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the client window of the Input Method Context.
 *
 * See @ref ecore_imf_context_client_window_set for more details.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return Return the client window.
 * @since 1.1.0
 */
ECORE_IMF_API void                         *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the client canvas for the Input Method Context; this is the
 * canvas in which the input appears.
 * The canvas type can be determined by using the context canvas type.
 * Actually only canvas with type "evas" (Evas *) is supported.
 * This canvas may be used in order to correctly position status windows, and may
 * also be used for purposes internal to the Input Method Context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param canvas The client canvas. This may be @c NULL to indicate
 *               that the previous client canvas no longer exists.
 */
ECORE_IMF_API void                          ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the client canvas of the Input Method Context.
 *
 * See @ref ecore_imf_context_client_canvas_set for more details.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return Return the client canvas.
 * @since 1.1.0
 */
ECORE_IMF_API void                         *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Asks the Input Method Context to show itself.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * @deprecated use ecore_imf_context_input_panel_show() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_show(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Asks the Input Method Context to hide itself.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * @deprecated use ecore_imf_context_input_panel_hide() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_hide(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Retrieves the current preedit string and cursor position
 * for the Input Method Context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param str Location to store the retrieved string. The
 *            string retrieved must be freed with free().
 * @param cursor_pos Location to store position of cursor (in characters)
 *                   within the preedit string.
 */
ECORE_IMF_API void                          ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Retrieves the current preedit string, attributes and
 * cursor position for the Input Method Context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param str Location to store the retrieved string. The
 *            string retrieved must be freed with free().
 * @param attrs An Eina_List of attributes
 * @param cursor_pos Location to store position of cursor (in characters)
 *                   within the preedit string.
 *
 * Example
 * @code
 * char *preedit_string;
 * int cursor_pos;
 * Eina_List *attrs = NULL, *l = NULL;
 * Ecore_IMF_Preedit_Attr *attr;
 *
 * ecore_imf_context_preedit_string_with_attributes_get(imf_context,
 *                                                      &preedit_string,
 *                                                      &attrs, &cursor_pos);
 * if (!preedit_string) return;
 *
 *  if (strlen(preedit_string) > 0)
 *    {
 *       if (attrs)
 *         {
 *            EINA_LIST_FOREACH(attrs, l, attr)
 *              {
 *                 if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
 *                   {
 *                      // Something to do
 *                   }
 *                 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
 *                   {
 *                      // Something to do
 *                   }
 *                 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
 *                   {
 *                      // Something to do
 *                   }
 *              }
 *         }
 *    }
 *
 * // delete attribute list
 * EINA_LIST_FREE(attrs, attr) free(attr);
 *
 * free(preedit_string);
 * @endcode
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Notifies the Input Method Context that the widget to which its
 * correspond has gained focus.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * Example
 * @code
 * static void
 * _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 * {
 *    Ecore_IMF_Context *imf_context = data;
 *    ecore_imf_context_focus_in(imf_context);
 * }
 *
 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, imf_context);
 * @endcode
 */
ECORE_IMF_API void                          ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Notifies the Input Method Context that the widget to which its
 * correspond has lost focus.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * Example
 * @code
 * static void
 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 * {
 *    Ecore_IMF_Context *imf_context = data;
 *    ecore_imf_context_reset(imf_context);
 *    ecore_imf_context_focus_out(imf_context);
 * }
 *
 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
 * @endcode
 */
ECORE_IMF_API void                          ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Notifies the Input Method Context that a change such as a
 * change in cursor position has been made. This will typically
 * cause the Input Method Context to clear the preedit state or commit the preedit string.
 *
 * The operation of ecore_imf_context_reset() depends on the specific characteristics of
 * each language. For example, the preedit string is cleared in the Chinese and Japanese Input Method Engine.
 * However, The preedit string is committed and then cleared in the Korean Input Method Engine.
 *
 * This function should be called in case of the focus-out and mouse down event callback function.
 * In addition, it should be called before inserting some text.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * Example
 * @code
 * static void
 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 * {
 *    Ecore_IMF_Context *imf_context = data;
 *    ecore_imf_context_reset(imf_context);
 *    ecore_imf_context_focus_out(imf_context);
 * }
 *
 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, imf_context);
 * @endcode
 */
ECORE_IMF_API void                          ecore_imf_context_reset(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Notifies the Input Method Context that a change in the cursor
 * position has been made.
 *
 * This function should be called when cursor position is changed or mouse up event is generated.
 * Some input methods that do a heavy job using this event can give a critical performance latency problem.
 * For better typing performance, we suggest that the cursor position change events need to be occurred
 * only if the cursor position is on a confirmed status not on moving status.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param cursor_pos New cursor position in characters.
 */
ECORE_IMF_API void                          ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Notifies the Input Method Context that a change in the cursor
 * location has been made. The location is relative to the canvas.
 * The cursor location can be used to determine the position of
 * candidate word window in the immodule.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param x cursor x position.
 * @param y cursor y position.
 * @param w cursor width.
 * @param h cursor height.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets whether the IM context should use the preedit string
 * to display feedback. If @c use_preedit is @c EINA_FALSE (default
 * is @c EINA_TRUE), then the IM context may use some other method to display
 * feedback, such as displaying it in a child of the root window.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param use_preedit Whether the IM context should use the preedit string.
 */
ECORE_IMF_API void                          ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the callback to be used on surrounding_get request.
 *
 * This callback will be called when the Input Method Context
 * module requests the surrounding context.
 * Input methods typically want context in order to constrain input text based on existing text;
 * this is important for languages such as Thai where only some sequences of characters are allowed.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param func The callback to be called.
 * @param data The data pointer to be passed to @p func
 */
ECORE_IMF_API void                          ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the callback to be used on selection_get request.
 *
 * This callback will be called when the Input Method Context
 * module requests the selection context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param func The callback to be called.
 * @param data The data pointer to be passed to @p func
 * @since 1.9.0
 */
ECORE_IMF_API void                          ecore_imf_context_retrieve_selection_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text), const void *data);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the input mode used by the Ecore Input Context.
 *
 * The input mode can be one of the input modes defined in
 * Ecore_IMF_Input_Mode. The default input mode is
 * ECORE_IMF_INPUT_MODE_FULL.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param input_mode The input mode to be used by @p ctx.
 */
ECORE_IMF_API void                          ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the input mode being used by the Ecore Input Context.
 *
 * See @ref ecore_imf_context_input_mode_set for more details.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return The input mode being used by @p ctx.
 */
ECORE_IMF_API Ecore_IMF_Input_Mode          ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Allows an Ecore Input Context to internally handle an event.
 * If this function returns @c EINA_TRUE, then no further processing
 * should be done for this event.
 *
 * Input methods must be able to accept all types of events (simply
 * returning @c EINA_FALSE if the event was not handled), but there is no
 * obligation of any events to be submitted to this function.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param type The type of event defined by #Ecore_IMF_Event_Type.
 * @param event The event itself.
 * @return @c EINA_TRUE if the event was handled; otherwise @c EINA_FALSE.
 *
 * Example
 * @code
 * static void
 * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 * {
 *    Evas_Event_Key_Down *ev = event_info;
 *    if (!ev->key) return;
 *
 *    if (imf_context)
 *      {
 *         Ecore_IMF_Event_Key_Down ecore_ev;
 *         ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
 *         if (ecore_imf_context_filter_event(imf_context,
 *                                            ECORE_IMF_EVENT_KEY_DOWN,
 *                                            (Ecore_IMF_Event *)&ecore_ev))
 *           return;
 *      }
 * }
 *
 * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
 * @endcode
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);

/* plugin specific functions */

/**
 * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
 * @ingroup Ecore_IMF_Lib_Group
 *
 * Functions that should be used by Ecore Input Method Context modules.
 */

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Creates a new Input Method Context with klass specified by @p ctxc.
 *
 * This method should be used by modules implementing the Input
 * Method Context interface.
 *
 * @param ctxc An #Ecore_IMF_Context_Class.
 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
 */
ECORE_IMF_API Ecore_IMF_Context            *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * Sets the Input Method Context specific data.
 *
 * Note that this method should be used by modules to set
 * the Input Method Context specific data and it's not meant to
 * be used by applications to store application specific data.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param data The Input Method Context specific data.
 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
 */
ECORE_IMF_API void                          ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Gets the Input Method Context specific data.
 *
 * See @ref ecore_imf_context_data_set for more details.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return The Input Method Context specific data.
 */
ECORE_IMF_API void                         *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Retrieves context around insertion point.
 * Input methods typically want context in order to constrain input text based on existing text;
 * this is important for languages such as Thai where only some sequences of characters are allowed.
 * In addition, the text around the insertion point can be used for supporting autocapital feature.
 *
 * This function is implemented by calling the
 * Ecore_IMF_Context::retrieve_surrounding_func (
 * set using #ecore_imf_context_retrieve_surrounding_callback_set).
 *
 * There is no obligation for a widget to respond to the
 * retrieve_surrounding_func, so input methods must be prepared
 * to function without context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param text Location to store a UTF-8 encoded string of text
 *             holding context around the insertion point.
 *             If the function returns @c EINA_TRUE, then you must free
 *             the result stored in this location with free().
 * @param cursor_pos Location to store the position in characters of
 *                   the insertion cursor within @p text.
 * @return @c EINA_TRUE if surrounding text was provided; otherwise
 * @c EINA_FALSE.
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Retrieves the selected text.
 *
 * This function is implemented by calling the
 * Ecore_IMF_Context::retrieve_selection_func (
 * set using #ecore_imf_context_retrieve_selection_callback_set).
 *
 * There is no obligation for a widget to respond to the
 * retrieve_surrounding_func, so input methods must be prepared
 * to function without context.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param text Location to store a UTF-8 encoded string of the selected text.
 *             If the function returns @c EINA_TRUE, then you must free
 *             the result stored in this location with free().
 * @return @c EINA_TRUE if selected text was provided; otherwise
 * @c EINA_FALSE.
 * @since 1.9.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_selection_get(Ecore_IMF_Context *ctx, char **text);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
 *
 * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
 * It's asynchronous method to put event to the event queue.
 * ecore_imf_context_event_callback_call() can be used as synchronous method.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * @deprecated use ecore_imf_context_event_callback_call() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
 *
 * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
 * It's asynchronous method to put event to the event queue.
 * ecore_imf_context_event_callback_call() can be used as synchronous method.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * @deprecated use ecore_imf_context_event_callback_call() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
 *
 * It's asynchronous method to put event to the event queue.
 * ecore_imf_context_event_callback_call() can be used as synchronous method.
 *
 * @param ctx An #Ecore_IMF_Context.
 *
 * @deprecated use ecore_imf_context_event_callback_call() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Adds ECORE_IMF_EVENT_COMMIT to the event queue.
 *
 * It's asynchronous method to put event to the event queue.
 * ecore_imf_context_event_callback_call() can be used as synchronous method.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param str The committed string.
 *
 * @deprecated use ecore_imf_context_event_callback_call() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
 *
 * Asks the widget that the input context is attached to to delete characters around the cursor position
 * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
 * Note that offset and n_chars are in characters not in bytes.
 *
 * It's asynchronous method to put ECORE_IMF_EVENT_DELETE_SURROUNDING event to the event queue.
 * ecore_imf_context_event_callback_call() can be used as synchronous method.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param offset The start offset of surrounding to be deleted.
 * @param n_chars The number of characters to be deleted.
 *
 * @deprecated use ecore_imf_context_event_callback_call() instead.
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Adds (registers) a callback function to a given context event.
 *
 * This function adds a function callback to the context @p ctx when the
 * event of type @p type occurs on it. The function pointer is @p
 * func.
 *
 * The event type @p type to trigger the function may be one of
 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT,
 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING, #ECORE_IMF_CALLBACK_SELECTION_SET,
 * #ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, #ECORE_IMF_CALLBACK_COMMIT_CONTENT,
 * #ECORE_IMF_CALLBACK_TRANSACTION_START, and #ECORE_IMF_CALLBACK_TRANSACTION_END.
 *
 * @param ctx Ecore_IMF_Context to attach a callback to.
 * @param type The type of event that will trigger the callback
 * @param func The (callback) function to be called when the event is
 *        triggered
 * @param data The data pointer to be passed to @p func
 * @since 1.2.0
 *
 * Example
 * @code
 * #include <glib.h>
 *
 * // example for handling commit event from input framework
 * static void
 * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
 * {
 *    char *commit_str = event_info;
 *    // something to do
 * }
 *
 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
 *
 * // example for receiving media content URI from input framework
 * @code
 * #include <glib.h>
 *
 * static void
 * _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
 * {
 *    Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event;
 *    if (!commit_content) return;
 *
 *    // convert URI to filename
 *    gchar *filepath = g_filename_from_uri(commit_content->content_uri, NULL, NULL);
 *    printf("filepath : %s, description : %s, mime types : %s\n", filepath, commit_content->description, commit_content->mime_types);
 *
 *    // do something to use filepath
 *
 *    if (filepath)
 *       g_free(filepath);
 * }
 *
 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, data);
 * @endcode
 */
ECORE_IMF_API void                          ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Deletes (unregisters) a callback function registered to a given
 * context event.
 *
 * This function removes a function callback from the context @p ctx when the
 * event of type @p type occurs on it. The function pointer is @p
 * func.
 *
 * @see ecore_imf_context_event_callback_add() for more details
 *
 * @param ctx Ecore_IMF_Context to remove a callback from.
 * @param type The type of event that was triggering the callback
 * @param func The (callback) function that was to be called when the event was triggered
 * @return the data pointer
 * @since 1.2.0
 */
ECORE_IMF_API void                         *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);

/**
 * @ingroup Ecore_IMF_Context_Module_Group
 * @brief Calls a given callback on the context @p ctx.
 *
 * ecore_imf_context_preedit_start_event_add(), ecore_imf_context_preedit_end_event_add(),
 * ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_commit_event_add() and
 * ecore_imf_context_delete_surrounding_event_add() APIs are asynchronous
 * because those API adds each event to the event queue.
 *
 * This API provides the way to call each callback function immediately.
 *
 * @param ctx Ecore_IMF_Context.
 * @param type The type of event that will trigger the callback
 * @param event_info The pointer to event specific struct or information to
 *        pass to the callback functions registered on this event
 * @since 1.2.0
 */
ECORE_IMF_API void                          ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets whether the IM context should allow to use the text prediction.
 * If @p prediction is @c EINA_FALSE (default is @c EINA_TRUE), then the IM
 * context will not display the text prediction window.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param prediction Whether the IM context should allow to use the text prediction.
 * @note Default value is EINA_TRUE.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets whether the IM context should allow to use the text prediction.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return @c EINA_TRUE if it allows to use the text prediction, otherwise
 * @c EINA_FALSE.
 * @since 1.1.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the autocapitalization type on the immodule.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param autocapital_type the autocapitalization type.
 * @note Default type is ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the autocapitalization type.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return The autocapital type being used by @p ctx.
 * @since 1.1.0
 */
ECORE_IMF_API Ecore_IMF_Autocapital_Type    ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the input hint which allows input methods to fine-tune their behavior.
 *
 * @param ctx An #Ecore_IMF_Context
 * @param hints Input hint
 * @note The default input hint is @c ECORE_IMF_INPUT_HINT_AUTO_COMPLETE.
 * @since 1.12
 */
ECORE_IMF_API void                          ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints hints);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the value of input hint.
 *
 * @param ctx An #Ecore_IMF_Context
 * @return The value of input hint
 * @since 1.12
 */
ECORE_IMF_API Ecore_IMF_Input_Hints         ecore_imf_context_input_hint_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Asks the Input Method Context to show the control panel of using Input Method.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @since 1.1.0
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Asks the Input Method Context to hide the control panel of using Input Method.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @since 1.1.0
 */
EINA_DEPRECATED ECORE_IMF_API void          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Asks the Input Method Context to show the input panel (virtual keyboard).
 *
 * @param ctx An #Ecore_IMF_Context.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Asks the Input Method Context to hide the input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the layout of the input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param layout see #Ecore_IMF_Input_Panel_Layout
 * @note Default layout type is ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the layout of the current active input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return layout see #Ecore_IMF_Input_Panel_Layout
 * @since 1.1.0
 */
ECORE_IMF_API Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the layout variation of the current active input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param variation the layout variation
 * @note Default layout variation type is NORMAL.
 * @since 1.8.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_layout_variation_set(Ecore_IMF_Context *ctx, int variation);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the layout variation of the current active input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return the layout variation
 * @since 1.8.0
 */
ECORE_IMF_API int                           ecore_imf_context_input_panel_layout_variation_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the language of the input panel.
 * This API can be used when you want to show the English keyboard.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param lang the language to be set to the input panel.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the language of the input panel.
 *
 * See @ref ecore_imf_context_input_panel_language_set for more details.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return Ecore_IMF_Input_Panel_Lang
 * @since 1.1.0
 */
ECORE_IMF_API Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets whether the Input Method Context should request to show the input panel automatically
 * when the widget has focus.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
 * @since 1.1.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enabled);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets whether the Input Method Context requests to show the input panel automatically.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return Return the attribute to show the input panel automatically
 * @since 1.1.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the input panel-specific data to deliver to the input panel.
 * This API is used by applications to deliver specific data to the input panel.
 * The data format MUST be negotiated by both application and the input panel.
 * The size and format of data are defined by the input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param data The specific data to be set to the input panel.
 * @param len the length of data, in bytes, to send to the input panel
 * @since 1.2.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the specific data of the current active input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param data The specific data to be got from the input panel
 * @param len The length of data
 * @since 1.2.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
 *
 * An input panel displays the string or icon associated with this type.@n
 * Regardless of return key type, return key event will be generated when pressing return key.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param return_key_type The type of "return" key on the input panel
 * @note Default type is ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT.
 * @since 1.2.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the "return" key type.
 *
 * @see ecore_imf_context_input_panel_return_key_type_set() for more details
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return The type of "return" key on the input panel
 * @since 1.2.0
 */
ECORE_IMF_API Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the return key on the input panel to be disabled.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param disabled The state
 * @since 1.2.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets whether the return key on the input panel should be disabled or not.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return @c EINA_TRUE if it should be disabled.
 * @since 1.2.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the caps lock mode on the input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param mode Turn on caps lock on the input panel if @c EINA_TRUE.
 * @since 1.2.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the caps lock mode on the input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return @c EINA_TRUE if the caps lock is turned on.
 * @since 1.2.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the position of the current active input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param x top-left x co-ordinate of the input panel
 * @param y top-left y co-ordinate of the input panel
 * @param w width of the input panel
 * @param h height of the input panel
 * @since 1.3
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets state of current active input panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return The state of input panel.
 * @since 1.3
 */
ECORE_IMF_API Ecore_IMF_Input_Panel_State   ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Registers a callback function which will be called if there is change in input panel state,language,mode etc.
 * In order to deregister the callback function
 * Use @ref ecore_imf_context_input_panel_event_callback_del.
 *
 * @param ctx An #Ecore_IMF_Context
 * @param type event type
 * @param func the callback function
 * @param data application-input panel specific data.
 * @since 1.3
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Unregisters a callback function which will be called if there is change in input panel state, language, mode etc.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param type An #Ecore_IMF_Input_Panel_Event.
 * @param func the callback function
 * @since 1.3
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Calls a given input panel callback on the context @p ctx.
 *
 * @param ctx Ecore_IMF_Context.
 * @param type The type of event that will trigger the callback
 * @param value the event value
 * @since 1.8.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, int value);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Deletes all input panel callback on the context @p ctx.
 *
 * Deletes all input panel callback to be registered by ecore_imf_context_input_panel_event_callback_add()
 *
 * @param ctx Ecore_IMF_Context.
 * @since 1.8.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_event_callback_clear(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the current language locale of the input panel.
 *
 * ex) fr_FR
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param lang Location to store the retrieved language string. The
 *             string retrieved must be freed with free().
 * @since 1.3
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the geometry information of the candidate panel.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param x top-left x co-ordinate of the candidate panel
 * @param y top-left y co-ordinate of the candidate panel
 * @param w width of the candidate panel
 * @param h height of the candidate panel
 * @since 1.3
 */
ECORE_IMF_API void                          ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets whether the Input Method Context should request to show the input panel in case of only a user's explicit Mouse Up event.
 * It doesn't request to show the input panel even though the Input Method Context has focus.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @param ondemand If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.)
 * @since 1.8.0
 */
ECORE_IMF_API void                          ecore_imf_context_input_panel_show_on_demand_set(Ecore_IMF_Context *ctx, Eina_Bool ondemand);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets whether the Input Method Context should request to show the input panel in case of only a user's explicit Mouse Up event.
 *
 * @param ctx An #Ecore_IMF_Context.
 * @return @c EINA_TRUE if the input panel will be shown in case of only Mouse up event.
 * @since 1.8.0
 */
ECORE_IMF_API Eina_Bool                     ecore_imf_context_input_panel_show_on_demand_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the bidirectionality at the current cursor position.
 *
 * @since 1.12.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @param[in] direction The direction mode
 */
ECORE_IMF_API void                          ecore_imf_context_bidi_direction_set(Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the bidirectionality at the current cursor position.
 *
 * @since 1.12.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @return The direction mode
 */
ECORE_IMF_API Ecore_IMF_BiDi_Direction      ecore_imf_context_bidi_direction_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Get the keyboard mode on the input panel.
 *
 * @since 1.20.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @return the keyboard mode
 */
ECORE_IMF_API Ecore_IMF_Input_Panel_Keyboard_Mode ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Set the prediction hint string to deliver to the input panel.
 *
 * This API can be used when you want to set prediction hint to use intelligent reply suggestion service.
 * The intelligent reply suggestion service generates reply candidates for given prediction hint.
 * Example
 * prediction hint: How are you? -> result: I'm fine, Not bad, I'm all right.
 *
 * @since 1.20.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @param[in] prediction_hint The prediction hint string.
 */
ECORE_IMF_API void                          ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *prediction_hint);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the allowed MIME type to deliver to the input panel.
 *
 * @since 1.20.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @param[in] mime_type The allowed MIME type in entry
 *
 * Example
 * @code
 * const char *mime_type = "text/plain,image/png,application/pdf";
 * ecore_imf_context_mime_type_accept_set(imf_context, mime_type);
 * @endcode
 */
ECORE_IMF_API void                         ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_type);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the x,y coordinates of the input panel.
 * @remarks This API can be used in floating mode.
 *
 * @since 1.21.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @param x top-left x coordinate of the input panel
 * @param y top-left y coordinate of the input panel
 */
ECORE_IMF_API void                         ecore_imf_context_input_panel_position_set(Ecore_IMF_Context *ctx, int x, int y);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Sets the prediction hint data at the specified key
 *
 * @since 1.21.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @param key The key of the prediction hint
 * @param value The data to replace
 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
 *
 * This function modifies the data of @p key with @p data in the hash associated @p
 * ctx. If no entry is found, @p data is added to the hash associated @p ctx with the
 * key @p key. On success this function returns EINA_TRUE,
 * otherwise it returns @c EINA_FALSE.
 */
ECORE_IMF_API Eina_Bool                    ecore_imf_context_prediction_hint_hash_set(Ecore_IMF_Context *ctx, const char *key, const char *value);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Removes the prediction hint data identified by a key
 *
 * @since 1.21.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @param key The key of the prediction hint
 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
 *
 * This function removes the entry identified by @p key from the hash associated @p ctx.
 */
ECORE_IMF_API Eina_Bool                    ecore_imf_context_prediction_hint_hash_del(Ecore_IMF_Context *ctx, const char *key);

/**
 * @ingroup Ecore_IMF_Context_Group
 * @brief Gets the hash table of prediction hint data
 *
 * @since 1.21.0
 *
 * @param[in] ctx An #Ecore_IMF_Context
 * @return The prediction hint hash table
 */
ECORE_IMF_API const Eina_Hash             *ecore_imf_context_prediction_hint_hash_get(Ecore_IMF_Context *ctx);

/* The following entry points must be exported by each input method module
 */

/*
 * int                imf_module_init   (const Ecore_IMF_Context_Info **info);
 * void               imf_module_exit   (void);
 * Ecore_IMF_Context *imf_module_create (void);
 */

#ifdef __cplusplus
}
#endif

#endif