3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
5 * This file is part of msg-service.
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>
14 * PROPRIETARY/CONFIDENTIAL
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.
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.
33 * @file MsgTestStorage.h
34 * @brief Defines storage test function of messaging framework
38 #ifndef MSG_TEST_STORAGE_H
39 #define MSG_TEST_STORAGE_H
42 * @section Introduction
43 * - Introduction : Overview on Messaging Storage Test Function
45 * - Program : Messaging Storage Test Function Reference
48 /*==================================================================================================
50 ==================================================================================================*/
55 * @ingroup MESSAGING_FRAMEWORK
56 * @defgroup MESSAGING_STORAGE_TEST_FUNCTION Messaging Storage Test Function
60 /*==================================================================================================
62 ==================================================================================================*/
64 /** @fn void MsgTestAddMessage(MSG_HANDLE_T hMsgHandle)
65 * @brief Tests MsgAddMessage.
66 * @param[in] hMsgHandle is Message handle. \n
68 void MsgTestAddMessage(MSG_HANDLE_T hMsgHandle);
71 /** @fn void MsgTestGetMessage(MSG_HANDLE_T hMsgHandle, int MsgId)
72 * @brief Tests MsgGetMessage.
73 * @param[in] hMsgHandle is Message handle. \n
74 * @param[in] MsgId is the ID of the message to be returned. \n
76 void MsgTestGetMessage(MSG_HANDLE_T hMsgHandle, int MsgId);
79 /** @fn void MsgTestGetMessageList(MSG_HANDLE_T hMsgHandle, int FolderId)
80 * @brief Tests MsgGetMsgCommInfoList.
81 * @param[in] hMsgHandle is Message handle. \n
82 * @param[in] FolderId is the ID of the folder to be returned. \n
84 void MsgTestGetMessageList(MSG_HANDLE_T hMsgHandle, int FolderId);
87 /** @fn void MsgTestUpdateMessage(MSG_HANDLE_T hMsgHandle, msg_message_t *pMsg)
88 * @brief Tests MsgUpdateMessage.
89 * @param[in] hMsgHandle is Message handle. \n
90 * @param[in] pMsg is a pointer to an msg_message_t structure. \n
92 void MsgTestUpdateMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg);
94 /** @fn void MsgTestUpdateMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId)
95 * @brief Tests MsgUpdateMessage.
96 * @param[in] hMsgHandle is Message handle. \n
97 * @param[in] pMsg is a pointer to an msg_message_t structure. \n
99 void MsgTestUpdateMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
101 /** @fn void MsgTestMoveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId)
102 * @brief Tests MsgMoveMessageToFolder.
103 * @param[in] hMsgHandle is Message handle. \n
104 * @param[in] MsgId is the ID of the message to be moved. \n
106 void MsgTestMoveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId);
109 /** @fn void MsgTestMoveStorageMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T storageId)
110 * @brief Tests MsgMoveMessageToStorage.
111 * @param[in] hMsgHandle is Message handle. \n
112 * @param[in] MsgId is the ID of the message to be moved. \n
113 * @param[in] storageId is the destination storage ID. \n
115 void MsgTestMoveStorageMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg);
118 /** @fn void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle)
119 * @brief Tests MsgAddFolder.
121 Pre-condition : The storage has to be properly setup and initialized. \n
122 The code below is to create folder.
124 void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle)
126 if (hMsgHandle == NULL)
128 MSG_DEBUG("Handle is NULL");
132 MSG_ERROR_T err = MSG_SUCCESS;
135 MSG_FOLDER_INFO_S folderInfo;
137 folderInfo.folderId = g_folderList.nCount + 1;
138 folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
140 char strName[MAX_FOLDER_NAME_SIZE+1];
141 memset(strName, 0x00, sizeof(strName));
142 cin.getline(strName, MAX_FOLDER_NAME_SIZE);
143 strncpy(folderInfo.folderName, strName, MAX_FOLDER_NAME_SIZE);
145 MSG_DEBUG("folderId [%d]", folderInfo.folderId);
146 MSG_DEBUG("folderType [%d]", folderInfo.folderType);
147 MSG_DEBUG("folderName [%s]", folderInfo.folderName);
149 print("Start Creating New Folder...");
152 err = MsgAddFolder(hMsgHandle, &folderInfo);
154 if (err == MSG_SUCCESS)
155 print("Creating New Folder is OK!");
157 print("Creating New Folder is failed!");
160 * @param[in] hMsgHandle is Message handle.
162 void MsgTestAddFolder(MSG_HANDLE_T hMsgHandle);
165 /** @fn void MsgTestUpdateFolder(MSG_HANDLE_T hMsgHandle)
166 * @brief Tests MsgUpdateFolder.
167 * @param[in] hMsgHandle is Message handle.
169 void MsgTestUpdateFolder(MSG_HANDLE_T hMsgHandle);
172 /** @fn void MsgTestDeleteFolder(MSG_HANDLE_T hMsgHandle)
173 * @brief Tests MsgDeleteFolder.
174 * @param[in] hMsgHandle is Message handle.
176 void MsgTestDeleteFolder(MSG_HANDLE_T hMsgHandle);
178 void MsgTestDeleteMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
180 /** @fn void MsgPrintMMSBody(msg_message_t pMsg)
181 * @brief Prints mms body's (content) information.
182 * @param[in] pMsg is a pointer to an msg_message_t structure. \n
184 void MsgPrintMMSBody(msg_message_t pMsg);
186 /** @fn void MsgPrintMessage(MSG_HANDLE_T hMsgHandle, msg_message_t *pMsg)
187 * @brief Prints message information.
188 * @param[in] hMsgHandle is Message handle. \n
189 * @param[in] pMsg is a pointer to an msg_message_t structure. \n
191 void MsgPrintMessage(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, MSG_SENDINGOPT_S* pSendOpt);
194 /** @fn void MsgRunMsgMenu(MSG_HANDLE_T hMsgHandle, char Menu, msg_message_t *pMsg)
195 * @brief Runs the selected function in the message menu.
196 * @param[in] hMsgHandle is Message handle. \n
197 * @param[in] Menu indicates which menu is selected. \n
198 * @param[in] pMsg is a pointer to an msg_message_t structure. \n
200 void MsgRunMsgMenu(MSG_HANDLE_T hMsgHandle, char Menu, msg_message_t pMsg, MSG_SENDINGOPT_S *pSendOpt);
203 /** @fn void MsgRunMsgListMenu(MSG_HANDLE_T hMsgHandle, char *pMenu, int FolderId, MSG_MAIN_TYPE_T mainType, MSG_NETWORK_STATUS_T NetworkStatus)
204 * @brief Runs the selected function in the message list menu.
205 * @param[in] hMsgHandle is Message handle. \n
206 * @param[in] pMenu is a pointer that indicates which menu is selected. \n
207 * @param[in] FolderId is the ID of the folder to be run. \n
209 void MsgRunMsgListMenu(MSG_HANDLE_T hMsgHandle, int MsgId, int FolderId, MSG_MESSAGE_TYPE_T MsgType, MSG_NETWORK_STATUS_T NetworkStatus);
212 /** @fn void MsgGetCurrentTime(time_t *pTime)
213 * @brief Gets the current time.
214 * @param[out] pTime is a pointer that indicates the current time.
216 void MsgGetCurrentTime(time_t *pTime);
219 /** @fn char* MsgConvertMsgType(MSG_MAIN_TYPE_T MainType)
220 * @brief Converts the message type.
221 * @param[in] MainType indicates the message type to be returned.
226 const char* MsgConvertMsgType(MSG_MESSAGE_TYPE_T MsgType);
228 const char* MsgConvertStorageId(MSG_STORAGE_ID_T StorageId);
230 const char* MsgConvertNetworkStatus(MSG_NETWORK_STATUS_T status);
232 /** @fn char* MsgConvertReadStatus(bool ReadStatus)
233 * @brief Converts the read status of a message.
234 * @param[in] ReadStatus indicates whether a message is read or not.
238 const char* MsgConvertReadStatus(bool ReadStatus);
241 /** @fn char* MsgConvertProtectedStatus(bool ProtectedStatus)
242 * @brief Converts the protected status of a message.
243 * @param[in] ProtectedStatus indicates whether a message is protected or not.
244 * @retval PROTECTED \n
245 * @retval UNPROTECTED \n
247 const char* MsgConvertProtectedStatus(bool ProtectedStatus);
250 /** @fn char* MsgConvertTime(const time_t *pTime)
251 * @brief Converts the time_t value to string.
252 * @param[in] time_t value.
253 * @retval String type time present. \n
255 void MsgConvertTime(time_t *pTime, char *pDisplayTme);
257 //MSG_ERROR_T convertMsgStruct(const msg_message_t *pSource, MSG_MESSAGE_INFO_S *pDest);
259 MSG_ERROR_T MsgTestSendReadReport(MSG_HANDLE_T hMsgHandle, msg_message_t pMsg, int mmsReadStatus, int version);
261 void MsgTestForwardMMSMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
263 void MsgTestRetrieveMessage(MSG_HANDLE_T hMsgHandle, MSG_MESSAGE_ID_T nMsgId);
265 void MsgTestMsgGen(MSG_HANDLE_T hMsgHandle);
268 void MsgThreadViewMain(MSG_HANDLE_T hMsgHandle);
270 void MsgRunThreadViewMenu(MSG_HANDLE_T hMsgHandle, MSG_THREAD_LIST_INDEX_S *pAddrList);
277 #endif //MSG_TEST_STORAGE_H