vmio_sdk.h 94.4 KB
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 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

#ifndef VMIO_SDK_H_
#define VMIO_SDK_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "vmsys.h"
#include "vmsim.h"
#include "vmtel.h"

#ifndef MAX_APP_NAME_LEN
#define MAX_APP_NAME_LEN					(260)
#endif

typedef enum 
{
	VM_FILE_COMMIT_ERROR = -1,
	VM_FILE_OPEN_ERROR = -2,
	VM_FILE_NAME_ERROR = -1,
	VM_FILE_OK = 0
} vm_file_error_t;

typedef enum
{
      VM_STORE_PATH_TYPE_PHOTO,
      VM_STORE_PATH_TYPE_VIDEO,
      VM_STORE_PATH_TYPE_MUSIC,
      VM_STORE_PATH_TYPE_RINGTONE,
      VM_STORE_PATH_TYPE_DOCUMENT,
      VM_STORE_PATH_TYPE_OTHERS

} VM_STORE_PATH_TYPE;


/* Key events supported by MRE. */

#define VM_KEY_EVENT_UP       (1)       /* Key up event */
#define VM_KEY_EVENT_DOWN        (2)    /* Key down event */
#define VM_KEY_EVENT_LONG_PRESS  (3)    /* Key long press event */
#define VM_KEY_EVENT_REPEAT      (4)    /* Key repeat event */

/* Key codes supported by MRE. */

#define VM_KEY_UP             (-1)      /* Arrow key up */
#define VM_KEY_DOWN           (-2)      /* Arrow key down */
#define VM_KEY_LEFT              (-3)   /* Arrow key left */
#define VM_KEY_RIGHT          (-4)      /* Arrow key right */
#define VM_KEY_LEFT_SOFTKEY      (-6)   /* Left soft key */
#define VM_KEY_RIGHT_SOFTKEY     (-7)   /* Right soft key */
#define VM_KEY_OK             (-5)      /* OK key */
#define VM_KEY_CLEAR          (-8)      /* Clear key */
#define VM_KEY_BACK              (-9)   /* Back key */
#define VM_KEY_HOME             (-10)    /* Key home */
#define VM_KEY_END                (-11)    /* key end */
#define VM_KEY_NUM0           (48)      /* Number key 0 */
#define VM_KEY_NUM1           (49)      /* Number key 1 */
#define VM_KEY_NUM2           (50)      /* Number key 2 */
#define VM_KEY_NUM3           (51)      /* Number key 3 */
#define VM_KEY_NUM4           (52)      /* Number key 4 */
#define VM_KEY_NUM5           (53)      /* Number key 5 */
#define VM_KEY_NUM6           (54)      /* Number key 6 */
#define VM_KEY_NUM7           (55)      /* Number key 7 */
#define VM_KEY_NUM8           (56)      /* Number key 8 */
#define VM_KEY_NUM9           (57)      /* Number key 9 */
#define VM_KEY_VOL_UP            (58)   /* Volume key up */
#define VM_KEY_VOL_DOWN       (59)      /* Volume key down */
#define VM_KEY_POUND          (35)      /* Key # */
#define VM_KEY_STAR              (42)   /* Key * */

/* Key codes from A to Z on a qwerty keypad, each code represents the Unicode value of the corresponding capital letter. */
#define  VM_KEY_A 65    /* A */
#define  VM_KEY_B 66    /* B */
#define  VM_KEY_C 67    /* C */
#define  VM_KEY_D 68    /* D */
#define  VM_KEY_E 69    /* E */
#define  VM_KEY_F 70    /* F */
#define  VM_KEY_G 71    /* G */
#define  VM_KEY_H 72    /* H */
#define  VM_KEY_I 73    /* I */
#define  VM_KEY_J 74    /* J */
#define  VM_KEY_K 75    /* K */
#define  VM_KEY_L 76    /* L */
#define  VM_KEY_M 77    /* M */
#define  VM_KEY_N 78    /* N */
#define  VM_KEY_O 79    /* O */
#define  VM_KEY_P 80    /* P */
#define  VM_KEY_Q 81    /* Q */
#define  VM_KEY_R 82    /* R */
#define  VM_KEY_S 83    /* S */
#define  VM_KEY_T 84    /* T */
#define  VM_KEY_U 85    /* U */
#define  VM_KEY_V 86    /* V */
#define  VM_KEY_W 87    /* W */
#define  VM_KEY_X 88    /* X */
#define  VM_KEY_Y 89    /* Y */
#define  VM_KEY_Z 90    /* Z */
#define  VM_KEY_SPACE 91    /* Space */
#define  VM_KEY_TAB 92    /* Tab */
#define  VM_KEY_DEL 93    /* Delete */
#define  VM_KEY_ALT 94    /* Alt */
#define  VM_KEY_CTRL 95    /* Ctrl */
#define  VM_KEY_WIN 96    /* Winodows key */
#define  VM_KEY_SHIFT 97    /* Shift */
#define  VM_KEY_QUESTION 98    /* Question */
#define  VM_KEY_PERIOD 99    /* Period */
#define  VM_KEY_COMMA 100    /* Comma (,) */
#define  VM_KEY_EXCLAMATION 101    /* Exclamation (!) */
#define  VM_KEY_APOSTROPHE 102    /* Apostrophe (') */
#define  VM_KEY_AT 103    /* @ */
#define  VM_KEY_BACKSPACE 104    /* Backspace */
#define  VM_KEY_QWERTY_ENTER 105    /* Qwerty enter */
#define  VM_KEY_FN 106    /* Function */
#define  VM_KEY_SYMBOL 107    /* Symbol */
#define  VM_KEY_NUM_LOCK 108    /* Number lock */
#define  VM_KEY_QWERTY_MENU 109    /* Qwerty menu */


