ImpsSrvGprot.h 76.8 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
/*****************************************************************************
*  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).
*
*****************************************************************************/

/*******************************************************************************
 * Filename:
 * ---------
 * ImpsSrvGprot.h
 *
 * Project:
 * --------
 * MAUI
 *
 * Description:
 * ------------
 * This file defines local contant, structure, enum, and function prototypes for
 * IMPS service.
 *
 * Author:
 * -------
 * -------
 *
 *==============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *==============================================================================
 *******************************************************************************/
#ifndef __IMPS_SRV_GPROT_H__
#define __IMPS_SRV_GPROT_H__

#include "kal_general_types.h"
#include "MMIDataType.h"
#include "custom_mmi_default_value.h"

#include "mmi2imps_struct.h"

/* define the maximum number of contact list */
#define SRV_IMPS_MAX_CONTACT_LIST_COUNT     (5)

/* define the maximum number of contact, one for myself */
#define SRV_IMPS_MAX_CONT_COUNT             (50 + 1)  

/* define the maximum number of chat room */
#define SRV_IMPS_MAX_ROOM_COUNT             (10)

/* define the index of myself in contact information */
#define SRV_IMPS_MYSELF_INDEX               (10000)

/* define the index of on-line contact list for sort type is status */
#define SRV_IMPS_CONT_INDEX_ONLINE          (1)

/* define the index of off-line contact list for sort type is status */
#define SRV_IMPS_CONT_INDEX_OFFLINE         (2)

/* maximum buffer length to store my picture */
#define SRV_IMPS_MAX_PIC_PATH_LEN           (60)

/* maximum number of pend message */
#define SRV_IMPS_MAX_PEND_MSG_COUNT         (10)

/* enumerate events used between app and service */
typedef enum
{
    SRV_IMPS_EVENT_IDLE = 0,

    SRV_IMPS_EVENT_SET_DATA_ACCOUNT, /* service need use data account to judge whether 
                                        it is ok for login */

    SRV_IMPS_EVENT_LOGIN,
    SRV_IMPS_EVENT_ABORT_LOGIN,
    SRV_IMPS_EVENT_LOGOUT,
    SRV_IMPS_EVENT_SEARCH_CONT,             /* 5 */
    SRV_IMPS_EVENT_SEARCH_GROUP,
    SRV_IMPS_EVENT_ABORT_SEARCH,
    SRV_IMPS_EVENT_INVITE_GROUP,
    SRV_IMPS_EVENT_INVITE_PRESENCE,
    SRV_IMPS_EVENT_INVITE_REPLY,            /* 10 */
    SRV_IMPS_EVENT_EXT_CONV,

    SRV_IMPS_EVENT_SEND_MESSAGE,
    SRV_IMPS_EVENT_GET_MESSAGE,
    SRV_IMPS_EVENT_REJECT_MESSAGE,
    SRV_IMPS_EVENT_FORWARD_MESSAGE,         /* 15 */   
    SRV_IMPS_EVENT_GET_BLOCK_LIST,
    SRV_IMPS_EVENT_BLOCK_ENTITY,
    
    SRV_IMPS_EVENT_CREATE_GROUP,
    SRV_IMPS_EVENT_JOIN_GROUP,
    SRV_IMPS_EVENT_DELETE_GROUP,            /* 20 */
    SRV_IMPS_EVENT_LEAVE_GROUP,
    SRV_IMPS_EVENT_GET_GROUP_MEMBER,
    SRV_IMPS_EVENT_GET_JOINED_USER,
    SRV_IMPS_EVENT_GET_REJECTED_USER,
    SRV_IMPS_EVENT_ADD_GROUP_MEMBER,        /* 25 */
    SRV_IMPS_EVENT_REMOVE_GROUP_MEMBER,
    SRV_IMPS_EVENT_CHANGE_MEMBER_ACCESS,
    SRV_IMPS_EVENT_REJECT_GROUP_USER,
    SRV_IMPS_EVENT_REMOVE_REJECT_GROUP_USER,
    SRV_IMPS_EVENT_ABORT_GET_JOINED_USER,   /* 30 */
    SRV_IMPS_EVENT_ABORT_GET_GROUP_MEMBER,
    SRV_IMPS_EVENT_ABORT_GET_REJECTED_USER,

    SRV_IMPS_EVENT_ADD_CONTACT_LIST,
    SRV_IMPS_EVENT_EDIT_CONTACT_LIST,
    SRV_IMPS_EVENT_DEL_CONTACT_LIST,        /* 35 */
    SRV_IMPS_EVENT_VIEW_CONTACT_LIST,
    SRV_IMPS_EVENT_ADD_CONTACT,
    SRV_IMPS_EVENT_ADD_CONTACT_INVITE_PR, /* for add contact, service will send invite pr to contact */
    SRV_IMPS_EVENT_EDIT_CONTACT,          
    SRV_IMPS_EVENT_DEL_CONTACT,             /* 40 */
    SRV_IMPS_EVENT_MOVE_CONTACT,
    SRV_IMPS_EVENT_SUBS_PA,	
    SRV_IMPS_EVENT_GET_MY_PA,
    SRV_IMPS_EVENT_GET_CONTACT_PA,
    SRV_IMPS_EVENT_ABORT_GET_CONTACT_PA,    /* 45 */
    SRV_IMPS_EVENT_GET_ALL_CONTACT_PA,
    SRV_IMPS_EVENT_SUBS_ALL_CONTACT_PA,
    SRV_IMPS_EVENT_UPDATE_PA,
	SRV_IMPS_EVENT_UPDATE_STATUS,
	SRV_IMPS_EVENT_UPDATE_ALIAS,            /* 50 */
    SRV_IMPS_EVENT_GET_MY_PP,
    SRV_IMPS_EVENT_GET_CONT_PP,
    SRV_IMPS_EVENT_GET_STRANGER_PP,
    SRV_IMPS_EVENT_ABORT_GET_PP,
    SRV_IMPS_EVENT_UPDATE_PP,               /* 55 */
    SRV_IMPS_EVENT_PA_AUTH_USER,    
    SRV_IMPS_EVENT_GET_WATCHER_LIST,
    SRV_IMPS_EVENT_ABORT_GET_WATCHER_LIST,
	SRV_IMPS_EVENT_CREATE_ATTRIBUTE_LIST,

    SRV_IMPS_EVENT_HTTP_AUTH_RES,           /* 60 */
    SRV_IMPS_EVENT_SYSTEM_MSG_USER,
    SRV_IMPS_EVENT_SUBS_NOTIFY,
    SRV_IMPS_EVENT_UNSUBS_NOTIFY,    
    SRV_IMPS_EVENT_DL_FILE,
    
    SRV_IMPS_EVENT_LOGIN_READY_IND,  /* related with app data account */

    /* begin of indication, these indication will notify all registered app */
    SRV_IMPS_EVENT_IND_BEGIN,               /* 66 */
    SRV_IMPS_EVENT_LOGIN_PROGRESS_IND = SRV_IMPS_EVENT_IND_BEGIN,	/* 66 */
    SRV_IMPS_EVENT_SERVICE_CAPABILITY_IND,    
    SRV_IMPS_EVENT_CONT_LIST_UPDATE_IND,  /* contact list changed */
    SRV_IMPS_EVENT_CONT_INFO_UPDATE_IND,
    SRV_IMPS_EVENT_CONT_INFO_UPDATE_DONE_IND,
    SRV_IMPS_EVENT_CONT_INFO_SUBS_DONE_IND,     /* 71 */
    SRV_IMPS_EVENT_DISCONNECT_IND,
    SRV_IMPS_EVENT_INVITE_IND,
    SRV_IMPS_EVENT_INVITE_RESPONSE_IND,
    SRV_IMPS_EVENT_INVITE_EC_IND, /* for 1-1 chat, contact has invite others join, 
                                     app need clear unread message flag in contact list */
    SRV_IMPS_EVENT_EXT_CONV_IND,                /* 76 */
    SRV_IMPS_EVENT_NEWMESSAGE_IND,
    SRV_IMPS_EVENT_MESSAGENOTIFY_IND,
    SRV_IMPS_EVENT_OFFLINE_MESSAGE_IND,
    SRV_IMPS_EVENT_GROUP_CHANGE_NOTIFY_IND,
    SRV_IMPS_EVENT_LEAVE_GROUP_IND,             /* 81 */
    SRV_IMPS_EVENT_SYSTEM_MSG_IND,
    SRV_IMPS_EVENT_PA_NOTIFY_IND,
    SRV_IMPS_EVENT_PA_AUTH_IND,
    SRV_IMPS_EVENT_NOTIFY_REQUEST_IND,
    SRV_IMPS_EVENT_HTTP_AUTH_IND,               /* 86 */
    SRV_IMPS_EVENT_IND_END,
    /* end of indication */

    SRV_IMPS_EVENT_END_OF_ENUM
} srv_imps_event_enum;

