summaryrefslogtreecommitdiff
path: root/include/utils/MsgUtilFunction.h
blob: 2f8fa313095068a07b99fad3fc3ad6830c90c833 (plain)
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
/*
 * msg-service
 *
 * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/

#ifndef MSG_UTIL_FUNCTION_H
#define MSG_UTIL_FUNCTION_H


/*==================================================================================================
                                         INCLUDE FILES
==================================================================================================*/
#include "MsgStorageTypes.h"
#include "MsgSettingTypes.h"
#include "MsgFilterTypes.h"
#include "MsgInternalTypes.h"
#include "MsgCmdTypes.h"

/*==================================================================================================
					FUNCTION PROTOTYPES
==================================================================================================*/

// Encoders
int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest);

int MsgEncodeCountByMsgType(int MsgCount, char **ppDest);

int MsgEncodeRecipientList(MSG_RECIPIENTS_LIST_S *pRecipientList, char **ppDest);

int MsgEncodeMsgId(msg_message_id_t *pMsgId, char **ppDest);

int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo, char **ppDest);

int MsgEncodeMsgInfo(MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo, char **ppDest);

int MsgEncodeFolderViewList(msg_struct_list_s *pFolderViewList, char **ppDest);

int MsgEncodeFolderList(msg_struct_list_s *pFolderList, char **ppDest);

int MsgEncodeSetting(MSG_SETTING_S *pSetting, char **ppDest);

int MsgEncodeFilterList(msg_struct_list_s *pFilterList, char **ppDest);

int MsgEncodeFilterFlag(bool *pSetFlag, char **ppDest);

int MsgEncodeMsgType(MSG_MESSAGE_TYPE_S *pMsgType, char **ppDest);

int MsgEncodeThreadViewList(msg_struct_list_s *pThreadViewList, char **ppDest);

int MsgEncodeConversationViewList(msg_struct_list_s *pConvViewList, char **ppDest);

int MsgEncodeMsgGetContactCount(MSG_THREAD_COUNT_INFO_S *threadCountInfo, char **ppDest);

int MsgEncodeMemSize(unsigned int *memsize, char **ppDest);

int MsgEncodeSyncMLOperationData(int msgId, int extId, char **ppDest);

int MsgEncodeStorageChangeData(const msg_storage_change_type_t storageChangeType, const msg_id_list_s *pMsgIdList, char **ppDest);

int MsgEncodeReportStatus(MSG_REPORT_STATUS_INFO_S* pReportStatus, int count, char **ppDest);

int MsgEncodeThreadId(msg_thread_id_t *pThreadId, char **ppDest);

int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest);


// Decoders
void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId);

void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo);

void MsgDecodeMsgInfo(char *pSrc, MSG_MESSAGE_INFO_S *pMsgInfo,  MSG_SENDINGOPT_INFO_S* pSendOptInfo);

void MsgDecodeFolderViewList(char *pSrc, msg_struct_list_s *pFolderViewList);

void MsgDecodeRecipientList(char *pSrc, MSG_RECIPIENTS_LIST_S *pRecipientList);

void MsgDecodeFolderList(char *pSrc, msg_struct_list_s *pFolderList);

void MsgDecodeSetting(char *pSrc, MSG_SETTING_S *pSetting);

void MsgDecodeFilterList(char *pSrc, msg_struct_list_s *pFilterList);

void MsgDecodeFilterFlag(char *pSrc, bool *pSetFlag);

void MsgDecodeMsgType(char *pSrc, MSG_MESSAGE_TYPE_S* pMsgType);

void MsgDecodeContactCount(char *pSrc,  MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);

void MsgDecodeMemSize(char *pSrc, unsigned int *memsize);

void MsgDecodeReportStatus(char *pSrc,  msg_struct_list_s *report_list);

void MsgDecodeThreadId(char *pSrc, msg_thread_id_t *pThreadId);

void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo);


// Event Encoder
int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent);


int msg_verify_number(const char *raw, char *trimmed);

int msg_verify_email(const char *raw);

#endif // MSG_UTIL_FUNCTION_H