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.
31 #ifndef MMS_PLUGIN_STORAGE_H
32 #define MMS_PLUGIN_STORAGE_H
34 /*==================================================================================================
36 ==================================================================================================*/
37 #include "MsgStorageTypes.h"
38 #include "MsgSqliteWrapper.h"
39 #include "MmsPluginMessage.h"
42 /*==================================================================================================
44 ==================================================================================================*/
45 class MmsPluginStorage
48 static MmsPluginStorage *instance();
53 void addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
54 void getMmsMessage(MmsMsg **pMmsMsg);
55 void getMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsMsg *pMmsMsg);
56 MSG_ERROR_T getMmsMessageId(MSG_MESSAGE_ID_T selectedMsgId, MmsMsg *pMmsMsg);
57 void composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
59 int searchMsgId(char *toNumber, char *szMsgID);
60 int getMmsVersion(MSG_MESSAGE_ID_T selectedMsgId);
62 MSG_ERROR_T updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
63 MSG_ERROR_T updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
64 MSG_ERROR_T updateMmsAttrib(MSG_MESSAGE_ID_T msgId, MmsAttrib *attrib, MSG_SUB_TYPE_T msgSubType);
65 MSG_ERROR_T updateMmsAttachCount(MSG_MESSAGE_ID_T msgId, int count);
66 MSG_ERROR_T updateNetStatus(MSG_MESSAGE_ID_T msgId, MSG_NETWORK_STATUS_T netStatus);
67 MSG_ERROR_T updateDeliveryReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus);
68 MSG_ERROR_T updateReadReport(MSG_MESSAGE_ID_T msgId, MmsMsgMultiStatus *pStatus);
69 MSG_ERROR_T setReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus);
70 MSG_ERROR_T plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
71 MSG_ERROR_T getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo);
72 MSG_ERROR_T getMmsRawFilePath(MSG_MESSAGE_ID_T msgId, char *pFilepath);
73 MSG_ERROR_T plgGetRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg, char *filePath);
74 /* reject_msg_support */
75 MSG_ERROR_T getTrID(MSG_MESSAGE_INFO_S *pMsgInfo, char *pszTrID, int nBufferLen);
76 /* reject_msg_support */
78 MSG_ERROR_T updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo);
80 MmsMsgMultiStatus *getMultiStatus(MSG_MESSAGE_ID_T msgId);
81 MSG_ERROR_T getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText);
82 MSG_ERROR_T makeThumbnail(MMS_MESSAGE_DATA_S *pMmsMsg, char *pThumbnailPath, char *szFileName);
83 MSG_ERROR_T addMmsNoti(MSG_MESSAGE_INFO_S *pMsgInfo);
86 bool checkExistedMessage(MSG_MESSAGE_ID_T msgId);
87 MSG_ERROR_T addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, int attachCnt = 0);
89 static MmsPluginStorage *pInstance;
91 MsgDbHandler dbHandle;
96 #endif //MMS_PLUGIN_STORAGE_H