Modify flora license version.
[platform/core/messaging/msg-service.git] / include / utils / MsgUtilFunction.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *    http://floralicense.org/license/
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef MSG_UTIL_FUNCTION_H
18 #define MSG_UTIL_FUNCTION_H
19
20
21 /*==================================================================================================
22                                          INCLUDE FILES
23 ==================================================================================================*/
24 #include "MsgStorageTypes.h"
25 #include "MsgSettingTypes.h"
26 #include "MsgFilterTypes.h"
27 #include "MsgInternalTypes.h"
28 #include "MsgCmdTypes.h"
29
30 /*==================================================================================================
31                                         FUNCTION PROTOTYPES
32 ==================================================================================================*/
33
34 // Encoders
35 int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest);
36
37 int MsgEncodeCountByMsgType(int MsgCount, char **ppDest);
38
39 int MsgEncodeRecipientList(MSG_RECIPIENTS_LIST_S *pRecipientList, char **ppDest);
40
41 int MsgEncodeMsgId(msg_message_id_t *pMsgId, char **ppDest);
42
43 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, char **ppDest);
44
45 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo, char **ppDest);
46
47 int MsgEncodeFolderViewList(msg_struct_list_s *pFolderViewList, char **ppDest);
48
49 int MsgEncodeFolderList(msg_struct_list_s *pFolderList, char **ppDest);
50
51 int MsgEncodeSetting(MSG_SETTING_S *pSetting, char **ppDest);
52
53 int MsgEncodeFilterList(msg_struct_list_s *pFilterList, char **ppDest);
54
55 int MsgEncodeFilterFlag(bool *pSetFlag, char **ppDest);
56
57 int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest);
58
59 int MsgEncodeThreadViewList(msg_struct_list_s *pThreadViewList, char **ppDest);
60
61 int MsgEncodeConversationViewList(msg_struct_list_s *pConvViewList, char **ppDest);
62
63 int MsgEncodeMsgGetContactCount(MSG_THREAD_COUNT_INFO_S *threadCountInfo, char **ppDest);
64
65 int MsgEncodeMemSize(unsigned int *memsize, char **ppDest);
66
67 int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest);
68
69 int MsgEncodeStorageChangeData(const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList, char **ppDest);
70
71 int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, int count, char **ppDest);
72
73 int MsgEncodeThreadId(msg_thread_id_t *pThreadId, char **ppDest);
74
75 int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest);
76
77
78 // Decoders
79 void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId);
80
81 void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo);
82
83 void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo);
84
85 void MsgDecodeFolderViewList(char *pSrc, msg_struct_list_s *pFolderViewList);
86
87 void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList);
88
89 void MsgDecodeFolderList(char *pSrc, msg_struct_list_s *pFolderList);
90
91 void MsgDecodeSetting(char *pSrc, MSG_SETTING_S *pSetting);
92
93 void MsgDecodeFilterList(char *pSrc, msg_struct_list_s *pFilterList);
94
95 void MsgDecodeFilterFlag(char *pSrc, bool *pSetFlag);
96
97 void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType);
98
99 void MsgDecodeContactCount(char *pSrc,  MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
100
101 void MsgDecodeMemSize(char *pSrc, unsigned int *memsize);
102
103 void MsgDecodeReportStatus(char *pSrc,  msg_struct_list_s *report_list);
104
105 void MsgDecodeThreadId(char *pSrc, msg_thread_id_t *pThreadId);
106
107 void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo);
108
109
110 // Event Encoder
111 int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent);
112
113
114 int msg_verify_number(const char *raw, char *trimmed);
115
116 int msg_verify_email(const char *raw);
117
118 #endif // MSG_UTIL_FUNCTION_H