typedef enum
{
VM_INPUT_MODE_NONE = 0,
VM_INPUT_MODE_123,
VM_INPUT_MODE_123_SYMBOLS,
/* English */
VM_INPUT_MODE_MULTITAP_UPPERCASE_ABC,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ABC,
VM_INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC,
VM_INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC,
/* The above 6 input modes are used by Q03C WCSS editor, and the
 * editor requires the input modes values are smaller than 0x1F,
 * so we should make sure the input modes used in UI_check_WCSS_normal_character() 
 * of gui_inputs.c are smaller than 0x1F
 */
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ABC, 
VM_INPUT_MODE_SMART_LOWERCASE_ABC, 
VM_INPUT_MODE_SMART_UPPERCASE_ABC, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ABC,

VM_INPUT_MODE_ARABIC_NUMERIC,
VM_INPUT_MODE_FLOAT_123,
VM_INPUT_MODE_HK_STROKE,    
VM_INPUT_MODE_KEYPAD_NUMERIC,
VM_INPUT_MODE_MAGIC_NUMBER,
VM_INPUT_MODE_PHONE_NUMBER,
VM_INPUT_MODE_PHONE_NUMBER_WILDCHAR,
VM_INPUT_MODE_SIGNED_123,
VM_INPUT_MODE_SIGNED_FLOAT_123,
VM_INPUT_MODE_SIM_NUMERIC,

/*Afrikaans*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_AFRIKAANS,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_AFRIKAANS,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_AFRIKAANS, 
VM_INPUT_MODE_SMART_LOWERCASE_AFRIKAANS, 
VM_INPUT_MODE_SMART_UPPERCASE_AFRIKAANS, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_AFRIKAANS,
/*Albanian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ALBANIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ALBANIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ALBANIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_ALBANIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_ALBANIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ALBANIAN,
/*Armenian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ARMENIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ARMENIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ARMENIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_ARMENIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_ARMENIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ARMENIAN,
/*Arabic*/
VM_INPUT_MODE_MULTITAP_ARABIC,    
VM_INPUT_MODE_SMART_ARABIC,
/*Assamese*/
VM_INPUT_MODE_MULTITAP_ASSAMESE,    
VM_INPUT_MODE_SMART_ASSAMESE,
/*Azerbaijani*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_AZERBAIJANI,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_AZERBAIJANI,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_AZERBAIJANI, 
VM_INPUT_MODE_SMART_LOWERCASE_AZERBAIJANI, 
VM_INPUT_MODE_SMART_UPPERCASE_AZERBAIJANI, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_AZERBAIJANI,
/*Basque*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_BASQUE,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_BASQUE,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_BASQUE, 
VM_INPUT_MODE_SMART_LOWERCASE_BASQUE, 
VM_INPUT_MODE_SMART_UPPERCASE_BASQUE, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_BASQUE,
/*Bengali*/
VM_INPUT_MODE_MULTITAP_BENGALI,    
VM_INPUT_MODE_SMART_BENGALI,
/*Bulgarian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_BULGARIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_BULGARIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_BULGARIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_BULGARIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_BULGARIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_BULGARIAN,
/*Catalan*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_CATALAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_CATALAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_CATALAN, 
VM_INPUT_MODE_SMART_LOWERCASE_CATALAN, 
VM_INPUT_MODE_SMART_UPPERCASE_CATALAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_CATALAN,
/*Croatian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_CROATIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_CROATIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_CROATIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_CROATIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_CROATIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_CROATIAN,
/*Czech*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_CZECH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_CZECH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_CZECH, 
VM_INPUT_MODE_SMART_LOWERCASE_CZECH, 
VM_INPUT_MODE_SMART_UPPERCASE_CZECH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_CZECH,
/*Danish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_DANISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_DANISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_DANISH, 
VM_INPUT_MODE_SMART_LOWERCASE_DANISH, 
VM_INPUT_MODE_SMART_UPPERCASE_DANISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_DANISH,
/*Dutch*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_DUTCH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_DUTCH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_DUTCH, 
VM_INPUT_MODE_SMART_LOWERCASE_DUTCH, 
VM_INPUT_MODE_SMART_UPPERCASE_DUTCH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_DUTCH,
/*Estonian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ESTONIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ESTONIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ESTONIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_ESTONIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_ESTONIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ESTONIAN,
/*Filipino*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_FILIPINO,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_FILIPINO,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_FILIPINO, 
VM_INPUT_MODE_SMART_LOWERCASE_FILIPINO, 
VM_INPUT_MODE_SMART_UPPERCASE_FILIPINO, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_FILIPINO,
/*Finnish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_FINNISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_FINNISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_FINNISH, 
VM_INPUT_MODE_SMART_LOWERCASE_FINNISH, 
VM_INPUT_MODE_SMART_UPPERCASE_FINNISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_FINNISH,
/*French*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_FRENCH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_FRENCH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_FRENCH, 
VM_INPUT_MODE_SMART_LOWERCASE_FRENCH, 
VM_INPUT_MODE_SMART_UPPERCASE_FRENCH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_FRENCH,
/*Galician*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_GALICIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_GALICIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_GALICIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_GALICIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_GALICIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_GALICIAN,
/*Georgian*/
VM_INPUT_MODE_MULTITAP_GEORGIAN,    
VM_INPUT_MODE_SMART_GEORGIAN,
/*German*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_GERMAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_GERMAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_GERMAN, 
VM_INPUT_MODE_SMART_LOWERCASE_GERMAN, 
VM_INPUT_MODE_SMART_UPPERCASE_GERMAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_GERMAN,
/*Greek*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_GREEK,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_GREEK,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_GREEK, 
VM_INPUT_MODE_SMART_LOWERCASE_GREEK, 
VM_INPUT_MODE_SMART_UPPERCASE_GREEK, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_GREEK,
/*Gujarati*/
VM_INPUT_MODE_MULTITAP_GUJARATI,    
VM_INPUT_MODE_SMART_GUJARATI,
/*Hausa*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_HAUSA,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_HAUSA,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_HAUSA, 
VM_INPUT_MODE_SMART_LOWERCASE_HAUSA, 
VM_INPUT_MODE_SMART_UPPERCASE_HAUSA, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_HAUSA,
/*Hebrew*/
VM_INPUT_MODE_MULTITAP_HEBREW,    
VM_INPUT_MODE_SMART_HEBREW,
/*Hindi*/
VM_INPUT_MODE_MULTITAP_HINDI,    
VM_INPUT_MODE_SMART_HINDI,
/*Hungarian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_HUNGARIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_HUNGARIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_HUNGARIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_HUNGARIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_HUNGARIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_HUNGARIAN,
/*Icelandic*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ICELANDIC,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ICELANDIC,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ICELANDIC, 
VM_INPUT_MODE_SMART_LOWERCASE_ICELANDIC, 
VM_INPUT_MODE_SMART_UPPERCASE_ICELANDIC, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ICELANDIC,
/*Igbo*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_IGBO,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_IGBO,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_IGBO, 
VM_INPUT_MODE_SMART_LOWERCASE_IGBO, 
VM_INPUT_MODE_SMART_UPPERCASE_IGBO, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_IGBO,
/*Indonesian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_INDONESIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_INDONESIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_INDONESIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_INDONESIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_INDONESIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_INDONESIAN,
/*Irish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_IRISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_IRISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_IRISH, 
VM_INPUT_MODE_SMART_LOWERCASE_IRISH, 
VM_INPUT_MODE_SMART_UPPERCASE_IRISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_IRISH,
/*Italian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ITALIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ITALIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ITALIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_ITALIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_ITALIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ITALIAN,
/*Kannada*/
VM_INPUT_MODE_MULTITAP_KANNADA,    
VM_INPUT_MODE_SMART_KANNADA,
/*Kazakh*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_KAZAKH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_KAZAKH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_KAZAKH, 
VM_INPUT_MODE_SMART_LOWERCASE_KAZAKH, 
VM_INPUT_MODE_SMART_UPPERCASE_KAZAKH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_KAZAKH,
VM_INPUT_MODE_MULTITAP_KOREAN,
/*Latvian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_LATVIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_LATVIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_LATVIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_LATVIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_LATVIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_LATVIAN,
/*Lithuanian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_LITHUANIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_LITHUANIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_LITHUANIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_LITHUANIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_LITHUANIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_LITHUANIAN,
/*Macedonian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_MACEDONIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_MACEDONIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_MACEDONIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_MACEDONIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_MACEDONIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_MACEDONIAN,
/*Malay*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_MALAY,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_MALAY,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_MALAY, 
VM_INPUT_MODE_SMART_LOWERCASE_MALAY, 
VM_INPUT_MODE_SMART_UPPERCASE_MALAY, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_MALAY,
/*Malayalam*/
VM_INPUT_MODE_MULTITAP_MALAYALAM,    
VM_INPUT_MODE_MULTITAP_LAO,
VM_INPUT_MODE_MULTITAP_KHMER,
VM_INPUT_MODE_SMART_KHMER,
VM_INPUT_MODE_MULTITAP_MYANMAR,
VM_INPUT_MODE_SMART_MALAYALAM,
/*Marathi*/
VM_INPUT_MODE_MULTITAP_MARATHI,    
VM_INPUT_MODE_SMART_MARATHI,
/*Moldovan*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_MOLDOVAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_MOLDOVAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_MOLDOVAN, 
VM_INPUT_MODE_SMART_LOWERCASE_MOLDOVAN, 
VM_INPUT_MODE_SMART_UPPERCASE_MOLDOVAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_MOLDOVAN,
/*Norwegian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_NORWEGIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_NORWEGIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_NORWEGIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_NORWEGIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_NORWEGIAN,
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_NORWEGIAN,
/*Oriya*/
VM_INPUT_MODE_MULTITAP_ORIYA,    
VM_INPUT_MODE_SMART_ORIYA,
/*Persian*/ 
VM_INPUT_MODE_MULTITAP_PERSIAN,    
VM_INPUT_MODE_SMART_PERSIAN,
/*Polish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_POLISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_POLISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_POLISH, 
VM_INPUT_MODE_SMART_LOWERCASE_POLISH, 
VM_INPUT_MODE_SMART_UPPERCASE_POLISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_POLISH,
/*Portuguese*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_PORTUGUESE,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_PORTUGUESE,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_PORTUGUESE, 
VM_INPUT_MODE_SMART_LOWERCASE_PORTUGUESE, 
VM_INPUT_MODE_SMART_UPPERCASE_PORTUGUESE, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_PORTUGUESE,
/*Punjabi*/
VM_INPUT_MODE_MULTITAP_PUNJABI,    
VM_INPUT_MODE_SMART_PUNJABI,
/*Romanian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ROMANIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ROMANIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ROMANIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_ROMANIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_ROMANIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ROMANIAN,
/*Russian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_RUSSIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_RUSSIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_RUSSIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_RUSSIAN,
/*Serbian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SERBIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SERBIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SERBIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_SERBIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_SERBIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SERBIAN,
/*Sesotho*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SESOTHO,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SESOTHO,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SESOTHO, 
VM_INPUT_MODE_SMART_LOWERCASE_SESOTHO, 
VM_INPUT_MODE_SMART_UPPERCASE_SESOTHO, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SESOTHO,
/*Slovak*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SLOVAK,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SLOVAK,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SLOVAK, 
VM_INPUT_MODE_SMART_LOWERCASE_SLOVAK, 
VM_INPUT_MODE_SMART_UPPERCASE_SLOVAK, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SLOVAK,
/*Slovenian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SLOVENIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SLOVENIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SLOVENIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_SLOVENIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_SLOVENIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SLOVENIAN,
/*Spanish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SPANISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SPANISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SPANISH, 
VM_INPUT_MODE_SMART_LOWERCASE_SPANISH, 
VM_INPUT_MODE_SMART_UPPERCASE_SPANISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SPANISH,
/*Swahili*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SWAHILI,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SWAHILI,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SWAHILI, 
VM_INPUT_MODE_SMART_LOWERCASE_SWAHILI, 
VM_INPUT_MODE_SMART_UPPERCASE_SWAHILI, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SWAHILI,
/*Swedish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_SWEDISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_SWEDISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_SWEDISH, 
VM_INPUT_MODE_SMART_LOWERCASE_SWEDISH, 
VM_INPUT_MODE_SMART_UPPERCASE_SWEDISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SWEDISH,
/*Tagalog*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_TAGALOG,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_TAGALOG,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_TAGALOG, 
VM_INPUT_MODE_SMART_LOWERCASE_TAGALOG, 
VM_INPUT_MODE_SMART_UPPERCASE_TAGALOG, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_TAGALOG,
/*Tamil*/
VM_INPUT_MODE_MULTITAP_TAMIL,    
VM_INPUT_MODE_SMART_TAMIL,
/*Telugu*/
VM_INPUT_MODE_MULTITAP_TELUGU,    
VM_INPUT_MODE_SMART_TELUGU,
/*Thai*/
VM_INPUT_MODE_MULTITAP_THAI,    
VM_INPUT_MODE_SMART_THAI,
/*Turkish*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_TURKISH,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_TURKISH,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_TURKISH, 
VM_INPUT_MODE_SMART_LOWERCASE_TURKISH, 
VM_INPUT_MODE_SMART_UPPERCASE_TURKISH, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_TURKISH,
/*Ukrainian*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_UKRAINIAN,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_UKRAINIAN,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_UKRAINIAN, 
VM_INPUT_MODE_SMART_LOWERCASE_UKRAINIAN, 
VM_INPUT_MODE_SMART_UPPERCASE_UKRAINIAN, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_UKRAINIAN,
/*Urdu*/
VM_INPUT_MODE_MULTITAP_URDU,    
VM_INPUT_MODE_SMART_URDU,
/*Vietnamese*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_VIETNAMESE, 
VM_INPUT_MODE_SMART_LOWERCASE_VIETNAMESE, 
VM_INPUT_MODE_SMART_UPPERCASE_VIETNAMESE, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_VIETNAMESE,
/*Xhosa*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_XHOSA,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_XHOSA,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_XHOSA, 
VM_INPUT_MODE_SMART_LOWERCASE_XHOSA, 
VM_INPUT_MODE_SMART_UPPERCASE_XHOSA, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_XHOSA,
/*Yoruba*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_YORUBA,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_YORUBA,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_YORUBA, 
VM_INPUT_MODE_SMART_LOWERCASE_YORUBA, 
VM_INPUT_MODE_SMART_UPPERCASE_YORUBA, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_YORUBA,
/*Zulu*/ 
VM_INPUT_MODE_MULTITAP_UPPERCASE_ZULU,    
VM_INPUT_MODE_MULTITAP_LOWERCASE_ZULU,
VM_INPUT_MODE_MULTITAP_FIRST_UPPERCASE_ZULU, 
VM_INPUT_MODE_SMART_LOWERCASE_ZULU, 
VM_INPUT_MODE_SMART_UPPERCASE_ZULU, 
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_ZULU,

/* Dialects */
VM_INPUT_MODE_SMART_UPPERCASE_UK_ABC,
VM_INPUT_MODE_SMART_LOWERCASE_UK_ABC,
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_UK_ABC,
VM_INPUT_MODE_SMART_UPPERCASE_CA_FRENCH,
VM_INPUT_MODE_SMART_LOWERCASE_CA_FRENCH,
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_CA_FRENCH,
VM_INPUT_MODE_SMART_UPPERCASE_HINGLISH,
VM_INPUT_MODE_SMART_LOWERCASE_HINGLISH,
VM_INPUT_MODE_SMART_UPPERCASE_SA_SPANISH,
VM_INPUT_MODE_SMART_LOWERCASE_SA_SPANISH,
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SA_SPANISH,
VM_INPUT_MODE_SMART_UPPERCASE_SA_PORTUGUESE,
VM_INPUT_MODE_SMART_LOWERCASE_SA_PORTUGUESE,
VM_INPUT_MODE_SMART_FIRST_UPPERCASE_SA_PORTUGUESE,

/* Chinese*/
VM_INPUT_MODE_TR_BOPOMO,
VM_INPUT_MODE_TR_MULTITAP_BOPOMO,
VM_INPUT_MODE_TR_STROKE,
VM_INPUT_MODE_QUICK_SEARCH_BOPOMO,
VM_INPUT_MODE_QUICK_SEARCH_HK_STROKE,    
VM_INPUT_MODE_QUICK_SEARCH_PINYIN,
VM_INPUT_MODE_QUICK_SEARCH_SM_STROKE,
VM_INPUT_MODE_QUICK_SEARCH_TR_STROKE,
VM_INPUT_MODE_SM_MULTITAP_PINYIN,
VM_INPUT_MODE_SM_PINYIN,
VM_INPUT_MODE_SM_STROKE,

VM_INPUT_MODE_MAX_NUM
} vm_input_mode_enum;

/*
 * file attribution
 */
#define VM_FS_ATTR_READ_ONLY        	0x01
#define VM_FS_ATTR_HIDDEN           	0x02
#define VM_FS_ATTR_SYSTEM           	0x04
#define VM_FS_ATTR_VOLUME          	0x08
#define VM_FS_ATTR_DIR              		0x10
#define VM_FS_ATTR_ARCHIVE          	0x20
#define VM_FS_LONGNAME_ATTR         	0x0F

/* file info */
struct vm_fileinfo_t
{
	VMWCHAR filename[MAX_APP_NAME_LEN]; /* full path of file */
	VMINT size; /* file size */
};

