update tizen source
[framework/messaging/msg-service.git] / include / utils / MsgUtilFunction.h
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #ifndef MSG_UTIL_FUNCTION_H
32 #define MSG_UTIL_FUNCTION_H
33
34
35 /*==================================================================================================
36                                          INCLUDE FILES
37 ==================================================================================================*/
38 #include "MsgStorageTypes.h"
39 #include "MsgSettingTypes.h"
40 #include "MsgInternalTypes.h"
41 #include "MsgCmdTypes.h"
42
43 /*==================================================================================================
44                                         FUNCTION PROTOTYPES
45 ==================================================================================================*/
46
47 // Encoders
48 int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest);
49
50 int MsgEncodeCountByMsgType(int MsgCount, char **ppDest);
51
52 int MsgEncodeRecipientList(MSG_RECIPIENTS_LIST_S *pRecipientList, char **ppDest);
53
54 int MsgEncodeMsgId(MSG_MESSAGE_ID_T *pMsgId, char **ppDest);
55
56 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, char **ppDest);
57
58 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo, char **ppDest);
59
60 int MsgEncodeFolderViewList(MSG_LIST_S *pFolderViewList, char **ppDest);
61
62 int MsgEncodeFolderList(MSG_FOLDER_LIST_S *pFolderList, char **ppDest);
63
64 int MsgEncodeSetting(MSG_SETTING_S *pSetting, char **ppDest);
65
66 int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest);
67
68 int MsgEncodeThreadViewList(MSG_THREAD_VIEW_LIST_S *pThreadViewList, char **ppDest);
69
70 int MsgEncodeConversationViewList(MSG_LIST_S *pConvViewList, char **ppDest);
71
72 int MsgEncodeMsgGetContactCount(MSG_THREAD_COUNT_INFO_S *threadCountInfo, char **ppDest);
73
74 int MsgEncodeMemSize(unsigned int *memsize, char **ppDest);
75
76 int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest);
77
78 int MsgEncodeStorageChangeData(const MSG_STORAGE_CHANGE_TYPE_T storageChangeType, const MSG_MSGID_LIST_S *pMsgIdList, char **ppDest);
79
80 int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, char **ppDest);
81
82
83 // Decoders
84 void MsgDecodeMsgId(char *pSrc, MSG_MESSAGE_ID_T *pMsgId);
85
86 void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo);
87
88 void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo);
89
90 void MsgDecodeFolderViewList(char *pSrc, MSG_LIST_S *pFolderViewList);
91
92 void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList);
93
94 void MsgDecodeFolderList(char *pSrc, MSG_FOLDER_LIST_S *pFolderList);
95
96 void MsgDecodeSetting(char *pSrc, MSG_SETTING_S *pSetting);
97
98 void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType);
99
100 void MsgDecodeThreadViewList(char *pSrc, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
101
102 void MsgDecodeConversationViewList(char *pSrc, MSG_LIST_S *pConvViewList);
103
104 void    MsgDecodeContactCount(char *pSrc,  MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
105
106 void MsgDecodeMemSize(char *pSrc, unsigned int *memsize);
107
108 void    MsgDecodeReportStatus(char *pSrc,  MSG_REPORT_STATUS_INFO_S *pReportStatus);
109
110
111 // Event Encoder
112 int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, MSG_ERROR_T MsgError, void **ppEvent);
113
114
115 #endif // MSG_UTIL_FUNCTION_H