/* enumerate the event result that service handle */
typedef enum
{
    SRV_IMPS_RESULT_OK = 0,
    SRV_IMPS_RESULT_INVALID_PARAMETERS = -1,
    SRV_IMPS_RESULT_ERROR = -2,
    SRV_IMPS_RESULT_BUSY = -3,
    SRV_IMPS_RESULT_NOT_LOGIN = -4,
    SRV_IMPS_RESULT_LOGIN_BY_OTHER = -5,
	SRV_IMPS_RESULT_SERVER_DISCONN = -6,
    SRV_IMPS_RESULT_CONTACT_LIST_FULL = -7,
    SRV_IMPS_RESULT_CONTACT_FULL = -8,
    SRV_IMPS_RESULT_ROOM_FULL = -9,
    SRV_IMPS_RESULT_CONTACT_EXIST = -10,

    SRV_IMPS_RESULT_END_OF_ENUM
} srv_imps_result_enum;

/* Enumerate IMPS service process status */
typedef enum
{
    SRV_IMPS_STATUS_IDLE = 0,
    SRV_IMPS_STATUS_INIT,               /* initialized */    
    SRV_IMPS_STATUS_LOGING_IN,          /* loging in */
    SRV_IMPS_STATUS_ABORTING_LOGIN,     /* aborting login */
    SRV_IMPS_STATUS_LOGIN,              /* already login */
    SRV_IMPS_STATUS_SYNCING_CONT_LIST,  /* syncing contact list from server */
    SRV_IMPS_STATUS_SYNCING_CONT,       /* syncing contact from server */    
    SRV_IMPS_STATUS_UPDATE_INFO,        /* already update information from server */
	SRV_IMPS_STATUS_LOGING_OUT,         /* loging out */
    SRV_IMPS_STATUS_END_OF_ENUM
} srv_imps_status_enum;

/* Enumerate file type, service save event response result in file, app use file 
   type to get file name and delete this file after finish used */
typedef enum
{    
    SRV_IMPS_GROUP_ENTITY_MEMBER,
    SRV_IMPS_GROUP_ENTITY_JOINED_USER,
    SRV_IMPS_GROUP_ENTITY_REJECTED_USER,    
    SRV_IMPS_GROUP_ENTITY_END_OF_ENUM
} srv_imps_group_entity_type_enum;

/* Enumerate message type used in send message request */
typedef enum
{
    SRV_IMPS_SEND_MSG_TYPE_TEXT = 0,
    SRV_IMPS_SEND_MSG_TYPE_FILE = TRUE,
    SRV_IMPS_SEND_MSG_TYPE_TEMP_FILE = IMPS_CONTENT_STORE_TEMP_FILE,
    SRV_IMPS_SEND_MSG_TYPE_END_OF_ENUM
} srv_imps_send_msg_type_enum;

/* Enumerate type of chat room */
typedef enum
{
    SRV_IMPS_ROOM_TYPE_SINGLE = 0,      /* single talk */
    SRV_IMPS_ROOM_TYPE_GROUP_CREATE,    /* a created group */
    SRV_IMPS_ROOM_TYPE_GROUP_JOIN       /* a joined group */
} srv_imps_room_type_enum;

/* Enumerate type of contact sort */
typedef enum
{    
    SRV_IMPS_CONT_SORT_BY_STATUS,
    SRV_IMPS_CONT_SORT_BY_NAME, 
    SRV_IMPS_CONT_SORT_TYPE_END_OF_ENUM
} srv_imps_cont_sort_type_enum;

/* Enumerate contact presence status */
typedef enum
{
    SRV_IMPS_PA_USER_UNKNOWN = 0,       /* refreshed state */
    SRV_IMPS_PA_USER_OFFLINE,           /* off-line */
    SRV_IMPS_PA_USER_AVAILABLE,         /* on-line */
    SRV_IMPS_PA_USER_DISCREET,          /* busy */
    SRV_IMPS_PA_USER_NOT_AVAILABLE,     /* away */
    SRV_IMPS_PA_USER_STATUS_END_OF_ENUM
} srv_imps_pa_user_status_enum;

typedef enum
{
    SRV_IMPS_GROUP_CHANGE_JOINED_USER,
    SRV_IMPS_GROUP_CHANGE_LEFT_USER,    
    SRV_IMPS_GROUP_CHANGE_JOINED_BLOCK_USER,
    SRV_IMPS_GROUP_CHANGE_LEFT_BLOCK_USER,
    SRV_IMPS_GROUP_CHANGE_TYPE_END_OF_ENUM
} srv_imps_group_change_type_enum;

/* data structure of a contact */
typedef struct
{
    CHAR id[IMPS_MAX_ID_LEN];                       /* contact id */    
    U32 index;                                      /* the index of contact */
    U32 cont_list_index;                            /* contact list id that the contact belonged */ 
    WCHAR nick_name[IMPS_MAX_NAME_LEN];             /* nick name */
    WCHAR alias[IMPS_MAX_NAME_LEN];                 /* alias */
    WCHAR prof_text[IMPS_MAX_PA_STATUS_TEXT_LEN];   /* text profile */    
    U8 availability;                                /* availability */    
    U8 online_status;                               /* on-line status */
    U8 mood;                                        /* mood */ 
    U8 device_type;                                 /* device type */
    MMI_BOOL is_blocked;                            /* whether the contact is blocked */
    MMI_BOOL pa_ready;                              /* whether presence updated from server */ 
    imps_accepted_content_type_list_info_struct content_type; /* mime type supported */
} srv_imps_contact_struct;

/* structure of a contact list */
typedef struct
{
    CHAR id[IMPS_MAX_ID_LEN];                        /* contact_list id */
    U32 index;                                      /* the index of contact list, 0 is reserved */
    WCHAR name[IMPS_MAX_NAME_LEN];                  /* contact list name */    
    S32 no_users;                                   /* number of users in the contact list */
    MMI_BOOL open_status;                           /* opened/hidden state of on-line status */
    MMI_BOOL open_text;                             /* opened/hidden state of text */
    MMI_BOOL open_mood;                             /* opened/hidden state of mood */
    MMI_BOOL open_pic;                              /* opened/hidden state of status content */
    MMI_BOOL open_alias;                            /* opened/hidden state of alias */       
} srv_imps_contact_list_struct;

/* structure for a chat room */
typedef struct
{
    CHAR  room_id[IMPS_MAX_ID_LEN];                 /* room id, for single chat, it's contact id */
    WCHAR room_name[IMPS_MAX_NAME_LEN];             /* name of the chat room */
    WCHAR room_topic[IMPS_MAX_NAME_LEN];            /* topic of the chat room */
    WCHAR welcome[IMPS_MAX_NOTE_LEN];               /* welcome text of the chat room */
    WCHAR sname[IMPS_MAX_NAME_LEN];                 /* screen name of the user in the chat room */    	
    srv_imps_room_type_enum type;                   /* type of chat room (single talk or chat) */    
    U8 pri_level;                                   /* privilege level of the user */    
    MMI_BOOL is_inviting;
} srv_imps_room_prop_struct;

/* structure for message information stored in file */
typedef struct
{
    WCHAR sender_id[IMPS_MAX_ID_LEN];               /* sender, it maybe use nickname, alias or id*/
    MYTIME msg_time;                                /* the time send message or receive message */ 
    WCHAR *content;                                 /* message content */
} srv_imps_message_struct;