/* file info */
typedef  struct  vm_fileinfo_ext
{
    /* file name without path */
    VMWCHAR filefullname[MAX_APP_NAME_LEN];
    /* file name character array by 8.3 format encoding with UCS2, and the last character may be not '\0' */
    VMCHAR filename[8];
    /* file extention name character array by 8.3 format encoding with UCS2, and the last character may be not '\0' */
    VMCHAR extension[3];/* file attributes */
   VMBYTE           attributes; 
   vm_time_t       create_datetime; /* create time */
   vm_time_t	    modify_datetime; /* modify time */
   VMUINT           filesize; /* file size */
   VMUINT           drive; /* drive */
   VMUINT           stamp; /* stamp */
} vm_fileinfo_ext;

/* Disk information */
typedef struct
{
    /* A zero-terminated <color Red><b>Short File Name</b></color> with the volume's label. */
    VMCHAR            Label[24];

    /* The drive letter in <color Red><b>UPPER</b></color> case. */
    VMCHAR            DriveLetter;

    /* Indicate the disk is in write protection or not. 1 for protect, 0 for not protect. */
    VMUINT8            WriteProtect;

    /* Reserved fields */
    VMCHAR            Reserved[2];

    /* The volume's serial number. */
    VMUINT32            SerialNumber;

    /* The LBA address of the logical drive's boot record. For diskettes, this value will be 0. */
    VMUINT32            FirstPhysicalSector;

    /* 2, 16, or 32 for FAT-12, FAT-16, or FAT-32 */
    VMUINT32            FATType;

    /* The number of FATs on the volume. */
    VMUINT32            FATCount;

    /* The number of FATs on the volume. */
    VMUINT32            MaxDirEntries;

    /* The sector size. This value will usually be 512. */
    VMUINT32            BytesPerSector;

    /* Specifies the size of the smallest unit of storage that can be allocated to a file in sectors. */
    VMUINT32            SectorsPerCluster;

    /* Number of clusters for file storage on the volume. */
    VMUINT32            TotalClusters;

    /* The number of clusters, which are marked bad and are unavailable for file storage. */
    VMUINT32            BadClusters;

    /* The number of clusters currently available. */
    VMUINT32            FreeClusters;

    /* The number of files on the volume including directories, but not counting the root directory and files with an allocated file size of 0. */
    VMUINT32            Files;

    /* The number of contiguous cluster chains. On a completely unfragmented volume, this value would be identical to Files. */
    VMUINT32            FileChains;

    /* The number of contiguous cluster chains of free clusters. On a completely unfragmented volume, this value would be 1. */
    VMUINT32            FreeChains;

    /* The maximum allocated file size for a newly allocated contiguous file in clusters. On a completely unfragmented volume, this value would be identical to FreeClusters. */
    VMUINT32            LargestFreeChain;
} vm_fs_disk_info;

/* vm_get_disk_info Parameter */
typedef enum
{
    /*
     * Returns all fields in structure vm_get_disk_info except FreeClusters, BadClusters, Files, FileChains, FreeChains, LargestFreeChain.
     * <color Red><b>This flag never requires a FAT scan.</b></color>
     */
    VM_FS_DI_BASIC_INFO     =  0x00000001L,

    /*
     * Returns field FreeClusters. This flags may require FS to scan the complete FAT if the amount of free space is not known.
     * In this case, FS_DI_FAT_STATISTICS is returned in addition to FS_DI_FREE_SPACE.
     */
    VM_FS_DI_FREE_SPACE     =  0x00000002L,

    /*
     * Returns fields BadClusters, Files, FileChains, FreeChains, LargestFreeChain.
     * This flag will always cause FS to scan the complete FAT.
     */
    VM_FS_DI_FAT_STATISTICS =  0x00000004L,

    /*
     * Get volume label of the target drive. The maximum length is 11 wide characters.
     * <color Red><b>This option must be used with FS_DI_BASIC_INFO.</b></color>
     */
    VM_FS_DI_VOLUME_LABEL   =  0x00000008L,

    VM_FS_DI_INVALID
}vm_fs_di_enum;


/*****************************************************************************
 * <GROUP  CallbackFunctions>
 *
 * FUNCTION
 *  vm_key_handler_t
 * DESCRIPTION
 *  Callback function type for key event handler.
 * PARAMETERS
 *  event : [IN] Key event.
 *  keycode : [IN] Key code.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*vm_key_handler_t)(VMINT event, VMINT keycode);

/*****************************************************************************
 * <GROUP  CallbackFunctions>
 *
 * FUNCTION
 *  vm_key_handler_ex_t
 * DESCRIPTION
 *  Callback function type for key event handler.
 * PARAMETERS
 *  event : [IN] Key event.
 *  keycode : [IN] Key code.
 * RETURNS
 *  void
 *****************************************************************************/
typedef VMINT (*vm_key_handler_ex_t)(VMINT event, VMINT keycode);

/*****************************************************************************
 * FUNCTION
 *  vm_reg_keyboard_callback
 * DESCRIPTION
 *  Registers key handler.
 * PARAMETERS
 *  vm_key_handler_t : [IN] Key event handler.
 * RETURNS
 *  void
 *****************************************************************************/
void vm_reg_keyboard_callback(vm_key_handler_t handler);

/*****************************************************************************
 * FUNCTION
 *  vm_reg_keyboard_callback
 * DESCRIPTION
 *  Registers key extension handler. app will take the key event
 *  and not give it back to platform if return value from callback is non-zero,
 *  else not.
 * PARAMETERS
 *  vm_key_handler_ex_t : [IN] Key extension event handler.
 * RETURNS
 *  void
 *****************************************************************************/
VMINT vm_reg_keyboard_callback_ex(vm_key_handler_ex_t handler);

/* Pen events supported by MRE. */

/* Pen down event */
#define VM_PEN_EVENT_TAP				1
/* Pen release event */
#define VM_PEN_EVENT_RELEASE			2
/* Pen move event */
#define VM_PEN_EVENT_MOVE				3
 /* Pen long tap event. 
    Note:
    1. LongTap handler is invoked when  the pen is tapped for a period of time
        and stays at the same place where it is tapped down. 
    2. If pen move happen after pen down, there will be no pen LongTap event.
    3. Pen long tap can only happen one time at most.*/
#define VM_PEN_EVENT_LONG_TAP			4
/* Pen double click event */
#define VM_PEN_EVENT_DOUBLE_CLICK		5
/* Pen repeat event. 
    Note:
    1. Repeat can happen after LongTap or move or another repeat.
    2. Repeat event's coordinate will follow the previous events.*/
#define VM_PEN_EVENT_REPEAT			6
/* Pen abort event */
#define VM_PEN_EVENT_ABORT          7

/*****************************************************************************
 * <GROUP  CallbackFunctions>
 *
 * FUNCTION
 *  vm_pen_handler_t
 * DESCRIPTION
 *  
 * PARAMETERS
 *  event : [IN] Key event.
 *  x : [IN] x coordinate.
 *  y : [IN] y coordinate.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*vm_pen_handler_t)(VMINT event, VMINT x, VMINT y);

/*****************************************************************************
 * FUNCTION
 *  vm_reg_pen_callback
 * DESCRIPTION
 *  Registers pen event handler.
 * PARAMETERS
 *  handler : [IN] Pen event handler.
 * RETURNS
 *  void
 *****************************************************************************/
void vm_reg_pen_callback(vm_pen_handler_t handler);

/**
 * open file with file Read-Only mode.
 */
#define MODE_READ					1

/**
 * open file with Read-Write mode.
 */
#define MODE_WRITE					2

/**
 * open file with Read-Write mode, create if the file not exist.
 */
#define MODE_CREATE_ALWAYS_WRITE	4

/**
 * open file with Append mode.
 */
#define MODE_APPEND					8

/*****************************************************************************
* FUNCTION
 *    vm_file_open
 * DESCRIPTION
 *  open file 
 * PARAMETERS
 *  filename : [IN]  file full path encoding with UCS2
 *  mode : [IN] file open mode:
 *                MODE_READ: Read-Only
 *                MODE_WRITE : Read-Write
 *                MODE_CREATE_ALWAYS_WRITE : Read-Write mode, create if the file not exist.
 *  binary : [IN] TRUE means open with binary format, FALSE means open with ASCII format.
 * RETURNS
 *  non-negative file handle if successfully, and error code if failed to open. 
 *
*****************************************************************************/
VMFILE vm_file_open(const VMWSTR filename, VMUINT mode, VMUINT binary);

/*****************************************************************************
* FUNCTION
 *    vm_file_close
 * DESCRIPTION
 *  close file 
 * PARAMETERS
 *  handle : [IN]  file handle to be closed.
 *
*****************************************************************************/
void vm_file_close(VMFILE handle);

/*****************************************************************************
* FUNCTION
 *    vm_file_read
 * DESCRIPTION
 *  read file from current pointer of file
 * PARAMETERS
 *  handle : [IN]  file handle to be read.
 *  data : [OUT] output data address
 *  length : [IN] bytes to be read
 *  nread : [IN] bytes read actually
 * RETURNS
 *  bytes of read data if > 0, 0 means error happened or reach end of file.
 *
*****************************************************************************/
VMINT vm_file_read(VMFILE handle, void * data, VMUINT length, VMUINT *nread);

/*****************************************************************************
* FUNCTION
 *    vm_file_write
 * DESCRIPTION
 *  write data to current pointer of the file
 * PARAMETERS
 *  handle : [IN]  file handle to write.
 *  data : [IN] the address of data to be written
 *  length : [IN] bytes to be written
 *  written : [IN] bytes written actually
 * RETURNS
 *  bytes of written data if > 0, 0 means error happened.
 *
*****************************************************************************/
VMINT vm_file_write(VMFILE handle, void * data, VMUINT length, VMUINT * written);

/*****************************************************************************
* FUNCTION
 *    vm_file_commit
 * DESCRIPTION
 *  commit the I/O cache data to file.
 * PARAMETERS
 *  handle : [IN]  file handle to commit.
 * RETURNS
 *  0 means successfully, non-zero is error code.
 *
*****************************************************************************/
VMINT vm_file_commit(VMFILE handle);

#define BASE_BEGIN		1
#define BASE_CURR		2
#define BASE_END		3

/*****************************************************************************
* FUNCTION
 *    vm_file_seek
 * DESCRIPTION
 *  move the file pointer to specified position. If exceed file size, this operation will return error.
 * PARAMETERS
 *  handle : [IN]  file handle to seek.
 *  offset : [IN]  bytes to move.
 *  base: [IN]  base position to move.
 *          BASE_BEGIN means from begin of file;
 *          BASE_CURR means from current position; 
 *          BASE_END means from end of file.
 * RETURNS
 *  0 means successfully, non-zero is error code.
 * 
*****************************************************************************/
VMINT vm_file_seek(VMFILE handle, VMINT offset, VMINT base);

/*****************************************************************************
* FUNCTION
 *    vm_file_tell
 * DESCRIPTION
 *  get the position of current pointer of file.
 * PARAMETERS
 *  handle : [IN]  file handle.
 * RETURNS
 *  current pointer position,  or negative number error code if failed.
 *
*****************************************************************************/
VMINT vm_file_tell(VMFILE handle);

/*****************************************************************************
* FUNCTION
 *    vm_file_is_eof
 * DESCRIPTION
 *  check if the current pointer is end of file or not.
 * PARAMETERS
 *  handle : [IN]  file handle.
 * RETURNS
 *  current pointer is end of file or not.
 * RETURN VALUES                                      
 *  TRUE : current pointer is end of file.
 *  FALSE : current pointer is not end of file.
 *
*****************************************************************************/
VMINT vm_file_is_eof(VMFILE handle);

/*****************************************************************************
* FUNCTION
 *    vm_file_getfilesize
 * DESCRIPTION
 *  get file size by byte.
 * PARAMETERS
 *  handle : [IN]  file handle.
 *  file_size : [OUT] output the file size by byte
 * RETURNS
 *  get file size successfully or failed
 * RETURN VALUES                                      
 *  0 : get file size successfully.
 *  non-zero : failed to get file size
 * 
*****************************************************************************/
VMINT vm_file_getfilesize(VMFILE handle, VMUINT *file_size);

