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 MMS_PLUGIN_STORAGE_H
18 #define MMS_PLUGIN_STORAGE_H
20 /*==================================================================================================
22 ==================================================================================================*/
23 #include "MsgStorageTypes.h"
24 #include "MsgSqliteWrapper.h"
25 #include "MmsPluginMessage.h"
28 /*==================================================================================================
30 ==================================================================================================*/
31 class MmsPluginStorage
34 static MmsPluginStorage *instance();
39 void addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
40 void getMmsMessage(MmsMsg **pMmsMsg);
41 void getMmsAttrib(msg_message_id_t msgId, MmsMsg *pMmsMsg);
42 msg_error_t getMmsMessageId(msg_message_id_t selectedMsgId, MmsMsg *pMmsMsg);
43 void composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
45 int searchMsgId(char *toNumber, char *szMsgID);
46 int getMmsVersion(msg_message_id_t selectedMsgId);
48 msg_error_t updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
49 msg_error_t updateConfMessage(MSG_MESSAGE_INFO_S *pMsgInfo);
50 msg_error_t updateMmsAttrib(msg_message_id_t msgId, MmsAttrib *attrib, MSG_SUB_TYPE_T msgSubType);
51 msg_error_t updateMmsAttachCount(msg_message_id_t msgId, int count);
52 msg_error_t updateNetStatus(msg_message_id_t msgId, msg_network_status_t netStatus);
54 msg_error_t insertDeliveryReport(msg_message_id_t msgId, char *address, MmsMsgMultiStatus *pStatus);
55 msg_error_t insertReadReport(msg_message_id_t msgId, char *address, MmsMsgMultiStatus *pStatus);
56 msg_error_t insertPreviewInfo(int msgId, int type, char *value, int count = 0);
58 msg_error_t setReadReportSendStatus(msg_message_id_t msgId, int readReportSendStatus);
59 msg_error_t plgGetMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
60 msg_error_t getContentLocation(MSG_MESSAGE_INFO_S *pMsgInfo);
61 msg_error_t getMmsRawFilePath(msg_message_id_t msgId, char *pFilepath);
62 msg_error_t plgGetRestoreMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg, char *filePath);
63 /* reject_msg_support */
64 msg_error_t getTrID(MSG_MESSAGE_INFO_S *pMsgInfo, char *pszTrID, int nBufferLen);
65 /* reject_msg_support */
67 msg_error_t updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo);
69 MmsMsgMultiStatus *getMultiStatus(msg_message_id_t msgId);
70 msg_error_t getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText);
73 msg_error_t addMmsMsgToDB(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, int attachCnt = 0);
75 static MmsPluginStorage *pInstance;
77 MsgDbHandler dbHandle;
82 #endif //MMS_PLUGIN_STORAGE_H