/* structure for contact presence */
typedef struct
{    
    WCHAR alias[IMPS_MAX_NAME_LEN];                     /* alias */
    WCHAR status_text[IMPS_MAX_PA_STATUS_TEXT_LEN];     /* text of profile */    
    U8 online_status;                                   /* status of user */    
    U8 availability;                                    /* availability */
    U8 mood;                                            /* mood of user */   
    U8 device_type;                                     /* device type */
} srv_imps_presence_struct;

/* Structure of public profile */
typedef struct
{    
    CHAR  country_code[3];                              /* country code:ISO3166-1*/
    S32   gender;                                       /* Gender */ 
    S32   marital_status;                               /* Marital status */
    WCHAR city[IMPS_MAX_CITY_NAME_LEN];                 /* City */
    WCHAR free_text[IMPS_MAX_FREE_TEXT_LEN];            /* Free text */
    WCHAR intention[IMPS_MAX_INTENTION_LEN];            /* Intention */
    WCHAR hobbies[IMPS_MAX_HOBBY_LEN];                  /* Hobbies */
    WCHAR fname[IMPS_MAX_FRIENDLY_NAME_LEN];            /* Friendly name */      
    WCHAR year_buff[5];                                   /* year buffer */
    WCHAR month_buff[3];                                   /* month buffer */
    WCHAR day_buff[3];                                     /* day buffer */
} srv_imps_public_profile_struct;

/* structure of login request, it is for SRV_IMPS_EVENT_LOGIN */
typedef struct
{   
    CHAR *server;                  /* address of server */
    CHAR *username;                /* user name */
    CHAR *passwd;                  /* password */
    U8 proxy_ip[4];                /* address of proxy server */
    U16 proxy_port;                /* port number */
    CHAR *proxy_username;          /* username */
    CHAR *proxy_passwd;            /* password */
    CHAR *auth_usrn;               /* http auth username */
    CHAR *auth_pwd;                /* http auth password */
    U8 conn_type;                  /* WAP or HTTP */
    U32 dt_acct;                   /* data account */
    MMI_BOOL use_proxy;            /* use proxy or not */
    U8 login_mode;                 /* normal or security */
    U32 timeout;                   /* the value of timeout */
} srv_imps_login_req_struct;

typedef struct 
{
    S32 result;                              /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;              /* detail description for fail reason*/
    CHAR *imps_usrn;
    CHAR *imps_pwd;
} srv_imps_login_rsp_struct;

/* structure of login response, it is for SRV_IMPS_EVENT_LOGIN */
typedef struct 
{
    S32 result;                              /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;              /* detail description for fail reason*/
    imps_not_agreed_services_struct *not_agreed_serv; 
    imps_csp_version_enum imps_version;
    MMI_BOOL not_agreed_all;
} srv_imps_service_capability_ind_struct;

/* structure for disconnect indication, it is for SRV_IMPS_EVENT_DISCONNECT_IND */
typedef struct 
{
    S32 result;                              /* response result value, refer to imps_result_error_enum */
    CHAR *disconnect_reason;
} srv_imps_disconnect_ind_struct;

/* structure for invite group request, it is for SRV_IMPS_EVENT_INVITE */
typedef struct 
{    
    U32 cont_index;
    U32 room_index;                         /* the room index for invite */
    WCHAR *invite_note;                     /* text note for invitation */ 
    WCHAR *sname;
} srv_imps_invite_group_req_struct;

/* structure for invite group response, it is for SRV_IMPS_EVENT_INVITE */
typedef struct 
{    
    S32 result;                             /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;             /* detail description for fail reason*/  
    U32 room_index;                         /* the room index for invite */
    WCHAR recipient_id[IMPS_MAX_ID_LEN];
} srv_imps_invite_group_rsp_struct;

/* struct for invite presence request */
typedef struct 
{    
    imps_sender_struct *recipient;          /* the user who receive invitation */   
    WCHAR *invite_note;                     /* text note for invitation */ 
} srv_imps_invite_presence_req_struct;

/* struct for invite response indication */
typedef struct 
{    
    S32 result;
    imps_detail_struct *detail;             /* detail description for fail reason*/
    imps_entity_struct *sender;    
    WCHAR *response_note;
    MMI_BOOL acceptance;
    U32 room_index;
    WCHAR recipient_id[IMPS_MAX_ID_LEN];
} srv_imps_invite_response_ind_struct;

/* struct for invite reply request */
typedef struct
{
    MMI_BOOL acceptance;                    /* indicate whether user accept the invitation */    
    WCHAR *self_sname;                      /* screen name */    
} srv_imps_invite_reply_req_struct;

/* struct for invite reply response */
typedef struct 
{
    S32 result;                              /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;              /* detail description for fail reason*/
    MMI_BOOL acceptance;
    U32 room_index;
    imps_entity_list_info_struct *joined_users_list;    
    WCHAR *welcome_text;
} srv_imps_invite_reply_rsp_struct;

/* struct for extend conversation request */
typedef srv_imps_invite_group_req_struct srv_imps_ext_conv_req_struct;
/* struct for extend conversation response */
typedef srv_imps_invite_group_rsp_struct srv_imps_ext_conv_rsp_struct;

/* struct for extend conversation indication */
typedef struct
{
    S32 result;                              /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;              /* detail description for fail reason*/
    U32 room_index;    
    WCHAR *response_note;
    WCHAR *recipient_id;
} srv_imps_ext_conv_ind_struct;

/* struct for search contact request */
typedef struct 
{    
    U8 search_limit;                      /* the maximum number of search */
    S32 gender;                           /* Gender */
    S32 user_onlinestatus;                /* User on-line status */
    S32 marital_status;                   /* Marital status */    
    WCHAR *user_alias;                    /* User alias */
    WCHAR *user_emailaddr;                /* User email address */
    WCHAR *user_firstname;                /* User first name */
    WCHAR *user_id;                       /* User ID */
    WCHAR *user_lastname;                 /* User last name */
    WCHAR *user_mobile_number;            /* User mobile number */
    WCHAR user_max_age[3];                /* Maximum of user's age. [v13] */
    WCHAR user_min_age[3];                /* Minimum of user's age */
    WCHAR *fname;                         /* Friendly name */
    WCHAR *city;                          /* City */    
    WCHAR *intention;                     /* Intention */
    WCHAR *hobbies;                       /* Hobbies */
    WCHAR country_code[3];                /* country code, ISO3166-1*/    
} srv_imps_search_cont_req_struct;

/* struct for search group request */
typedef struct 
{    
    U8 search_limit;                        /* the maximum number of search */
    WCHAR *group_id;                        /* Indicate the group */
    WCHAR *group_name;                      /* group name */
    WCHAR *group_topic;                     /* group topic */
    WCHAR *group_joined;                    /* the id of user joined the group */
    WCHAR *group_owner;                     /* the id of user who is the owner of group */
    WCHAR *group_autojoin;                  /* the id of user who is auto joined */
} srv_imps_search_group_req_struct;

/* struct for search response */
typedef struct 
{
    S32 result;                         /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;         /* detail description for fail reason*/
    U8 search_count;                    /* the count of search result */    
} srv_imps_search_rsp_struct;

typedef struct
{
    U8 notify_type;                     /* notify type */
    WCHAR *content;                     /* off-line content */
} srv_imps_offline_message_ind_struct;

/* struct for new message indication */
typedef struct
{    
    S32 result;
    imps_detail_struct *detail;
    U32 room_index;
    imps_message_info_struct *message_info;     /* message information */
    U8 use_file;                                /* if message data saved in file */
    WCHAR *message_content;                     /* message data */
} srv_imps_newmessage_ind_struct;

/* struct for get message request */
typedef struct
{    
    S32 app_hd;
    CHAR *id;                                     /* identifier of message to get */
} srv_imps_get_message_req_struct;

/* request struct for rejecting message */
typedef srv_imps_get_message_req_struct srv_imps_reject_message_req_struct;

/* response struct for get message */
typedef srv_imps_newmessage_ind_struct srv_imps_get_message_rsp_struct;

/* request struct for forwarding message */
typedef struct 
{
    CHAR *message_id;    
    imps_entity_struct *recipient;
} srv_imps_forward_message_req_struct;