/*****************************************************************************
* FUNCTION
 *    vm_file_delete
 * DESCRIPTION
 *  delete specified file.
 * PARAMETERS
 *  filename : [IN]  file name full path  encoding with UCS2 format.
 * RETURNS
 *  delete file successfully or failed
 * RETURN VALUES                                      
 *  0 : delete file successfully.
 *  non-zero : failed to delete file.
 * 
*****************************************************************************/
VMINT vm_file_delete(const VMWSTR filename);

/*****************************************************************************
* FUNCTION
 *    vm_file_rename
 * DESCRIPTION
 *  delete specified file.
 * PARAMETERS
 *  filename : [IN]  old file name full path encoding with UCS2 format.
 *  newname : [IN]  new file name full path encoding with UCS2 format.
 * RETURNS
 *  rename file successfully or failed
 * RETURN VALUES                                      
 *  0 : rename file successfully.
 *  non-zero : failed to rename file.
 * 
*****************************************************************************/
VMINT vm_file_rename(const VMWSTR filename, const VMWSTR newname);

/*****************************************************************************
* FUNCTION
 *    vm_file_mkdir
 * DESCRIPTION
 *  create new directory with specified path name.
 * PARAMETERS
 *  dirname : [IN]  path name encoding with UCS2 format.
 * RETURNS
 *  create directory successfully or failed
 * RETURN VALUES                                      
 *  0 : create directory successfully.
 *  non-zero : failed to create directory.
 *
*****************************************************************************/
VMINT vm_file_mkdir(const VMWSTR dirname);

/*****************************************************************************
* FUNCTION
 *    vm_file_rmdir
 * DESCRIPTION
 *  remove directory with specified path name.
 * PARAMETERS
 *  dirname : [IN]  path name encoding with UCS2 format.
 * RETURNS
 *  remove directory successfully or failed
 * RETURN VALUES                                      
 *  0 : remove directory successfully.
 *  non-zero : failed to remove directory.
 *
*****************************************************************************/
VMINT vm_file_rmdir(const VMWSTR dirname);

/*****************************************************************************
* FUNCTION
 *    vm_file_set_attributes
 * DESCRIPTION
 *  set attributes of specified full path file name encoding with UCS2 format. The attributes
 *  can not include VM_FS_ATTR_VOLUME, VM_FS_ATTR_DIR, or VM_FS_LONGNAME_ATTR.
 *  The value of attributes is the result of OR operator.
 * PARAMETERS
 *  filename : [IN]  file name encoding with UCS2 format.
 *  attributes : [IN]  file attributes.
 * RETURNS
 *  set attributes successfully or failed
 * RETURN VALUES                                      
 *  0 : set attributes successfully.
 *  non-zero : failed to set attributes.
 *
*****************************************************************************/
VMINT vm_file_set_attributes(const VMWSTR filename, VMBYTE attributes);

/*****************************************************************************
* FUNCTION
 *    vm_file_get_attributes
 * DESCRIPTION
 *  set attributes of specified full path file name encoding with UCS2 format. 
 *  The value of attributes is the result of OR operator.
 * PARAMETERS
 *  filename : [IN]  file name encoding with UCS2 format.
 * RETURNS
 *  get attributes successfully or failed
 * RETURN VALUES                                      
 *  -1 : failed to get attributes.
 *  else : get the attributes value.
 *
*****************************************************************************/
VMINT vm_file_get_attributes(const VMWSTR filename);

/*****************************************************************************
* FUNCTION
 *    vm_find_first
 * DESCRIPTION
 *  find files from specified path, support wild character finding.
 * PARAMETERS
 *  pathname : [IN]  path name encoding with UCS2 format.
 *  info : [OUT] result of finding
 * RETURNS
 *  find handle or error code
 * RETURN VALUES                                      
 *  non-negative number : find handle.
 *  negative number : error code.
 *
*****************************************************************************/
VMINT vm_find_first(VMWSTR pathname, struct vm_fileinfo_t* info);

/*****************************************************************************
* FUNCTION
 *    vm_find_next
 * DESCRIPTION
 *  continue to find next file.
 * PARAMETERS
 *  handle : [IN]  find handle.
 *  info : [OUT] result of finding
 * RETURNS
 *  find handle or error code
 * RETURN VALUES                                      
 *  0 : find next file successfully.
 *  negative number : end of finding.
 *
*****************************************************************************/
VMINT vm_find_next(VMINT handle, struct vm_fileinfo_t* info);

/*****************************************************************************
* FUNCTION
 *    vm_find_close
 * DESCRIPTION
 *  close finding process.
 * PARAMETERS
 *  handle : [IN]  find handle.
 *
*****************************************************************************/
void vm_find_close(VMINT handle);

#define vm_get_removable_driver vm_get_removeable_driver
/*****************************************************************************
* FUNCTION
 *    vm_get_removable_driver
 * DESCRIPTION
 *  get drive letter of removable disk, which normally is memory card.
 * RETURNS
 *  drive letter of removable disk. negative number means no removable drive.
 *
*****************************************************************************/
VMINT vm_get_removable_driver(void);

/*****************************************************************************
* FUNCTION
 *    vm_get_system_driver
 * DESCRIPTION
 *  get drive letter of phone disk, which normally is public drive.
 * RETURNS
 *  drive letter of phone disk. negative number means no public drive.
 *
*****************************************************************************/
VMINT vm_get_system_driver(void);

/*****************************************************************************
* FUNCTION
 *    vm_get_disk_free_space
 * DESCRIPTION
 *  get free space by byte of specified drive.
 * PARAMETERS
 *  drv_name : [IN]  drive letter string terminated with '\0' .
 * RETURNS
 *  free space by byte. 0 means specified disk does not exist.
 * 0xFFFFFFFF means exceed the max limitation, the free space size lager than this value.
 * another choice to use vm_get_disk_info
 * 
* EXAMPLE                                  [this TAG is optional]
 * <code>
 * VMINT sys_driver = -1;
 * VMUINT sys_driver_size = 0;
 * if ((sys_driver = vm_get_system_driver()) >= 0)
 * {
 *     VMCHAR driver_str[2] = {0};
 *     
 *     sprintf(driver_str, "%c", (VMCHAR)sys_driver);
 *     sys_driver_size = vm_get_disk_free_space(vm_ucs2_string(driver_str));
 * }
 * </code>
*****************************************************************************/
VMUINT vm_get_disk_free_space(VMWSTR drv_name);

/*****************************************************************************
 * FUNCTION
 *  vm_get_disk_info
 * DESCRIPTION
 *  Return information about a logical drive
 * PARAMETERS
 *  DriveName   :   [IN] <P>Must be a valid file name, e.g., a root directory name. 
 * Only the drive information (possibly the current default drive) is determined.
 *  DiskInfo    :   [OUT]<P>Refer to vm_fs_disk_info.
 *  Flags       :   [IN] <P>Refer to vm_fs_di_enum.
 * RETURNS
 *  success if >= 0, else failure.
 *****************************************************************************/
VMINT vm_get_disk_info(const VMCHAR * drv_name, vm_fs_disk_info * fs_disk, vm_fs_di_enum e_di);

/* If selects OK or Cancel in editor screen, the state will pass to application via callback's parameter. */

#define VM_INPUT_OK             (1)     /* If selects OK */
#define VM_INPUT_CANCEL     (0) /* If selects Cancel */
#define VM_INPUT_NOTIFY     (2) /* If another screen makes editor exit, this message will be sent */
#define VM_INPUT_CLOSE      (3) /* If application close the input screen self, application will receive this message */
 /*****************************************************************************
 * FUNCTION
 *  vm_input_text
 * DESCRIPTION
 *  Display a editor screen. The default input method is VM_INPUT_METHOD_TEXT.
 *  The max length of input string is 250.
 * PARAMETERS
 *  f : [IN] This callback will be invoked when the editor screen closed. If user selects OK, the state will be VM_INPUT_OK.
 *  If user select Cancel, the state will be VM_INPUT_CANCEL.
 * RETURNS
 *  The error code of the operation.
 * RETURN VALUES
 *  0 : If open the input screen successfully.
 *  <0 : If failed.
 *****************************************************************************/
VMINT vm_input_text(void (*f)(VMINT state, VMWSTR text));

#define VM_INPUT_METHOD_TEXT     1      /* Input text and the default input method is PINYIN */
#define VM_INPUT_METHOD_PASSWORD 2      /* Input password and the default input method is multitap abc.
                                           only 0~9, *, # are allowed and the content would be displayed as * in editor. */
#define VM_INPUT_METHOD_NUMERIC         4       /* Input number and the default input method is phone number */
#define VM_INPUT_METHOD_ALPHABETIC    8 /* Input English and the default input method is multitap abc */
#define VM_INPUT_METHOD_URL         16 /* Input URL */

 /*****************************************************************************
 * FUNCTION
 *  vm_input_text2
 * DESCRIPTION
 *  Display a editor screen. User can set default string and default input method.
 *  The max length of input string is 250.
 * PARAMETERS
 *  def_str : [IN] Default string in editor screen.
 *  def_input_method: [IN] Default input method.
 *  f : [IN] This callback will be invoked when the editor screen closed. If user selects OK, the state will be VM_INPUT_OK.
 *  If user select Cancel, the state will be VM_INPUT_CANCEL.
 * RETURNS
 *  The error code of the operation.
 * RETURN VALUES
 *  0 : If open the input screen successfully.
 *  <0 : If failed.
 *****************************************************************************/
VMINT vm_input_text2(VMWSTR def_str, VMINT def_input_method, void (*f) (VMINT state, VMWSTR text));

 /*****************************************************************************
 * FUNCTION
 *  vm_input_text3
 * DESCRIPTION
 *  Display a editor screen. User can set default string and default input method.
 *  User can also set the max input length (in short) via parameter input_max_size.
 * PARAMETERS
 *  default_string : [IN] Default string in editor screen.
 *  input_max_size : [IN] 
 *  default_input_method: [IN] Default input method.
 *  input_text_cb : [IN] This callback will be invoked when the editor screen closed. If user selects OK, the state will be VM_INPUT_OK.
 *  If user select Cancel, the state will be VM_INPUT_CANCEL.
 * RETURNS
 *  The error code of the operation.
 * RETURN VALUES
 *  0 : If open the input screen successfully.
 *  <0 : If failed.
 *****************************************************************************/
VMINT vm_input_text3(VMWSTR default_string, VMINT input_max_size, 
	VMINT default_input_method, void (*input_text_cb)(VMINT state, VMWSTR text));

 /*****************************************************************************
 * FUNCTION
 *  vm_set_app_desired_input_mode
 * DESCRIPTION
 *  To set editor desired input mode. Used when App call vm_input_text/vm_input_text2/vm_input_text3 to enter editor screen.
 * PARAMETERS
 *  desired_input_mode : [IN] input mode.
 * RETURN VALUES
 *  void
 *****************************************************************************/
void vm_set_app_desired_input_mode(vm_input_mode_enum desired_input_mode);

/*****************************************************************************
 * FUNCTION
 *  vm_input_close_screen
 * DESCRIPTION
 *  Close input screen by application self. And it will send VM_INPUT_CLOSE to application.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  void
 *****************************************************************************/
void vm_input_close_screen(void);
 
/*****************************************************************************
 * FUNCTION
 *  vm_input_move_cursor_to_start
 * DESCRIPTION
 *  Move the cursor to the start position and edit from the beginning.
 *  You need to call this API after vm_input_text/vm_input_text2/vm_input_text3.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  void
 *****************************************************************************/
void vm_input_move_cursor_to_start(void);

