2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (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
8 * http://www.tizenopensource.org/license
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.
17 #ifndef MSG_UTIL_FUNCTION_H
18 #define MSG_UTIL_FUNCTION_H
21 /*==================================================================================================
23 ==================================================================================================*/
24 #include "MsgStorageTypes.h"
25 #include "MsgSettingTypes.h"
26 #include "MsgFilterTypes.h"
27 #include "MsgInternalTypes.h"
28 #include "MsgCmdTypes.h"
30 /*==================================================================================================
32 ==================================================================================================*/
35 int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest);
37 int MsgEncodeCountByMsgType(int MsgCount, char **ppDest);
39 int MsgEncodeRecipientList(MSG_RECIPIENTS_LIST_S *pRecipientList, char **ppDest);
41 int MsgEncodeMsgId(msg_message_id_t *pMsgId, char **ppDest);
43 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, char **ppDest);
45 int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char **ppDest);
47 int MsgEncodeFolderViewList(msg_struct_list_s *pFolderViewList, char **ppDest);
49 int MsgEncodeFolderList(msg_struct_list_s *pFolderList, char **ppDest);
51 int MsgEncodeSetting(MSG_SETTING_S *pSetting, char **ppDest);
53 int MsgEncodeFilterList(msg_struct_list_s *pFilterList, char **ppDest);
55 int MsgEncodeFilterFlag(bool *pSetFlag, char **ppDest);
57 int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest);
59 int MsgEncodeThreadViewList(msg_struct_list_s *pThreadViewList, char **ppDest);
61 int MsgEncodeConversationViewList(msg_struct_list_s *pConvViewList, char **ppDest);
63 int MsgEncodeMsgGetContactCount(MSG_THREAD_COUNT_INFO_S *threadCountInfo, char **ppDest);
65 int MsgEncodeMemSize(unsigned int *memsize, char **ppDest);
67 int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest);
69 int MsgEncodeStorageChangeData(const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList, char **ppDest);
71 int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, int count, char **ppDest);
73 int MsgEncodeThreadId(msg_thread_id_t *pThreadId, char **ppDest);
75 int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest);
79 void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId);
81 void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo);
83 void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo);
85 void MsgDecodeFolderViewList(char *pSrc, msg_struct_list_s *pFolderViewList);
87 void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList);
89 void MsgDecodeFolderList(char *pSrc, msg_struct_list_s *pFolderList);
91 void MsgDecodeSetting(char *pSrc, MSG_SETTING_S *pSetting);
93 void MsgDecodeFilterList(char *pSrc, msg_struct_list_s *pFilterList);
95 void MsgDecodeFilterFlag(char *pSrc, bool *pSetFlag);
97 void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType);
99 void MsgDecodeContactCount(char *pSrc, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
101 void MsgDecodeMemSize(char *pSrc, unsigned int *memsize);
103 void MsgDecodeReportStatus(char *pSrc, msg_struct_list_s *report_list);
105 void MsgDecodeThreadId(char *pSrc, msg_thread_id_t *pThreadId);
107 void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo);
111 int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent);
114 int msg_verify_number(const char *raw, char *trimmed);
116 int msg_verify_email(const char *raw);
118 #endif // MSG_UTIL_FUNCTION_H