/* response struct for forward message */
typedef struct
{
    S32 result;                             /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;             /* detail description for fail reason*/    
    CHAR *message_id;
} srv_imps_forward_message_rsp_struct;

typedef struct
{    
    U32 room_index;                         /* identifier the message */
    MMI_BOOL delivery_report_require;       /* indicate whether need report */
    MMI_BOOL is_font_p;                     /* indicate whether it need to specify font */
    imps_font_struct *font;                 /* font information */
    U8 send_msg_type;        
    WCHAR *recipient_sname;                 /* it used for private chat in group */
    WCHAR *message_content;                 /* the content of instant message */
    WCHAR *orig_path;                       /* for file resized case, record file original path before resized */
} srv_imps_send_message_req_struct;

/* response struct for sending message */
typedef struct 
{
    S32 result;                             /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;             /* detail description for fail reason*/
    U32 room_index;
    WCHAR *message_content;
} srv_imps_send_message_rsp_struct;

/* request struct for block entity */
typedef struct 
{    
    U32 cont_index;
    MMI_BOOL is_block;
} srv_imps_block_entity_req_struct;


typedef struct
{        
    WCHAR *sname;
    U8  access_type;    
    U8  searchable;    
    WCHAR  *name;
    WCHAR  *topic;
    WCHAR  *welcome_note;    
} srv_imps_create_group_req_struct;

typedef struct  
{
    S32 result;                         /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;         /* detail description for fail reason*/
    U32 room_index;
} srv_imps_create_group_rsp_struct;

/* struct for join group request */
typedef struct
{    
    MMI_BOOL user_show_id;       
    CHAR *group_id;
    WCHAR *sname; 
} srv_imps_join_group_req_struct;

/* response struct for joining group */
typedef struct 
{
    S32 result;                         /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;         /* detail description for fail reason*/
    U32 room_index;
    imps_entity_list_info_struct *joined_users_list;    
    WCHAR *welcome_text;
} srv_imps_join_group_rsp_struct;

/* struct for indication that group is closed */
typedef struct
{
    S32 result;                         /* response result value, refer to imps_result_error_enum */ 
    imps_detail_struct detail;          /* detail description for fail reason*/   
    CHAR leave_reason[IMPS_MAX_NOTE_LEN];
    U32 room_index;    
} srv_imps_leave_group_ind_struct;

/* struct for indication that group properties changed */
typedef struct
{
    U32 room_index;
    imps_entity_list_info_struct *joined_user_list;    
    imps_entity_list_info_struct  *left_user_list; 
    imps_entity_list_info_struct *joined_blocked_user_list;
    imps_entity_list_info_struct  *left_blocked_user_list; 
} srv_imps_group_change_notify_ind_struct;

typedef struct
{    
    WCHAR *name;     
    imps_entity_list_struct *user_nick_list;    
    MMI_BOOL authorize_pa_p;
    U32 authorize_pa;    
} srv_imps_add_contact_list_req_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    U32 contact_list_index;                 /* indicate the contact list */
    MMI_BOOL display_name_p;                /* indicate whether there is group name */
    WCHAR *display_name;                    /* text of group name */        
    MMI_BOOL authorize_pa_p;                /* indicate whether use authorization */
    U32 authorize_pa;                       /* indicate the value of authorization */    
} srv_imps_edit_contact_list_req_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    S32 result;
    CHAR contact_list_id[IMPS_MAX_ID_LEN];    /* indicate the contact list */
} srv_imps_cont_update_ind_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    S32 result;
    U32 cont_list_index;                    /* indicate the contact list, 0 is for all contact list */
} srv_imps_cont_list_update_ind_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    U32 cont_list_index;                    /* indicate the contact list */
    CHAR *cont_id;
    WCHAR *nick_name;    
} srv_imps_add_contact_req_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    S32 result;                             /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;             /* detail description for fail reason*/
    U32 index;
} srv_imps_add_contact_rsp_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    S32 result;                             /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;             /* detail description for fail reason*/
    MMI_BOOL acceptance;
    WCHAR recipient_id[IMPS_MAX_ID_LEN];
} srv_imps_add_contact_invite_pr_struct;


/* request struct for MMI to edit contact list information */
typedef struct
{    
    U32 cont_index;
    WCHAR *nick_name;    
} srv_imps_edit_contact_req_struct;

/* request struct for deleting contact */
typedef struct
{
    U32 contact_list_index;                 /* indicate the contact list */
    imps_entity_list_struct *user_nick_list;
} srv_imps_del_contact_req_struct;

/* request struct for MMI to edit contact list information */
typedef struct
{
    U32 to_cont_list_index;                 /* indicate the contact list of contact moved to */
    U32 cont_index;    
} srv_imps_move_contact_req_struct;

/* request struct for subscribing presence */
typedef struct
{
    imps_subscribe_entity_list_struct id_list;  /* the list of users for subscribing presence */
    U32 subscribe_pa;                           /* the value of presence to be subscribed */
} srv_imps_subs_pa_req_struct;

/* request struct for getting users presence */
typedef struct
{
    U8 online_status_qualifier;         /* online status qualifier */
    U8 online_status;                   /* online status value */
    U8 user_availability_qualifier;     /* availability qualifier */
    U8 user_availability;               /* availability value */
    U8 alias_qualifier;
    WCHAR *alias;
    MMI_BOOL is_pic_changed;
    WCHAR *pic_file_name;
    U8 status_text_qualifier;           /* status text qualifier */
    WCHAR *status_text;                 /* status text value */
    U8 status_mood_qualifier;           /* mood qualifier */
    U8 status_mood;                     /* mood value */    
} srv_imps_update_pa_req_struct;

/* request struct for getting users presence */
typedef struct
{
    imps_get_pa_entity_list_struct *user_id_list;       /* list of users */
    U32 attr_list;      /* list of presence attributes. An empty or missing list
                           indicates all available presence attributes are desired */
} srv_imps_get_pa_req_struct;

/* request struct for creating attribute list */
typedef struct
{
    MMI_BOOL is_default;                    /* indicate whether it is used as default attribute list */
    U32 attr_list;                          /* the value of attribute list */
    imps_entity_list_struct *user_id_list;  /* list of users whom attribute value is for */
} srv_imps_create_attribute_list_req_struct;

typedef struct
{
    S32 result;                             /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;             /* detail description for fail reason*/
    srv_imps_presence_struct pa;
} srv_imps_get_contact_pa_rsp_struct;

/* request struct for MMI to get watcher list */
typedef struct
{
    MMI_BOOL history_period_p;      /* Indicates whether the hisory period is used or not */
    U32 history_period;             /* Indicates the time period in seconds on the 
                                       longest possible history of the watcher (from 
                                       the time of request) that SHOULD be returned.
                                       In case of absence, it indicates the user request
                                       the watcher list at the time of the request only.
                                       The value 0 MUST NOT be used. */
    MMI_BOOL max_watcher_list_p;    /* Indicates whether the maximum watcher list is used or not */
    U32 max_watcher_list;           /*Indicates the maximum number of Watcher elements in response*/
} srv_imps_get_watcher_list_req_struct;

/* struct for getting watch list response */
typedef struct
{
    S32 result;
    imps_detail_struct *detail;     /* detail description for fail reason*/   
    MMI_BOOL history_period_p;      /* Indicate whether use history period */
    U32 history_period;
    U32 count;
} srv_imps_get_watcher_list_rsp_struct;

/* struct for presence authorization */
typedef struct
{
    MMI_BOOL is_accept;
    CHAR *user_id;
} srv_imps_presence_auth_user_struct;

/* struct for presence authorization indication */
typedef struct
{
	imps_entity_list_struct* id_list; 
    U32 attr_list;
    MMI_BOOL is_default;            /* indicate whether it is used as default attribute list */
} srv_imps_create_attributelist_req_struct;

/* response struct for retrieving group member list of specific group */
typedef struct 
{
    S32 result;                     /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;     /* detail description for fail reason*/   
    U32 adm_num;
    U32 mod_num;
    U32 user_num;    
} srv_imps_get_group_member_rsp_struct;