/*****************************************************************************
 * FUNCTION
 *  vm_input_set_vk_default_enlarge
 * DESCRIPTION
 *  Set VK default enlarge.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  void
 *****************************************************************************/
void vm_input_set_vk_default_enlarge(void);

/******************************************************************************
 * FUNCTION
 *	vm_input_set_editor_title
 * DESCRIPTION
 *	set the input editor title. This function should be called just before
 *	vm_input_text, vm_input_text2 or vm_input_text3, and the title's length must
 *	be less than 60.
 * PARAMETERS
 *	title	:	[IN]	editor title provided by user
 * RETURN VALUES
 *	TRUE	:	if set the editor title successfully.
 *	FALSE	:	if fail to set the editor title.
 *****************************************************************************/
VMINT vm_input_set_editor_title(VMWSTR title);

 /*****************************************************************************
 * FUNCTION
 *  vm_is_support_keyborad
 * DESCRIPTION
 *  Check whether the phone support keypad or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  TRUE : Supports keypad.
 *  FALSE : Not support.
 *****************************************************************************/
VMINT vm_is_support_keyborad(void);

 /*****************************************************************************
 * FUNCTION
 *  vm_is_support_pen_touch
 * DESCRIPTION
 *  Check whether the phone support touch panel or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  TRUE : Supports touch panel.
 *  FALSE : Not support.
 *****************************************************************************/
VMINT vm_is_support_pen_touch(void);

/*****************************************************************************
 * FUNCTION
 *  vm_is_finger_touch_version
 * DESCRIPTION
 *  Check whether the phone support finger touch feature or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  TRUE : Supports finger touch feature.
 *  FALSE : Not support.
 *****************************************************************************/
VMINT vm_is_finger_touch_version(void);

/*****************************************************************************
 * FUNCTION
 *  vm_is_support_gsensor
 * DESCRIPTION
 *  Check whether the phone support G-sensor or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  TRUE : Supports G-sensor.
 *  FALSE : Not support.
 *****************************************************************************/
VMINT vm_is_support_gsensor(void);

/*****************************************************************************
 * FUNCTION
 *  vm_is_support_camera_sensor
 * DESCRIPTION
 *  Check whether the phone support camera sensor or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  TRUE : Supports camera sensor.
 *  FALSE : Not support.
 *****************************************************************************/
VMINT vm_is_support_camera_sensor(void);

/*****************************************************************************
* FUNCTION
 *    vm_file_get_modify_time
 * DESCRIPTION
 *  get the latest modified time of specified file.
 * PARAMETERS
 *  filename : [IN]  file name of full path encoding with UCS2 format.
 *  modify_time : [OUT]  output the latest modified time
 * RETURNS
 *  0 means get modified time successfully, -1 means failed.
 *
*****************************************************************************/
VMINT vm_file_get_modify_time(const VMWSTR filename, vm_time_t * modify_time);

/*****************************************************************************
* FUNCTION
 *    vm_find_first_ext
 * DESCRIPTION
 *  find files from specified path, support wild character finding.
 * PARAMETERS
 *  pathname : [IN]  path name encoding with UCS2 format.
 *  direntry : [OUT] result of finding
 * RETURNS
 *  find handle or error code
 * RETURN VALUES                                      
 *  non-negative number : find handle.
 *  negative number : error code.
 *
*****************************************************************************/
VMINT vm_find_first_ext(VMWSTR pathname, vm_fileinfo_ext * direntry);

/*****************************************************************************
* FUNCTION
 *    vm_find_next_ext
 * DESCRIPTION
 *  continue to find next file.
 * PARAMETERS
 *  handle : [IN]  find handle.
 *  direntry : [OUT] result of finding
 * RETURNS
 *  find handle or error code
 * RETURN VALUES                                      
 *  0 : find next file successfully.
 *  negative number : end of finding.
 *
*****************************************************************************/
VMINT vm_find_next_ext(VMINT handle,  vm_fileinfo_ext * direntry);

/*****************************************************************************
* FUNCTION
 *    vm_find_close_ext
 * DESCRIPTION
 *  close finding process.
 * PARAMETERS
 *  handle : [IN]  find handle.
 *
*****************************************************************************/
void vm_find_close_ext(VMINT handle);

typedef struct
{
    VMUINT8 home_city;
    VMUINT8 foreign_city;
    VMUINT8 date_seperator;
    VMUINT8 date_format;
    VMUINT8 time_format;
    VMINT current_dst;

    VMUINT8 current_city;
    float current_timezone;
    
    VMUINT8 foreign_index;
    VMUINT8 wc_dst;
    VMUINT8 setting_dt_dst;
    VMUINT16 timezone;
    VMUINT16 frn_timezone;

    VMUINT8     wc_entry_screen;    /* wc_entry_screen, 0:worldclock, 1:homecity, 2:foreigncity */
    VMUINT8     tz_city_match;      /* tz_city_match, 0:Not Match, 1:Match */
} vm_phoneset_info_struct;




/* error code of storage */
typedef enum
{
    VM_STORAGE_ERR_RES = -10, /* resource is not enough */
    VM_STORAGE_ERR_PARAM = -9, /* input param error */
    VM_STORAGE_ERR_FILE_CREATE = -8, /* sto create failure */
    VM_STORAGE_ERR_FILE_OPEN = -7, /* sto open failure */
    VM_STORAGE_ERR_FILE_SEEK = -6, /* sto seek failure */
    VM_STORAGE_ERR_FILE_WRITE = -5, /* sto wirte failure */
    VM_STORAGE_ERR_FILE_READ = -4, /* sto read failure */
    VM_STORAGE_ERR_AUTHORIZATION = -3, /* no authorization */
    VM_STORAGE_ERR_NONE = 0 /* no error */
}vm_storage_error_type;

/*****************************************************************************
 * FUNCTION
 *  vm_storage_open
 * DESCRIPTION
 *  open storage.
 * PARAMETERS
 *  void
 * RETURNS
 *  storage handle or error code
 * RETURN VALUES
 *  vm_storage_error_type
*****************************************************************************/
VMINT vm_storage_open(void);

/*****************************************************************************
 * FUNCTION
 *  vm_storage_close
 * DESCRIPTION
 *  close storage.
 * PARAMETERS
 *  h : [IN] handle of storage
*****************************************************************************/
void vm_storage_close(VMINT h);

/*****************************************************************************
 * FUNCTION
 *  vm_storage_read
 * DESCRIPTION
 *  read data from storage.
 * PARAMETERS
 *  h : [IN] handle of storage
 * data : [OUT] buffer will be filled
 * offset : [IN] offset from head of storage
 * size : [IN] buffer size
 * read : [OUT] read size
 * RETURNS
 *  0 or error code
 * RETURN VALUES
 *  vm_storage_error_type
*****************************************************************************/
VMINT vm_storage_read(VMINT h, void * data, VMUINT offset, VMUINT size, VMUINT * read);

/*****************************************************************************
 * FUNCTION
 *  vm_storage_write
 * DESCRIPTION
 *  write data to storage
 * PARAMETERS
 *  h : [IN] handle of storage
 * data : [IN] buffer will be written to storage
 * offset : [IN] offset from head of storage
 * size : [IN] buffer size
 * written : [OUT] written size
 * RETURNS
 *  0 or error code
 * RETURN VALUES
 *  vm_storage_error_type
*****************************************************************************/
VMINT vm_storage_write(VMINT h, const void * data, VMUINT offset, VMUINT size, VMUINT * written);
/* DOM-NOT_FOR_SDK-BEGIN */

/* error code of storage */
typedef enum
{
    VM_SYS_FILE_ERR_DISK_FULL = -12, 
    VM_SYS_FILE_ERR_RES , /* resource is not enough */
    VM_SYS_FILE_ERR_PARAM, /* input param error */
    VM_SYS_FILE_ERR_FILE_CREATE, /* create failure */
    VM_SYS_FILE_ERR_FILE_OPEN, /* open failure */
    VM_SYS_FILE_ERR_FILE_DELETE,
    VM_SYS_FILE_ERR_FILE_SEEK, /* seek failure */
    VM_SYS_FILE_ERR_FILE_WRITE, /* wirte failure */
    VM_SYS_FILE_ERR_FILE_WRITE_PARTLY, 
    VM_SYS_FILE_ERR_FILE_READ, /* read failure */
    VM_SYS_FILE_ERR_AUTHORIZATION, /* no authorization */
    VM_SYS_FILE_ERR_NONE = 0 /* no error */
}vm_sys_file_error_type;


/*****************************************************************************
* FUNCTION
 *    vm_sys_file_open
 * DESCRIPTION
 *  open file in system drive disk
 * PARAMETERS
 *  mode : [IN] file open mode:
 *                MODE_READ: Read-Only
 *                MODE_WRITE : Read-Write
 *                MODE_CREATE_ALWAYS_WRITE : Read-Write mode, create if the file not exist.
 *  binary : [IN] TRUE means open with binary format, FALSE means open with ASCII format.
 * RETURNS
 *  non-negative file handle if successfully, and error code if failed to open. 
 *
*****************************************************************************/
VMFILE vm_sys_file_open(VMUINT mode, VMUINT binary);

/*****************************************************************************
* FUNCTION
 *    vm_sys_file_seek
 * DESCRIPTION
 *  move the sys file pointer to specified position. If exceed file size, this operation will return error.
 * PARAMETERS
 *  handle : [IN]  sys file handle to seek.
 *  offset : [IN]  bytes to move.
 *  base: [IN]  base position to move.
 *          BASE_BEGIN means from begin of file;
 *          BASE_CURR means from current position; 
 *          BASE_END means from end of file.
 * RETURNS
 *  0 means successfully, non-zero is error code.
 * 
*****************************************************************************/
VMINT vm_sys_file_seek(VMFILE handle, VMINT offset, VMINT base);


/*****************************************************************************
* FUNCTION
 *    vm_sys_file_read
 * DESCRIPTION
 *  read file from current pointer of sys file
 * PARAMETERS
 *  handle : [IN]  file handle to be read.
 *  data : [OUT] output data address
 *  length : [IN] bytes to be read
 *  nread : [IN] bytes read actually
 * RETURNS
 *  bytes of read data if > 0, 0 means error happened or reach end of file.
 *
*****************************************************************************/
VMINT vm_sys_file_read(VMFILE handle, void * data, VMUINT length, VMUINT *nread);

/*****************************************************************************
* FUNCTION
 *    vm_sys_file_write
 * DESCRIPTION
 *  write data to current pointer of the sys file
 * PARAMETERS
 *  handle : [IN]  file handle to write.
 *  data : [IN] the address of data to be written
 *  length : [IN] bytes to be written
 *  written : [IN] bytes written actually
 * RETURNS
 *  bytes of written data if > 0, 0 means error happened.
 *
*****************************************************************************/
VMINT vm_sys_file_write(VMFILE handle, void * data, VMUINT length, VMUINT * written);


/*****************************************************************************
* FUNCTION
 *    vm_sys_file_close
 * DESCRIPTION
 *  close sys file 
 * PARAMETERS
 *  handle : [IN]  sys file handle to be closed.
 *
*****************************************************************************/
void vm_sys_file_close(VMFILE h);

/*****************************************************************************
* FUNCTION
 *    vm_sys_file_delete
 * DESCRIPTION
 *  delete sys file.
 * RETURNS
 *  delete sys file successfully or failed
 * RETURN VALUES                                      
 *  0 : delete file successfully.
 *  non-zero : failed to delete sys file.
 * 
*****************************************************************************/
VMINT vm_sys_file_delete(void);

/*****************************************************************************
* FUNCTION
 *    vm_sys_file_get_space
 * DESCRIPTION
 *  get the current free size of sys file 
 * PARAMETERS
 * RETURNS
 *  rest space size. 
 *
*****************************************************************************/
VMINT vm_sys_file_get_space(void);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
* FUNCTION
 *    vm_get_default_store_path_by_type
 * DESCRIPTION
 *  get default store path of  different types
 * PARAMETERS
 * RETURNS
 *  path string. 
 *
*****************************************************************************/

VMUWSTR vm_get_default_store_path_by_type(VMINT disk_letter, VM_STORE_PATH_TYPE type);


typedef enum
{
    VM_SELECTOR_ERR_NO_RES = -7, /* no avalible resource */
    VM_SELECTOR_ERR_PARAM, /* input invalid parameter */
    VM_SELECTOR_ERR_NO_MEMORY, /* no memmory */
    VM_SELECTOR_ERR_NO_DISK, /* driver path failure */
    VM_SELECTOR_ERR_EXCEPTION, /* exception */
    VM_SELECTOR_ERR_NOT_SUPPORT, /* platform dose not support */
    VM_SELECTOR_ERR_NOT_AUTHORIZED, /* no authrization */
    VM_SELECTOR_ERR_SUCCESS = 0 /* success */
}vm_selector_error_t;

typedef enum
{ 
    VM_SELECTOR_TYPE_ALL = 0, /* all file type */
    VM_SELECTOR_TYPE_IMAGE, /* image type */
    VM_SELECTOR_TYPE_TXT /* txt type */
}vm_selector_type_t;

/*****************************************************************************
 * FUNCTION
 *  vm_selector_run
 * DESCRIPTION
 *  Start Fmgr to select a file.
 * PARAMETERS
 * type : [IN] the browse type of file, define in vm_selector_type_t
 * folder_path : [IN] witch path need to be browsed, NULL means root 
 * callback : [IN] the result callback of file selection. file_path is the path name of current selected file, 
 * it be set NULL if error. wlen is the length of path name in words.
 * RETURNS
 *  0 or error code define in vm_selector_error_t
 * RETURN VALUES
 *  vm_selector_error_t
*****************************************************************************/
VMINT vm_selector_run(VMINT type, const VMWCHAR * folder_path, VMINT (*callback)(VMWCHAR * file_path, VMINT wlen));

typedef enum
{
    VM_FOLDER_BROWSER_ERR_NO_RES = -7, /* no avalible resource */
    VM_FOLDER_BROWSER_ERR_PARAM, /* input invalid parameter */
    VM_FOLDER_BROWSER_ERR_NO_MEMORY, /* no memmory */
    VM_FOLDER_BROWSER_ERR_NO_DISK, /* driver path failure */
    VM_FOLDER_BROWSER_ERR_EXCEPTION, /* exception */
    VM_FOLDER_BROWSER_ERR_NOT_SUPPORT, /* platform dose not support */
    VM_FOLDER_BROWSER_ERR_NOT_AUTHORIZED, /* no authrization */
    VM_FOLDER_BROWSER_ERR_SUCCESS = 0 /* success */
} vm_folder_browser_error_t;

typedef enum
{ 
    VM_FOLDER_BROWSER_TYPE_ALL = 0, /* all file type */
    VM_FOLDER_BROWSER_TYPE_IMAGE, /* image type */
    VM_FOLDER_BROWSER_TYPE_TXT /* txt type */
} vm_folder_browser_type_t;

/*******************************************************************************
 * FUNCTION
 *	vm_folder_browser_run
 * DESCRIPTION
 *	launch folder browser CUI.
 * PARAMETER
 *	type		:	[IN]	which type of file should be shown in folder browser.
 *							the optional values are :
 *								VM_FOLDER_BROWSER_TYPE_ALL
 *								VM_FOLDER_BROWSER_TYPE_IMAGE
 *								VM_FOLDER_BROWSER_TYPE_TXT
 *	folder_path	:	[IN]	the folder that you want to enter.
 *							NOTE:	it can NOT be L"root" or only a Driver name 
 *									such as L"D:\\".
 * RETURNS
 *	if success, return VM_FOLDER_BROWSER_ERR_SUCCESS.
 *	otherwise, a value in type of vm_folder_browser_type_t will be returned.
 ******************************************************************************/
VMINT vm_folder_browser_run(VMINT type, const VMWCHAR *folder_path);

typedef enum
{
    VM_FOLDER_SELECTOR_ERR_NO_RES           = -7, /* no avalible resource */
    VM_FOLDER_SELECTOR_ERR_PARAM,                 /* input invalid parameter */
    VM_FOLDER_SELECTOR_ERR_NO_MEMORY,             /* no memmory */
    VM_FOLDER_SELECTOR_ERR_NO_DISK,               /* driver path failure */
    VM_FOLDER_SELECTOR_ERR_EXCEPTION,             /* exception */
    VM_FOLDER_SELECTOR_ERR_NOT_SUPPORT,           /* platform doesn't support */
    VM_FOLDER_SELECTOR_ERR_NOT_AUTHORIZED,        /* no authrization */
    VM_FOLDER_SELECTOR_ERR_SUCCESS          = 0   /* success */
} vm_folder_selector_error_t;

typedef enum
{ 
    VM_FOLDER_SELECTOR_STYLE_READ,  /* CUI_FOLDER_SELECTOR_STYLE_READ */
    VM_FOLDER_SELECTOR_STYLE_WRITE, /* CUI_FOLDER_SELECTOR_STYLE_WRITE */
    VM_FOLDER_SELECTOR_STYLE_TOTAL  /* CUI_FOLDER_SELECTOR_STYLE_TOTAL */
} vm_folder_selector_style_t;

/******************************************************************************
 * FUNCTION
 *     vm_folder_selector_run
 * DESCRIPTION
 *     Start a file manager to select a folder.
 * PARAMETERS
 *     start_folder_path     : [IN] the path of start folder. when file manager
 *                                  is opened, it will enter this folder 
 *                                  directly.
 *     folder_selector_style : [IN] if it's VM_FOLDER_SELECTOR_STYLE_READ, that
 *                                      means you can NOT create a folder, 
 *                                      rename it or delete it.
 *                                  if it's VM_FOLDER_SELECTOR_STYLE_WRITE, that
 *                                      means you can create a folder, rename it
 *                                      , or delete it. 
 *     callback              : [IN] user provided callback function. when a 
 *                                  folder is selected, this function will be
 *                                  called to handle the selection. 
 *                                  selected_folder_path indicates which folder
 *                                      is selected. if it's NULL, that means 
 *                                      an error occurs.
 *                                  wlen is the length of selected folder's path
 *                                      in words.
 * RETURNS
 *     VM_FOLDER_SELECTOR_ERR_SUCCESS : the CUI runs successfully.
 *     other values means an error occurs, please refer to 
 *     vm_folder_selector_error_t for detailed information.
******************************************************************************/
VMINT vm_folder_selector_run(
    const VMWCHAR   *start_folder_path,
    VMINT           folder_selector_style,
    VMINT           (*callback)(VMWCHAR *selected_folder_path, VMINT wlen));

/*****************************************************************************
 * FUNCTION
 *  vm_pen_configure_sampling_period
 * DESCRIPTION
 *  Config sampling period of Event-based
 * PARAMETERS
 *  sp         :[IN]        (Pen Event)Sampling period in pen-moving (multiple of 10ms)
 * RETURNS
 *  VMINT
 * RETURN VALUES
 *  0 : success
 *  non-zero : failure
 *  -1 : no authorization
 *****************************************************************************/
VMINT vm_pen_configure_sampling_period(VMUINT sp);


typedef enum
{
    /* KEY1 Number */
    VM_KEYPAD_1KEY_NUMBER = 0,
    /* KEY2 Number */
    VM_KEYPAD_2KEY_NUMBER,
    /* reserved */
    VM_KEYPAD_3KEY_NUMBER,
    /* KEY1 Qwerty */
    VM_KEYPAD_1KEY_QWERTY,
    /* KEY2 Qwerty */
    VM_KEYPAD_2KEY_QWERTY,
    /* reserved */
    VM_KEYPAD_3KEY_QWERTY,
    /* reserved */
    VM_KEYPAD_MODE_END
} vm_keypad_mode_enum;

typedef enum
{
    VM_KBD_MODE_ERR_PARAM = -2, /* input invalid parameter */
    VM_KBD_MODE_ERR_NOT_AUTHORIZED, /* no authrization */
    VM_KBD_MODE_ERR_SUCCESS = 0 /* success */
}vm_kbd_mode_error_t;

/*****************************************************************************
 * FUNCTION
 *  vm_kbd_set_mode
 * DESCRIPTION
 *  set the concurrent key mode
 * PARAMETERS
 *  mode : [IN] see vm_keypad_mode_enum
 * RETURNS
 *  vm_kbd_mode_error_t
 * RETURN VALUES
 *  0 : success
 *  non-zero : failure
 *****************************************************************************/
VMINT vm_kbd_set_mode(VMUINT8 mode);

typedef enum
{
    VM_CAM_ERR_BUSY = -4,
    VM_CAM_ERR_EXCEPTION,
    VM_CAM_ERR_NOT_SUPPORT,
    VM_CAM_ERR_NOT_AUTHORIZED,
    VM_CAM_ERR_SUCCESS = 0,
}vm_camera_startup_error_t;


/*****************************************************************************
 * FUNCTION
 *  vm_camera_startup
 * DESCRIPTION
 *  Run Camrea APP directly, In lowend project, APP maybe need to exit cause of Out of Memory.
 * PARAMETERS
 *  Void
 * RETURNS
 *  Run result
 * RETURN VALUES
 *  0 : success
 *  non-zero : failure
 *****************************************************************************/
VMINT vm_camera_startup(void);

typedef enum
{
    VM_DEVCONFIG_KEYPAD_TYPE_NORMAL,     /* normal keypad type */
    VM_DEVCONFIG_KEYPAD_TYPE_REDUCED,    /* reduced keypad type */
    VM_DEVCONFIG_KEYPAD_TYPE_QWERTY,     /* qwerty keypad type */
    VM_DEVCONFIG_KEYPAD_TYPE_TOTAL
} vm_devconfig_keypad_type_enum;


/*****************************************************************************
* FUNCTION
*  vm_get_keypad_type
* DESCRIPTION
*  check the current type of keypad
* PARAMETERS
*  void
* RETURN VALUES
*  less than zero : failure
*  VM_DEVCONFIG_KEYPAD_TYPE_NORMAL : normal keypad type.
*  VM_DEVCONFIG_KEYPAD_TYPE_REDUCED : reduced keypad type.
*  VM_DEVCONFIG_KEYPAD_TYPE_QWERTY : qwerty keypad type.
*****************************************************************************/
VMINT vm_get_keypad_type(void);


/*****************************************************************************
 * FUNCTION
 *  vm_startup_email
 * DESCRIPTION
 *  startup email
 * PARAMETERS
 *  to_addr : [IN] email address of receiver (UCS2)
 * RETURN VALUES
 *  0 : success
 *  non-zero : failure
 *  -2 : platform not support
 *  -3 : no email account
 *****************************************************************************/
VMINT vm_startup_email(const VMWSTR to_addr);

/* vm_fmgr_default_folder_enum */
typedef enum
{
    VM_FMGR_DEFAULT_FOLDER_EBOOKS, /* path of defualt ebooks */
    VM_FMGR_DEFAULT_FOLDER_IMAGES, /* path of defualt images */
    VM_FMGR_DEFAULT_FOLDER_AUDIO, /* path of defualt audio */
    VM_FMGR_DEFAULT_FOLDER_VIDEO, /* path of defualt video */
    VM_FMGR_DEFAULT_FOLDER_SWFLASH, /* path of defualt swflash */
    VM_FMGR_DEFAULT_FOLDER_LANGLN, /* path of defualt langln */
    VM_FMGR_DEFAULT_FOLDER_TEMP, /* path of defualt temp */
    VM_FMGR_DEFAULT_FOLDER_THEMES, /* path of defualt themes */
    VM_FMGR_DEFAULT_FOLDER_BARCODE, /* path of defualt barcode */
    VM_FMGR_DEFAULT_FOLDER_MMSBOX, /* path of defualt mmsbox */
    VM_FMGR_DEFAULT_FOLDER_ROOT,  /* path of defualt root */
    VM_FMGR_DEFAULT_FOLDER_TOTAL
}vm_fmgr_default_folder_enum;