/* response struct for retrieving joined user list of specific group */
typedef struct
{
    S32 result;                     /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;     /* detail description for fail reason*/   
    U32 adm_num;
    U32 mod_num;
    U32 user_num;
    U32 blocked_num;
} srv_imps_get_joined_user_rsp_struct;

/* response struct for retrieving joined user list of specific group */
typedef struct
{
    S32 result;                     /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;     /* detail description for fail reason*/   
    U32 user_num;    
} srv_imps_get_rejected_user_rsp_struct;

/* request struct for adding member to specific group */
typedef struct
{
    U32 room_index;
    CHAR *user_id;    
} srv_imps_add_group_member_req_struct;

/* request struct for removing member from specific group */
typedef struct
{
    U32 room_index;
    U32 entity_member_index;
} srv_imps_remove_group_member_req_struct;

/* request struct for change group user privilege */
typedef struct
{
    U32 room_index;
    imps_pri_level_enum pri_level;       /* Indicate the privilege level of users */
    U32 entity_member_index;
} srv_imps_member_access_req_struct;

/* request struct for modifying group rejected user list, it may add user to rejected user list 
   or delete user from rejected user list */
typedef struct
{
    U32 room_index;
    MMI_BOOL is_add;                     /* Indicate whether add user to rejected list or not */
    U32 entity_member_index;
} srv_imps_reject_group_user_req_struct;

/* response struct for modifying group rejected user list, it may add user to rejected user list 
   or delete user from rejected user list */
typedef struct 
{
    S32 result;                          /* response result value, refer to imps_result_error_enum */
    imps_detail_struct detail;          /* detail description for fail reason*/   
    imps_entity_list_info_struct user_list;   
} srv_imps_reject_group_user_rsp_struct;

/* request struct for user to reply system message */
typedef struct 
{    
    U32 chosen_option;                          /* Indicate the option value of user choose */
    WCHAR verification_key[IMPS_MAX_URL_LEN];   /* Text string provided by the user in response to the notification */ 
} srv_imps_system_message_user_req_struct;

/* response struct for user to reply system message */
typedef struct 
{
    S32 result;                           /* response result value, refer to imps_result_error_enum */
    imps_detail_struct detail;            /* detail description for fail reason*/   
    CHAR  sm_id[IMPS_MAX_SM_ID_LEN];      /* Indicate the id of system message that user reply */
} srv_imps_system_message_user_rsp_struct;

/* notification indication struct when user subscribed event occur */
typedef struct
{
    imps_notification_type_enum notif_type;         /* Indicate the type of notification */
    imps_notification_element_union notif_element;  /* Indicate the value of event notification */
} srv_imps_notify_ind_struct;

/* response struct for MMI to get user's public profile */
typedef struct
{/*size:1013 bytes*/
    S32 result;                                 /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;                 /* detail description for fail reason*/
    srv_imps_public_profile_struct user_pp;     /* The public profiles value for specific user */
} srv_imps_get_pp_rsp_struct;

/* request struct for MMI to update public profile */
typedef struct
{
    MMI_BOOL    clear_pp;               /* Indicates whether the public profile is cleared or not */
    MMI_BOOL    user_pp_p;              /* Indicates whether the user_pp is used or not */ 
    imps_public_profile_struct user_pp; /* The public profile fields to be updated for the requesting user */
} srv_imps_update_pp_req_struct;

/* to download file from specific URL, MMI task send request to IMPS task */
typedef struct
{
    CHAR  content_url[IMPS_MAX_URL_LEN];        /* URL address for downloading file */
    WCHAR store_path[IMPS_MAX_FILE_PATH_LEN];   /* path for storing file downloaded */  
} srv_imps_dl_file_req_struct;

/* structure for replying http authorization indication */
typedef struct
{
    WCHAR *username;     
    WCHAR *password;   
} srv_imps_http_auth_res_struct;

/* response result struct */
typedef struct 
{
    S32 result;                         /* response result value, refer to imps_result_error_enum */
    imps_detail_struct *detail;         /* detail description for fail reason*/   
} srv_imps_rsp_result_struct;

/* response struct for MMI task to download file from specific URL */
typedef srv_imps_rsp_result_struct srv_imps_dl_file_rsp_struct;

/* response struct for MMI to update public profile */
typedef srv_imps_rsp_result_struct srv_imps_update_pp_rsp_struct;

/* response struct for MMI to unsubscribe some notification from server */
typedef srv_imps_rsp_result_struct srv_imps_unsubs_notify_rsp_struct;

/* response struct for MMI to subscribe some event notification from server */
typedef srv_imps_rsp_result_struct srv_imps_subs_notify_rsp_struct;

/* response struct for modifying group user privilege */
typedef srv_imps_rsp_result_struct srv_imps_member_access_rsp_struct;

/* response struct for removing member from specific group */
typedef srv_imps_rsp_result_struct srv_imps_remove_group_member_rsp_struct;

/* response struct for adding member to specific group */
typedef srv_imps_rsp_result_struct srv_imps_add_group_member_rsp_struct;

/* response struct for leave group */
typedef srv_imps_rsp_result_struct srv_imps_leave_group_rsp_struct;

/* response struct for delete group */
typedef srv_imps_rsp_result_struct srv_imps_delete_group_rsp_struct;

/* response struct for updating presence */
typedef srv_imps_rsp_result_struct srv_imps_update_pa_rsp_struct;

/* response struct for creating attribute list */
typedef srv_imps_rsp_result_struct srv_imps_create_attribute_list_rsp_struct;

/* response struct for unsubscibing presence */
typedef srv_imps_rsp_result_struct srv_imps_unsubs_pa_rsp_struct;

/* response struct for subscibing presence */
typedef srv_imps_rsp_result_struct srv_imps_subs_pa_rsp_struct;

/* response struct for deleting contact */
typedef srv_imps_rsp_result_struct srv_imps_del_contact_rsp_struct;

/* response struct for deleting contact list */
typedef srv_imps_rsp_result_struct srv_imps_del_contact_list_rsp_struct;

/* response struct for editing contact list */
typedef srv_imps_rsp_result_struct srv_imps_edit_contact_list_rsp_struct;

/* response struct for add contact list */
typedef srv_imps_rsp_result_struct srv_imps_add_contact_list_rsp_struct;

/* response struct for block entity */
typedef srv_imps_rsp_result_struct srv_imps_block_entity_rsp_struct;

/* response struct for rejecting message */
typedef srv_imps_rsp_result_struct srv_imps_reject_message_rsp_struct;

/* struct for setting delivery method */
typedef srv_imps_rsp_result_struct srv_imps_delivery_method_rsp_struct;

/* struct for logout response */
typedef srv_imps_rsp_result_struct srv_imps_logout_rsp_struct;

/* event function:  app use this function to handle the event from service */
typedef void (*srv_imps_event_callback_ptr)(
                 U16 id,                /* the index of notification */                  
                 void *data);           /* notification data */

/*****************************************************************************
 * FUNCTION
 *  srv_imps_main_evt_hdlr 
 * DESCRIPTION
 *  IMPS service external event handler.
 * PARAMETERS
 *   event 
 * RETURNS
 *   return
 *****************************************************************************/
mmi_ret srv_imps_main_evt_hdlr(mmi_event_struct *event);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_open 
 * DESCRIPTION
 *  APP that want to use IMPS service should call this function to get app 
 *  handler, this handler will be used for event between app and service  
 * PARAMETERS
 *  void
 * RETURNS
 *   if there is free handler slot, return handler, otherwise return -1.
 *****************************************************************************/