/*****************************************************************************
 * FUNCTION
 *  vm_get_default_folder_path
 * DESCRIPTION
 *  get the default path of folder type
 * PARAMETERS
 *  mode : [IN] see vm_fmgr_default_folder_enum
 * RETURNS
 *  const VMWCHAR * (UCS2)
 * RETURN VALUES
 *  non-NULL : success
 *  NULL : failure
 *****************************************************************************/
const VMWCHAR * vm_get_default_folder_path(vm_fmgr_default_folder_enum type);


/* vm_file_copy Callback Return Value */
typedef enum
{
   /* <color red>if something wrong, will call once</color>
    * Fail to do the copy action. Total and Completed will be zero.
    */
    VM_FS_MOVE_PGS_FAIL = -1,

    /*
     * <color red>Always call once</color>
     * Prepare to do the copy action. Parameter checking and remove target will be done at this stage.
     * Total and Completed will be zero.
     */
    VM_FS_MOVE_PGS_PREPARE,

   /*
    * <color red>If pass parameter checking, always call once.</color>
    * Start to do the copy action. Total and Completed will be zero.
    */
    VM_FS_MOVE_PGS_START,

   /*
    * <color red>Not always call even if nothing wrong.</color>
    * If you move/copy a folder recursively, Total will be the number of files/folders to be moved/copied.
    * Completed will be the files/folders that had been copied.
    * If you just copy a file, Total will be the size of this file and Completed will be the bytes that had been copied.
    * <color red>Note</color> that if move/copy only one file, this callback will be triggered when interval is longer than 100ms around.
    */
    VM_FS_MOVE_PGS_ING,

   /*
    * <color redIf nothing fail, always call once</color>
    * Move/copy action is done. Total and Completed will be zero.
    */
    VM_FS_MOVE_PGS_DONE
} vm_fs_move_pgs_enum;


/*****************************************************************************
 * <GROUP  CallbackFunctions>
 * FUNCTION
 *  vm_file_copy_cb
 * DESCRIPTION
 *  Callback function type for file copy.
 * PARAMETERS
 *  act : [IN] see vm_fs_move_pgs_enum.
 *  total : [IN] the size of source file.
 *  completed : [IN] copied size.
 *  hdl : [IN] handle of file copy.
 * RETURNS
 *  VMINT
 *****************************************************************************/
typedef VMINT (*vm_file_copy_cb)(VMINT act, VMUINT32 total, VMUINT32 completed, VMINT hdl);

/*****************************************************************************
 * FUNCTION
 *  vm_file_copy
 * DESCRIPTION
 *  copy file
 * PARAMETERS
 *  dst : [IN] the file path of destination UCS2
 *  src : [IN] the file path of source UCS2
 *  cb : [IN] callback of file copy
 * RETURNS
 *  VMINT
 * RETURN VALUES
 *  successful if 0, else failure
 *  (-2): bad parameter.
 *  (-3): Either source full path or destination full path is wrong
 *  (-19): Cannot find source full path specified.
 *  (-36): destination full path exists.
 *  (-44): Cannot get memory to do the operation
 *  (-46): busy.
 *  (-47): This action has been aborted in the user's callback function.
 *****************************************************************************/
VMINT vm_file_copy(const VMWSTR dst, const VMWSTR src, vm_file_copy_cb cb);

/*****************************************************************************
 * FUNCTION
 *  vm_file_copy_abort
 * DESCRIPTION
 *  abort file copy
 * PARAMETERS
 *  hdl : [IN] handle of file copy
 * RETURNS
 *  VMINT
 * RETURN VALUES
 *  success if 0, else failure
 *****************************************************************************/
VMINT vm_file_copy_abort(VMINT hdl);



typedef enum
{
    VM_MULTI_TOUCH_ERR_NO_RES = -7, /* no avalible resource */
    VM_MULTI_TOUCH_ERR_PARAM, /* input invalid parameter */
    VM_MULTI_TOUCH_ERR_NO_MEMORY, /* no memmory */
    VM_MULTI_TOUCH_ERR_NO_DISK, /* driver path failure */
    VM_MULTI_TOUCH_ERR_EXCEPTION, /* exception */
    VM_MULTI_TOUCH_ERR_NOT_SUPPORT, /* platform dose not support */
    VM_MULTI_TOUCH_ERR_NOT_AUTHORIZED, /* no authrization */
    VM_MULTI_TOUCH_ERR_SUCCESS = 0 /* success */
}vm_multi_touch_error_t;


/* Touch screen mode */
typedef enum
{
    /* Single touch mode, just send one finger event to application, this is default behavior */
    VM_SINGLE_TOUCH,
    /* Multi-touch mode, send several events to application, according to how many fingers on the screen, at most it is five */
    VM_MULTI_TOUCH,
    /* Total touch event total, no need to handle this */
    VM_MULTI_TOUCH_TOTAL
} vm_touch_mode;


/* structure of Point */
typedef struct
{
    /* x coordinate */
    VMINT16 x;
    /* x coordinate */
    VMINT16 y;
} vm_pen_point_struct;

/* The touch position structure */
typedef struct
{
    /* The coordinates of this event */
    vm_pen_point_struct pos;
    /* The timestamp of this event */
    VMUINT32 timestamp;
} vm_touch_pos_struct;

/*
 *  Each finger touch data information
 *  Example:
 *  typedef struct
 *  {
 *      vm_pen_point_struct down_pos; // ((200, 110), 29999)
 *      VMUINT16 merge_num; // 2
 *      vm_pen_point_struct* merge_points; // ((200, 200), 30010), ((200, 250), 30020)
 *      VMUINT16* merge_area; // (50, 40)
 *  } mmi_touch_data_struct;
 */
typedef struct
{
    VMUINT16 id; /* finger id */
    VMINT  event; /* current touch event */
    vm_touch_pos_struct currpos; /* current touch info */
    VMUINT16 area; /* current finger area */
    VMINT pre_event; /* previous touch event */
    vm_touch_pos_struct pre_pos; /* previous touch info */
    vm_touch_pos_struct down_pos; /* pen down info */
    VMUINT16 merge_num;  /* if there are several pen move events, we will send several pen move events together to application */
    vm_touch_pos_struct* merge_points; /* pen move events array */
    VMUINT16* merge_area; /* related pen move area */
} vm_multi_touch_data_struct;

typedef struct 
{
    /* The finger number of this event, at most it is five */
    VMUINT16 touch_num;
    /* The touch data of each event */
    vm_multi_touch_data_struct * touch_data;
}vm_multi_touch_event_struct;

/*****************************************************************************
 * FUNCTION
 *  vm_multi_touch_get_mode
 * DESCRIPTION
 *  get current screen touch mode
 * PARAMETERS
 *  void
 * RETURNS
 *  VMINT
 *****************************************************************************/
VMINT vm_multi_touch_get_mode(void);

/*****************************************************************************
 * FUNCTION
 *  vm_multi_touch_set_mode
 * DESCRIPTION
 *  set touch screen mode
 * PARAMETERS
 *  mode : [IN] the parameter should be vm_touch_mode, single or multiple
 * RETURNS
 *  VMINT
 *****************************************************************************/
VMINT vm_multi_touch_set_mode(vm_touch_mode mode);

/*****************************************************************************
 * <GROUP  CallbackFunctions>
 * FUNCTION
 *  vm_multi_touch_proc_t
 * DESCRIPTION
 * PARAMETERS
 *  param : [IN] vm_multi_touch_event_struct.
 *  user_data : [IN] user data.
 * RETURNS
 *  VMINT
 *****************************************************************************/
typedef VMINT (*vm_multi_touch_proc_t) (vm_multi_touch_event_struct * evt_info, void * user_data);

/*****************************************************************************
 * FUNCTION
 *  vm_touch_register_proc
 * DESCRIPTION
 *  Register touch proc by screen level, no need to reset, the single touch event or
 * PARAMETERS
 *  proc : [IN] the proc, the event in the proc should be vm_multi_touch_event_struct.
 *  user_data : [IN] user data, framework will send this user_data to your proc
 * RETURNS
 *  vm_touch_register_proc
 *****************************************************************************/
VMINT vm_multi_touch_register_proc(vm_multi_touch_proc_t proc, void *user_data);



/* flag for async fs */
#define VM_FS_READ_WRITE           0x00000000L
#define VM_FS_READ_ONLY            0x00000100L
#define VM_FS_OPEN_SHARED          0x00000200L
#define VM_FS_OPEN_NO_DIR          0x00000400L
#define VM_FS_OPEN_DIR             0x00000800L
#define VM_FS_CREATE               0x00010000L
#define VM_FS_CREATE_ALWAYS        0x00020000L
#define VM_FS_COMMITTED            0x01000000L
#define VM_FS_CACHE_DATA           0x02000000L
#define VM_FS_LAZY_DATA            0x04000000L
#define VM_FS_NONBLOCK_MODE        0x10000000L
#define VM_FS_PROTECTION_MODE      0x20000000L
#define VM_FS_NOBUSY_CHECK_MODE    0x40000000L



typedef VMINT vm_fs_api_enum;
typedef VMINT vm_fs_job_state_enum;
typedef VMINT vm_fs_job_id;
typedef VMINT vm_module_type;
typedef VMINT VM_FS_HANDLE;
typedef VMINT (*vm_fs_async_callback)(vm_fs_job_id jid, VMINT64 * result, void *data);


typedef enum
{
    VM_FS_PRIORITY_DEFAULT         = 0,        // Default: This job will use lower priority to run. Suitable to non-critical jobs.
    VM_FS_PRIORITY_INHERITED,                  // Inherited: This job will inherites the priority of user. Suitable to critical jobs.
    VM_FS_PRIORITY_INVALID         = 0xFF
}vm_fs_prioity_enum;

typedef struct
{
    vm_fs_api_enum             api;        // The API enumeration of this job
    vm_fs_job_state_enum       reserved1;  // Reserved
    VMUINT8               reserved2;  // Reserved
    vm_fs_job_id               jid;         // Job ID. It also appears in the 1st parameter of callback function.
    vm_module_type             reserved3;  // Reserved
    VMINT64               result;     // Execution result of FS API. It also appears in the 2nd parameter of callback function.
    vm_fs_async_callback       callback;   // Callback function pointer
    void                    *param;     // Parameter of callback function. It is defined in by user whenever FS async I/F is used.
    void                    *reserved4;  // Reserved
}vm_fs_async_callback_data_struct;


typedef struct
{
    vm_fs_async_callback_data_struct head;
    VMINT   job_id;
    VMINT    aborted;
}vm_fs_job_abort_struct;

typedef struct
{
    vm_fs_async_callback_data_struct head;
    VMWCHAR *  filename;
    VMUINT  flag;
}vm_fs_job_open_struct;

typedef struct
{
    vm_fs_async_callback_data_struct head;
    VMINT   fs_hdl;
    void        * data;
    VMUINT  length;
    VMUINT  * read;
}vm_fs_job_read_struct;

typedef struct
{
    vm_fs_async_callback_data_struct head;
    VMINT   fs_hdl;
    void        * data;
    VMUINT  length;
    VMUINT  * written;
}vm_fs_job_write_struct;

typedef struct
{
    vm_fs_async_callback_data_struct head;
    const VMWCHAR * filename;
}vm_fs_job_delete_struct;