extern S32 srv_imps_open(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_close 
 * DESCRIPTION
 *  APP should close handler when not need used. refer to srv_imps_open.
 * PARAMETERS
 *  the handler need to be closed.
 * RETURNS
 *   void.
 *****************************************************************************/
extern void srv_imps_close(S32 hd);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_reg_event_callback 
 * DESCRIPTION
 *  APP should register callback function to handle the result of event.
 * PARAMETERS
 *  hd          [IN]        handler to identify app
 *  handle      [IN]        the callback function to registered
 * RETURNS
 *   return the result of register.
 *****************************************************************************/
extern srv_imps_result_enum srv_imps_reg_event_callback(S32 hd, srv_imps_event_callback_ptr handle);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_handle_event
 * DESCRIPTION
 *  the function used for app need service to handle event
 * PARAMETERS
 *  hd              [IN]        app handler
 *  event_id        [IN]        event to handle
 *  user_data       [?]         user data for this event
 * RETURNS
 *  return result of event handle.
 *****************************************************************************/
extern S32 srv_imps_handle_event(S32 hd, U16 event_id, void *user_data);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_init_nvram
 * DESCRIPTION
 *  set protocol handler before service init to avoid missing primitive
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_init_nvram(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_init
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_init(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_notify_idle_reached
 * DESCRIPTION
 *  Notify IDLE screen is reached
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_notify_idle_reached(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_notify_rac_ready
 * DESCRIPTION
 *  Function to indicate that the RAC is ready
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_notify_rac_ready(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_status
 * DESCRIPTION
 *  get IMPS service status, refer to srv_imps_status_enum
 * PARAMETERS
 *  void
 * RETURNS
 *  return the status of service
 *****************************************************************************/
extern U16 srv_imps_get_status(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_current_event
 * DESCRIPTION
 *  get app current event
 * PARAMETERS
 *  hd        [IN]       app handler
 * RETURNS
 *  return event id
 *****************************************************************************/
extern S32 srv_imps_get_current_event(S32 hd);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_event_exist
 * DESCRIPTION
 *  judge whether some event exist or not
 * PARAMETERS
 *  hd              [IN]       app handler
 *  event_id        [IN]       event_id
 * RETURNS
 *  if event exist, return MMI_TRUE, otherwise return MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_event_exist(S32 hd, U32 event_id);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_app_idle
 * DESCRIPTION
 *  judge whether some app is idle
 * PARAMETERS
 *  hd              [IN]       app handler
 * RETURNS
 *  if app is idle, return MMI_TRUE, otherwise return MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_app_idle(S32 hd);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_login_ready
 * DESCRIPTION
 *  function used for identify whether the app can login already.
 * PARAMETERS
 *  hd          [IN]       app handler 
 * RETURNS
 *  if app reach login condition, return MMI_TRUE, otherwise return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_login_ready(S32 hd);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_contact_list_is_full
 * DESCRIPTION
 *  function used identify whether contact list is full
 * PARAMETERS
 *  void
 * RETURNS
 *  if there is no free contact list to use, return MMI_TRUE, otherwise return
 *  MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_contact_list_is_full(void);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_pa
 * DESCRIPTION
 *  Get contact presence information
 * PARAMETERS
 *  cont_index      [IN]     contact index    
 *  pa              [OUT]    buffer to store pa information         
  * RETURNS
 *  if get successfully, return MMI_TRUE, otherwise return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_contact_pa(srv_imps_presence_struct *pa, U32 cont_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_pp
 * DESCRIPTION
 *  Get contact's pp.
 * PARAMETERS
 *  user_pp         [OUT]         buffer to store detail information
 *  cont_index      [IN]          the index of contact
 * RETURNS
 *  if get successfully, return MMI_TRUE, otherwise return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_contact_pp(srv_imps_public_profile_struct *user_pp, U32 cont_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_myself_pp
 * DESCRIPTION
 *  Get my public profile.
 * PARAMETERS
 *  pp         [OUT]         buffer to store detail information
 * RETURNS
 *  if get successfully, return MMI_TRUE, otherwise return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_myself_pp(srv_imps_public_profile_struct *pp);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_list_num
 * DESCRIPTION
 *  function used to get contact list number
 * PARAMETERS
 *  void
 * RETURNS
 *  return contact list number
 *****************************************************************************/
extern U32 srv_imps_get_contact_list_num(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_list_info
 * DESCRIPTION
 *  function used to get contact list detail information
 * PARAMETERS
 *  buff        [IN/OUT]    buffer store contact list information
 *  index       [IN]        contact list index
 * RETURNS
 *  return result of get contact list information
 *****************************************************************************/
extern S32 srv_imps_get_contact_list_info(srv_imps_contact_list_struct *buff, U32 index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_num
 * DESCRIPTION
 *  function used to get contact number
 * PARAMETERS
 *  void
 * RETURNS
 *  return contact number
 *****************************************************************************/
extern U32 srv_imps_get_contact_num(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_info
 * DESCRIPTION
 *  function used to get contact detail information
 * PARAMETERS
 *  buff        [IN/OUT]    buffer store contact information
 *  index       [IN]        contact index
 * RETURNS
 *  return result of get contact information
 *****************************************************************************/
extern S32 srv_imps_get_contact_info(srv_imps_contact_struct *cont, U32 index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_info
 * DESCRIPTION
 *  function used to get contact detail information
 * PARAMETERS
 *  index                   [IN]        contact index
 *  online_status           [IN/OUT]    contact online status
 *  availability            [IN/OUT]    contact availability
 * RETURNS
 *  return result of get contact availability
 *****************************************************************************/
S32 srv_imps_get_contact_availability(U32 index, U8 *online_status, U8 *availability);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_img_path
 * DESCRIPTION
 *  Get the path to store image
 * PARAMETERS
 *  dest        [OUT]       Buffer to store result
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_get_contact_img_path(WCHAR *dest, U32 cont_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_num_in_contact_list
 * DESCRIPTION
 *  get contact number in one contact list 
 * PARAMETERS
 *  cont_list_index     [IN]        contact list index
 * RETURNS
 *  return contact number
 *****************************************************************************/
extern U32 srv_imps_get_contact_num_in_contact_list(U32 cont_list_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_list_index
 * DESCRIPTION
 *  get index of contact list .
 * PARAMETERS
 *  hd          [IN]        app handler, use it to know contact sort type
 *  buff        [IN/OUT]    store the contact list index
 *  count       [IN]        number of contact list index to get
 * RETURNS
 *  return the number of get contact list index.
 *****************************************************************************/
extern U32 srv_imps_get_contact_list_index(S32 hd, U32 *buff, U32 count);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_index
 * DESCRIPTION
 *  function used to get index of contact belonged one contact 
 * PARAMETERS
 *  hd                  [IN]        app handler, use it to know contact sort type
 *  cont_list_index     [IN]        contact list index that contact belong
 *  buff                [IN/OUT]    store index of contact     
 *  count               [IN]        the number of get contact index
 * RETURNS
 *  return the number of get contact index
 *****************************************************************************/
extern U32 srv_imps_get_contact_index(S32 hd, U32 cont_list_index, U32 *buff, U32 count);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_all_contact_index
 * DESCRIPTION
 *  get all contact index
 * PARAMETERS
 *  hd          [IN]             app handler
 *  buff        [IN/OUT]         store contact index
 *  count       [IN]             number of contact to get index
 * RETURNS
 *  return the contact number
 *****************************************************************************/
extern U32 srv_imps_get_all_contact_index(S32 hd, U32 *buff, U32 count);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_online_contact_num
 * DESCRIPTION
 *  get number of online contact of one contact list
 * PARAMETERS
 *  cont_list_index     [IN]        
 * RETURNS
 *  return the online contact number
 *****************************************************************************/
extern U32 srv_imps_get_online_contact_num(U32 cont_list_index);

/*****************************************************************************
* FUNCTION
*  srv_imps_get_all_online_contact
* DESCRIPTION
*  get all online contact
* PARAMETERS
*  buff     [OUT]
*  count    [IN]        
* RETURNS
*  return the online contact number
*****************************************************************************/
extern U32 srv_imps_get_all_online_contact(U32 *buff, U32 count);

/*****************************************************************************
* FUNCTION
*  srv_imps_contact_is_online
* DESCRIPTION
*  check whether contact is online
* PARAMETERS
*  cont     [IN]
* RETURNS
*  if contact is online, return MMI_TRUE, otherwise return MMI_FALSE
*****************************************************************************/
extern MMI_BOOL srv_imps_contact_is_online(srv_imps_contact_struct *cont);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_set_contact_sort_type
 * DESCRIPTION
 *  set contact sort type, type value refer to srv_imps_cont_sort_type_enum
 * PARAMETERS
 *  hd      [IN] app handler
 *  type    [IN]    sort type
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_set_contact_sort_type(S32 hd, U8 type);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_index_from_room
 * DESCRIPTION
 *  get the index of contact according to room index, it used in single chat room
 * PARAMETERS
 *  room_index      [IN]        room index
 * RETURNS
 *  return contact index
 *****************************************************************************/
extern S32 srv_imps_get_contact_index_from_room(U32 room_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_room_index
 * DESCRIPTION
 * the function used for getting index of room for specified contact, it used
 * for single chat room
 * PARAMETERS
 *  cont_index      [IN]        
 * RETURNS
 *  return index of chat room
 *****************************************************************************/
extern U32 srv_imps_get_room_index(U32 cont_index);

extern S32 srv_imps_get_presence(srv_imps_presence_struct *buff);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_room_is_full
 * DESCRIPTION
 *  function used for check whether all room slots are used
 * PARAMETERS
 *  void
 * RETURNS
 *  if all chat rooms are used, return MMI_TRUE, otherwise return MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_room_is_full(void);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_single_room_exist
 * DESCRIPTION
 *  function used to check whether the room for specified contact is existed.
 * PARAMETERS
 *  cont_index      [IN]        
 * RETURNS
 *  if the room is existed, return MMI_TRUE, otherwise return MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_single_room_exist(U32 cont_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_create_room
 * DESCRIPTION
 *  create one room for specified contact according to contact index
 * PARAMETERS
 *  cont_index      [IN]        
 * RETURNS
 *  return room index
 *****************************************************************************/
extern U32 srv_imps_create_room(U32 cont_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_create_room_ex
 * DESCRIPTION
 *  create chat room according to contact id, it used for create single chat room.
 * PARAMETERS
 *  cont_id       [IN]     contact id to create room
 * RETURNS
 *  return room index 
 *****************************************************************************/
extern U32 srv_imps_create_room_ex(CHAR *cont_id);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_close_room
 * DESCRIPTION
 *  close room, release room resource, refer to srv_imps_create_room
 * PARAMETERS
 *  index       [IN]        room index
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_close_room(U32 index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_room_type
 * DESCRIPTION
 *  get room type
 * PARAMETERS
 *  index       [IN]        room index
 * RETURNS
 *  return room type
 *****************************************************************************/
extern S32 srv_imps_get_room_type(U32 room_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_room_info
 * DESCRIPTION
 *  get room detail information according to room index
 * PARAMETERS
 *  room_prop       [OUT]         store room detail information
 *  index           [IN]        room index
 * RETURNS
 *  if successfully, return MMI_TRUE, otherwise return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_room_info(srv_imps_room_prop_struct *room, U32 index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_chat_message_info
 * DESCRIPTION
 *  get chat message detail information 
 * PARAMETERS
 *  buff            [OUT]         store message detail information
 *  msg_index       [IN]        message index to get
 *  room_index      [IN]        room index
 * RETURNS
 *  if successfully, return message length, otherwise return -1
 *****************************************************************************/
extern S32 srv_imps_get_chat_message_info(srv_imps_message_struct *buff, U32 msg_index, U32 room_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_add_chat_message_info
 * DESCRIPTION
 *  get chat message detail information 
 * PARAMETERS
 *  buff            [OUT]       store message detail information
 *  room_index      [IN]        room index
 * RETURNS
 *  if successfully, return 0, otherwise return -1
 *****************************************************************************/
extern S32 srv_imps_add_chat_message_info(srv_imps_message_struct *msg, U32 room_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_save_chat_message_info
 * DESCRIPTION
 *  get chat message detail information 
 * PARAMETERS
 *  buff            [OUT]       store message detail information
 *  room_index      [IN]        room index
 * RETURNS
 *  if successfully, return 0, otherwise return -1
 *****************************************************************************/
extern MMI_BOOL srv_imps_save_chat_message_info(WCHAR *filepath, U32 room_index);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_message_notify
 * DESCRIPTION
 *  get message notify indication
 * PARAMETERS
 *  buff        [OUT]     store detail information of message notify indication
 * RETURNS
 *  if there is no message notify indication, return MMI_TRUE, otherwise return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_message_notify(imps_message_info_struct *buff);

/***************************************************************************
 * FUNCTION
 *  srv_imps_get_system_message_info
 * DESCRIPTION
 *  get system message detail information
 * PARAMETERS
 *  buffer     [IN]        the buffer to store system message information
 * RETURNS
 *  if there is system message information, return MMI_TRUE, otherwise, return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_system_message_info(imps_system_message_struct *buff);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_invitation_info
 * DESCRIPTION
 *  get group invitation information
 * PARAMETERS
 *  buff     [IN]        store invitation information
 * RETURNS
 *  if exist group invitation, return MMI_TRUE, otherwise MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_invitation_info(mmi_imps_invite_ind_struct *buff);

#define STRING_IMPS
/*****************************************************************************
 * FUNCTION
 *  srv_imps_string_copy_with_dot
 * DESCRIPTION
 *  Append three dots to the end of string
 * PARAMETERS
 *  source      [IN]            Source buffer.
 *  dest        [IN/OUT]        Destination buffer.
 *  max_len     [IN]            Max characters can be put in destination buffer , including NULL terminate
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_string_copy_with_dot(CHAR *source, CHAR *dest, S32 max_len);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_string_ansi_2_ucs2_menu
 * DESCRIPTION
 *  Generate menu item from ASCII string
 * PARAMETERS
 *  source      [IN]            Source buffer.
 *  dest        [IN/OUT]        Destination buffer.
 *  max_len     [IN]            Max characters can be put in destination buffer
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_string_ansi_2_ucs2_menu(CHAR *source, CHAR *dest, S32 max_len);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_char_tolower
 * DESCRIPTION
 *  Convert a charcater to lower case
 * PARAMETERS
 *  ch      [IN]        Charcater to be converted
 * RETURNS
 *  lower case character
 *****************************************************************************/
extern CHAR srv_imps_char_tolower(CHAR ch);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_strnicmp
 * DESCRIPTION
 *  Compare two string without case with maximum length
 * PARAMETERS
 *  src         [IN]        String pointer to be compared
 *  dest        [IN]        String pointer to be compared
 *  maxlen      [IN]        Lengh to be compared
 * RETURNS
 *  Ture if two string is identical, otherwise, false
 *****************************************************************************/
extern CHAR srv_imps_strnicmp(const CHAR *src, const CHAR *dest, S32 maxlen);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_stricmp
 * DESCRIPTION
 *  Compare two strings without case
 * PARAMETERS
 *  src         [IN]        String pointer to be compared
 *  dest        [IN]        String pointer to be compared
 * RETURNS
 *  Ture if two string is identical, otherwise, false
 *****************************************************************************/
extern CHAR srv_imps_stricmp(const CHAR *src, const CHAR *dest);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_server_addr_valid
 * DESCRIPTION
 *  Check if the input address string is allowable.
 * PARAMETERS
 *  name        [IN]        String of input
 * RETURNS
 *  TRUE if the username string follows spec; otherwise, FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_server_addr_valid(const CHAR *addr);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_id_same
 * DESCRIPTION
 *  Compare if two ids are identical (without wv:)
 * PARAMETERS
 *  id1     [IN]        Id to be compared
 *  id2     [IN]        Id to be compared
 * RETURNS
 *  TRUE if identical; otherwise, FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_id_same(const CHAR *id1, const CHAR *id2);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_contact_list_name_valid
 * DESCRIPTION
 *  Check if the input user name string is allowable.
 *  A user name can only contains string between ASCII 0x20 ~ 0x7E
 *  The plus (+) character can only be placed before numeric character
 * PARAMETERS
 *  name        [IN]        String of input
 * RETURNS
 *  TRUE if the username string follows spec; otherwise, FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_contact_list_name_valid(const WCHAR *name);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_username_valid
 * DESCRIPTION
 *  Check if the input user name string is allowable.
 *  A user name can only contains string between ASCII 0x20 ~ 0x7E
 *  The plus (+) character can only be placed before numeric character
 * PARAMETERS
 *  name        [IN]        String of input
 * RETURNS
 *  TRUE if the username string follows spec; otherwise, FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_is_username_valid(WCHAR *name);


/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_screen_name
 * DESCRIPTION
 *  get screen name for group, if there is freindly name, use it, else if
 *  there is alias, use it. otherwise use user_id;
 * PARAMETERS
 *  name        [IN/OUT]        Screen name.
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_get_screen_name(WCHAR *name);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_disp_name
 * DESCRIPTION
 *  get contact display name, if there is nickname, use it, else use userid
 * PARAMETERS
 *  name        [OUT]        buffer to store display name.
 *  cont_index  [IN]         contact index.
 *  size        [IN]         buffer size of name.
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_get_contact_disp_name(WCHAR *name, U32 cont_index, U32 size);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_disp_name_ex
 * DESCRIPTION
 *  get contact display name, if there is nickname, use it, else use userid
 * PARAMETERS
 *  name        [OUT]        buffer to store display name.
 *  cont        [IN]         contact information.
 *  size        [IN]         buffer size of name.
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_get_contact_disp_name_ex(WCHAR *name, srv_imps_contact_struct *cont, 
                                              U32 size);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_string_append_wv
 * DESCRIPTION
 *  Check if "wv:" string contains in the string.
 *  If not, append it.
 * PARAMETERS
 *  dest        [OUT]       Buffer to be checked andappended.
 *  max_len     [IN]        Max length of buffer
 * RETURNS
 *  TRUE if the username string follows spec; otherwise, FALSE.(?)(?)(?)(?)
 *****************************************************************************/
extern void srv_imps_string_append_wv(WCHAR *dest, S32 max_len);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_contact_exist
 * DESCRIPTION
 *  Check if the contact already exists in contact list
 * PARAMETERS
 *  id      [IN]        Id of the contact
 * RETURNS
 *  TRUE if the contact exists; otherwise, FALSE
 *****************************************************************************/
MMI_BOOL srv_imps_is_contact_exist(CHAR *id);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_contact_list_exist
 * DESCRIPTION
 *  Check if the contact list already exists
 * PARAMETERS
 *  id      [IN]        Id of the group
 * RETURNS
 *  TRUE if the group exists; otherwise, FALSE
 *****************************************************************************/
MMI_BOOL srv_imps_is_contact_list_exist(WCHAR *name);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_is_room_exist
 * DESCRIPTION
 *  Check if the user has already joined the chat room
 * PARAMETERS
 *  id      [IN]        Id of the chat room
 * RETURNS
 *  TRUE if the user has already joined the chat room; otherwise, FALSE
 *****************************************************************************/
MMI_BOOL srv_imps_is_room_exist(CHAR *id);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_filename_from_fileindex
 * DESCRIPTION
 *  Get filename from file index
 * PARAMETERS
 *   
 * RETURNS
 *  
 *****************************************************************************/
void srv_imps_get_filename_from_fileindex(U32 fileindex, U16 filetype, WCHAR* filename);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_work_path
 * DESCRIPTION
 *  Get path of working directory
 * PARAMETERS
 *  dest        [OUT]       Buffer to store result
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_get_work_path(WCHAR *dest);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_myself_img_path
 * DESCRIPTION
 *  Get the path to store image
 * PARAMETERS
 *  dest        [OUT]       Buffer to store result
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_imps_get_myself_img_path(WCHAR *dest);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_check_file_exist
 * DESCRIPTION
 *  Check if the file already exists.
 * PARAMETERS
 *  filePathName        [IN]        Full file path + name
 * RETURNS
 *  MMI_TRUE if exists, otherwise, MMI_FALSE.
 *****************************************************************************/
extern MMI_BOOL srv_imps_check_file_exist(WCHAR *filePathName);
    
/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_file_size
 * DESCRIPTION
 *  Get size of a file
 * PARAMETERS
 *  filePathPrt     [IN]     file path
 *  fileSizePtr     [OUT]    store file size 
 * RETURNS
 *  Error cause of file open
 *****************************************************************************/
extern S32 srv_imps_get_file_size(WCHAR *filePathPtr, S32 *fileSizePtr);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_resize_image
 * DESCRIPTION
 *  Resize image
 * PARAMETERS
 *  void
 * RETURNS
 *  1: resized. 0: no need to resize. negative: error!
 *****************************************************************************/
extern S32 srv_imps_resize_image(WCHAR *file, WCHAR *dest_file, U32 resize_w, U32 resize_h);

/*****************************************************************************
* FUNCTION
*  srv_imps_delete_group_file
* DESCRIPTION
*  delete file
* PARAMETERS
*  hd         [IN]       app handler
*  type       [IN]       type: srv_imps_group_entity_type_enum 
* RETURNS
*  void
*****************************************************************************/
void srv_imps_delete_group_file(U32 room_index, U16 type);

/*****************************************************************************
* FUNCTION
*  srv_imps_get_group_entity
* DESCRIPTION
*  get group entity information, after use entity, app should call srv_imps_delete_group_file
*  to delete file
* PARAMETERS
*  hd         [IN]         app handler
*  buff       [OUT]        buffer to store entity information
*  index      [IN]         the index of entity 
*  entity_type  [IN]       entity type: srv_imps_group_entity_type_enum 
* RETURNS
*  if successfully get entity, return MMI_TRUE, otherwise return MMI_FALSE.
*****************************************************************************/
MMI_BOOL srv_imps_get_group_entity(U32 room_index, imps_entity_struct *buff, U32 index, U16 entity_type);

/*****************************************************************************
* FUNCTION
*  srv_imps_get_search_entity
* DESCRIPTION
*  get search result entity information, after use entity, app should call srv_imps_delete_search_file
*  to delete file
* PARAMETERS
*  hd         [IN]         app handler
*  buff       [OUT]        buffer to store entity information
*  index      [IN]         the index of entity 
* RETURNS
*  if successfully get entity, return MMI_TRUE, otherwise return MMI_FALSE.
*****************************************************************************/
MMI_BOOL srv_imps_get_search_entity(S32 hd, imps_entity_struct *buff, U32 index);

/*****************************************************************************
* FUNCTION
*  srv_imps_delete_search_file
* DESCRIPTION
*  delete search result file
* PARAMETERS
*  hd         [IN]         app handler 
* RETURNS
*  void
*****************************************************************************/
extern void srv_imps_delete_search_file(S32 hd);


/*****************************************************************************
* FUNCTION
*  srv_imps_get_watcher_entity
* DESCRIPTION
*  get watcher list entity information, after use entity, app should call srv_imps_delete_watcher_file
*  to delete file
* PARAMETERS
*  hd         [IN]         app handler
*  buff       [OUT]        buffer to store entity information
*  index      [IN]         the index of entity 
* RETURNS
*  if successfully get entity, return MMI_TRUE, otherwise return MMI_FALSE.
*****************************************************************************/
MMI_BOOL srv_imps_get_watcher_entity(S32 hd, imps_watcher_entity_struct *buff, U32 index);

/*****************************************************************************
* FUNCTION
*  srv_imps_delete_watcher_file
* DESCRIPTION
*  delete watcher list file
* PARAMETERS
*  hd         [IN]         app handler 
* RETURNS
*  void
*****************************************************************************/
void srv_imps_delete_watcher_file(S32 hd);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_pa_auth
 * DESCRIPTION
 *  Get presence authorization information, when app receive SRV_IMPS_EVNET_PA_AUTH_IND
 *  it should call this function to get who want to get presence authorization
 *  if user agree to authorize presence, app can send SRV_IMPS_EVENT_ADD_CONT.
 * PARAMETERS
 *  user      [OUT]        buffer to store who want to get presence authorization
 * RETURNS
 *  if there is presence authorization, return MMI_TRUE; otherwise, return MMI_FALSE
 *****************************************************************************/
extern MMI_BOOL srv_imps_get_pa_auth(imps_entity_struct *user);

/*****************************************************************************
 * FUNCTION
 *  srv_imps_get_contact_index_from_id
 * DESCRIPTION
 *  Find out the index of contact
 * PARAMETERS
 *  contact_id      [IN]        Contact id 
 * RETURNS
 *  if contact doesn't existed, return -1, otherwise return contact index
 *****************************************************************************/
extern S32 srv_imps_get_contact_index_from_id(const CHAR *contact_id);

#endif