typedef struct
{
    vm_fs_async_callback_data_struct head;
    VMINT   fs_hdl;
    VMINT64   offset;
    VMINT   whence;
}vm_fs_job_seek_struct;


typedef struct
{
    vm_fs_prioity_enum         priority;   // priority configuration of this job
    vm_fs_async_callback       callback;   // callback function pointer
    void                    *param;     // parameter of callback function
}vm_fs_overlapped_struct;

/*****************************************************************************
 * FUNCTION
 *    fs_aysnc_open
 *
 * DESCRIPTION
 *    Open a file
 *
 * PARAMETERS
 *  filename         :[IN]  Must point to the name of the file to open/create.
 *                          File names are not case sensitive; they will be converted to
 *                          upper case when file system searches this file, and they should
 *                          be two-byte aligned and UCS2 encoded. The file name can have one
 *                          of the following formats:
 *  flag             :[IN]  Can be a combination of the following flags:
 *                          VM_FS_READ_WRITE       VM_FS_READ_ONLY        VM_FS_OPEN_SHARED      VM_FS_OPEN_NO_DIR
 *                          VM_FS_OPEN_DIR         VM_FS_CREATE           VM_FS_CREATE_ALWAYS    VM_FS_COMMITTED
 *                          VM_FS_CACHE_DATA       VM_FS_LAZY_DATA        VM_FS_ATTR_HIDDEN      VM_FS_ATTR_SYSTEM
 *                          VM_FS_ATTR_ARCHIVE     VM_FS_NONBLOCK_MODE    VM_FS_PROTECTION_MODE
 *  overlapped       :[IN]  Overlapped structure has 3 members,
 *                          1. callback :[IN]   (Optional) Call back function. This function will be executed just after response message is received by user.
 *                          2. param    :[IN]   (Optional) Parameters for call back function
 *                          3. priority :[IN]   (*Required) Priority of this job, it can be any one of following options,
 *                                                  1. VM_FS_PRIORITY_DEFAULT  : User has no priority concern for this job)
 *                                                  2. VM_FS_PRIORITY_INHERITED: FS task will be raised to a higher priorty to execute this job)
 * RETURNS
 *  Successful  : A positive integer. It is Job ID.
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_open(const VMWSTR file_name, VMINT flag, vm_fs_overlapped_struct *overlapped);

/*****************************************************************************
 * FUNCTION
 *    vm_fs_async_write
 *
 * DESCRIPTION
 *    Write data to a file
 *
 * PARAMETERS
 *  fs_hdl          :[IN]   file handle, get it from *result in VMINT (*vm_fs_async_callback)(vm_fs_job_id jid, VMINT64 * result, void *data);
 *  data            :[IN]   Specifies the address of the data to be written.
 *  length          :[IN]   Specifies the number of bytes to write.
 *  written         :[OUT]  Pointer to an unsigned integer to receive the number of
 *                          bytes actually been written. Usually, *Written will contain
 *                          Length after the call. However, in case of an error, the
 *                          returned value may be less. Written may be set to NULL if
 *                          this information is not required by an application.
 *  overlapped       :[IN]  Overlapped structure has 3 members,
 *                          1. callback :[IN]   (Optional) Call back function. This function will be executed just after response message is received by user.
 *                          2. param    :[IN]   (Optional) Parameters for call back function
 *                          3. priority :[IN]   (*Required) Priority of this job, it can be any one of following options,
 *                                                  1. VM_FS_PRIORITY_DEFAULT  : User has no priority concern for this job)
 *                                                  2. VM_FS_PRIORITY_INHERITED: FS task will be raised to a higher priorty to execute this job)
 * RETURNS
 *  Successful  : A positive integer. It is Job ID.
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_write(VM_FS_HANDLE fs_hdl, void *data, VMUINT length, VMUINT *written, vm_fs_overlapped_struct *overlapped);

/*****************************************************************************
 * FUNCTION
 *    vm_fs_async_write
 *
 * DESCRIPTION
 *    Read data to a file
 *
 * PARAMETERS
 *  fs_hdl          :[IN]   file handle, get it from *result in VMINT (*vm_fs_async_callback)(vm_fs_job_id jid, VMINT64 * result, void *data);
 *  data            :[IN]   Specifies the address of the data to be read.
 *  length          :[IN]   Specifies the number of bytes to write.
 *  read         :[OUT]  Pointer to an unsigned integer to receive the number of
 *                          bytes actually been read. Usually, *Written will contain
 *                          Length after the call. However, in case of an error, the
 *                          returned value may be less. Written may be set to NULL if
 *                          this information is not required by an application.
 *  overlapped       :[IN]  Overlapped structure has 3 members,
 *                          1. callback :[IN]   (Optional) Call back function. This function will be executed just after response message is received by user.
 *                          2. param    :[IN]   (Optional) Parameters for call back function
 *                          3. priority :[IN]   (*Required) Priority of this job, it can be any one of following options,
 *                                                  1. VM_FS_PRIORITY_DEFAULT  : User has no priority concern for this job)
 *                                                  2. VM_FS_PRIORITY_INHERITED: FS task will be raised to a higher priorty to execute this job)
 * RETURNS
 *  Successful  : A positive integer. It is Job ID.
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_read(VM_FS_HANDLE fs_hdl, void *data, VMUINT length, VMUINT *read, vm_fs_overlapped_struct *overlapped);

/*****************************************************************************
 * FUNCTION
 *    vm_fs_async_seek
 *
 * DESCRIPTION
 *    Seek to a specific position of a file
 *
 * PARAMETERS
 *  fs_hdl          :[IN]   file handle, get it from *result in VMINT (*vm_fs_async_callback)(vm_fs_job_id jid, VMINT64 * result, void *data);
 *  offset          :[IN]   Specifies the offset (bytes) of the file to be seeked.
 *  whence          :[IN]   Specifies the method (start address) of the seek.
 *  overlapped       :[IN]  Overlapped structure has 3 members,
 *                          1. callback :[IN]   (Optional) Call back function. This function will be executed just after response message is received by user.
 *                          2. param    :[IN]   (Optional) Parameters for call back function
 *                          3. priority :[IN]   (*Required) Priority of this job, it can be any one of following options,
 *                                                  1. VM_FS_PRIORITY_DEFAULT  : User has no priority concern for this job)
 *                                                  2. VM_FS_PRIORITY_INHERITED: FS task will be raised to a higher priorty to execute this job)
 * RETURNS
 *  Successful  : A positive integer. It is Job ID.
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_seek(VM_FS_HANDLE fs_hdl, VMINT64 * offset, VMINT whence, vm_fs_overlapped_struct *overlapped);


/*****************************************************************************
 * FUNCTION
 *    vm_fs_async_delete
 *
 * DESCRIPTION
 *    Delete a file
 *
 * PARAMETERS
 *  filename        :[IN]   References the open file to seek to.
 *  overlapped       :[IN]  Overlapped structure has 3 members,
 *                          1. callback :[IN]   (Optional) Call back function. This function will be executed just after response message is received by user.
 *                          2. param    :[IN]   (Optional) Parameters for call back function
 *                          3. priority :[IN]   (*Required) Priority of this job, it can be any one of following options,
 *                                                  1. VM_FS_PRIORITY_DEFAULT  : User has no priority concern for this job)
 *                                                  2. VM_FS_PRIORITY_INHERITED: FS task will be raised to a higher priorty to execute this job)
 * RETURNS
 *  Successful  : A positive integer. It is Job ID.
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_delete(const VMWSTR filename, vm_fs_overlapped_struct *overlapped);

/*****************************************************************************
 * FUNCTION
 *  vm_fs_async_abort
 *
 * DESCRIPTION
 *  This function provides the facility to abort a specific job by Job ID
 *
 * PARAMETERS
 *  jid      :[IN]   Job ID
 * 
 * RETURNS
 *  Successful  : A non-negative integer
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_abort(vm_fs_job_id jid);


/*****************************************************************************
 * FUNCTION
 *  vm_fs_async_commit
 *
 * PARAMETERS
 *  fs_hdl          :[IN]   file handle, get it from *result in VMINT (*vm_fs_async_callback)(vm_fs_job_id jid, VMINT64 * result, void *data);
 *
 * DESCRIPTION
 *  Immediately flushes all buffers associated with a file to disk.
 *
 * PARAMETERS
 *  jid      :[IN]   Job ID
 * 
 * RETURNS
 *  Successful  : A non-negative integer
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_commit(VM_FS_HANDLE fs_hdl);

/*****************************************************************************
 * FUNCTION
 *  vm_fs_async_close
 *
 * PARAMETERS
 *  fs_hdl          :[IN]   file handle, get it from *result in VMINT (*vm_fs_async_callback)(vm_fs_job_id jid, VMINT64 * result, void *data);
 *
 * DESCRIPTION
 *  Immediately flushes all buffers associated with a file to disk.
 *
 * RETURNS
 *  Successful  : A non-negative integer
 *  Failed      : A negative integer. -1 means no authorization.
 *****************************************************************************/
VMINT vm_fs_async_close(VM_FS_HANDLE fs_hdl);

VMINT vm_fs_async_get_working_buf_size(void);

/*****************************************************************************
 * FUNCTION
 *  vm_kbd_is_key_supported
 * DESCRIPTION
 *  query if specified key code is supported
 * PARAMETERS
 *  keycode    [IN]    key code
 * RETURNS
 *  non-zero  : supported.
 *  zero      : unsupported
 *****************************************************************************/
VMINT vm_kbd_is_key_supported(VMINT keycode);


/* This enumeration defines the error code of dispatching URI request or registering URI request handler by scheme or by prefix. */
typedef enum
{
    VM_SRV_URIAGENT_ERR_OK,                    /* Success to process this request. */
    VM_SRV_URIAGENT_ERR_SCHEME_IS_REGISTERED,  /* Fail to process this registration  because handler was already registered for this scheme; this error code is used for URI request handler registration only. */
    VM_SRV_URIAGENT_ERR_PREFIX_IS_REGISTERED,  /* Fail to process this registration  because handler was already registered for this prefix; this error code is used for URI request handler registration only. */
    VM_SRV_URIAGENT_ERR_PROCESSING,            /* Fail to process this URI request because the previous request from the same URA is  still in processing; this error code is used for URI request dispatch only. */
    VM_SRV_URIAGENT_ERR_UNSUPPORTED            /* Fail to process this request. */
}vm_srv_uriagent_err_enum;


/*****************************************************************************
 * FUNCTION
 *  vm_uriagent_uri_request
 * DESCRIPTION
 *  wtai
 * PARAMETERS
 *  str    [IN]    string of wati
 *  confirm    [IN]    confirm
 * RETURNS
 *  -1 : no authorization
 *  -2 : not be supported
 *  refer to vm_srv_uriagent_err_enum
 *****************************************************************************/
VMINT vm_uriagent_uri_request(const VMCHAR * str, VMINT confirm);

/*****************************************************************************
 * FUNCTION
 *  vm_start_native_browser
 * DESCRIPTION
 *  query if specified key code is supported
 * PARAMETERS
 *  url    [IN]    open native browser if there dose exist.
 * RETURNS
 *  -1 : no authorization
 *  -2 : not be supported
 *  refer to return value of vm_open_wap_url 
 *****************************************************************************/
VMINT vm_start_native_browser(const VMWSTR url);

typedef struct
{
    VMBYTE * dst;
    VMUINT dst_size;
    VMBYTE * src;
    VMUINT src_size;
}vm_zip_t;

VMINT vm_uncompress(const vm_zip_t * info, void * (*app_malloc)(VMUINT items, VMUINT size), void (*app_free)(void * address));


#ifdef __cplusplus
}
#endif

#endif /* VMIO_SDK_H_ */