update tizen source
[framework/messaging/msg-service.git] / include / framework / MsgStorageHandler.h
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
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>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
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.
21 *
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.
28 *
29 */
30
31 #ifndef MSG_STORAGE_HANDLER_H
32 #define MSG_STORAGE_HANDLER_H
33
34 /*==================================================================================================
35                                          INCLUDE FILES
36 ==================================================================================================*/
37 #include "MsgStorageTypes.h"
38 #include "MsgSettingTypes.h"
39 #include "MsgMmsTypes.h"
40 #include "MsgTransportTypes.h"
41 #include "MsgInternalTypes.h"
42
43
44 /*==================================================================================================
45                                      FUNCTION PROTOTYPES
46 ==================================================================================================*/
47 MSG_ERROR_T MsgStoConnectDB();
48 MSG_ERROR_T MsgStoDisconnectDB();
49
50 MSG_ERROR_T MsgStoInitDB(bool bSimChanged);
51
52 MSG_ERROR_T MsgCreateAddressTable();
53 MSG_ERROR_T MsgCreateFolderTable();
54 MSG_ERROR_T MsgCreateMsgTable();
55 MSG_ERROR_T MsgCreateSimMessageTable();
56 MSG_ERROR_T MsgCreateWAPMessageTable();
57 MSG_ERROR_T MsgCreateCBMessageTable();
58 MSG_ERROR_T MsgCreateSyncMLMessageTable();
59 MSG_ERROR_T MsgCreateScheduledMessageTable();
60 MSG_ERROR_T MsgCreateSmsSendOptTable();
61 MSG_ERROR_T MsgCreateFilterTable();
62 MSG_ERROR_T MsgCreateMmsMsgTable();
63 MSG_ERROR_T MsgCreateMmsAttributeTable();
64 MSG_ERROR_T MsgAddDefaultFolders();
65 MSG_ERROR_T MsgAddDefaultAddress();
66 MSG_ERROR_T MsgStoResetDatabase();
67
68 MSG_ERROR_T MsgStoAddMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo, int addrIdx = 0);
69 MSG_ERROR_T MsgStoUpdateMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo, int addrIdx = 0);
70 MSG_ERROR_T MsgStoUpdateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead);
71 MSG_ERROR_T MsgStoUpdateThreadReadStatus(MSG_THREAD_ID_T ThreadId);
72 MSG_ERROR_T MsgStoUpdateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected);
73 MSG_ERROR_T MsgStoDeleteMessage(MSG_MESSAGE_ID_T MsgId, bool bCheckIndication);
74 MSG_ERROR_T MsgStoDeleteAllMessageInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyDB, MSG_MSGID_LIST_S *pMsgIdList);
75 MSG_ERROR_T MsgStoMoveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID_T DestFolderId);
76 MSG_ERROR_T MsgStoMoveMessageToStorage(const MSG_MESSAGE_ID_T MsgId, const MSG_STORAGE_ID_T DestStorageId);
77 MSG_ERROR_T MsgStoCountMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCountInfo);
78 MSG_ERROR_T MsgStoCountMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
79 MSG_ERROR_T MsgStoGetMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOptInfo);
80 MSG_ERROR_T MsgStoGetFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RULE_S *pSortRule, MSG_LIST_S *pMsgFolderViewList);
81 MSG_ERROR_T MsgStoAddSyncMLMessage(MSG_MESSAGE_INFO_S *pMsgInfo, int ExtId, int PinCode);
82 MSG_ERROR_T MsgStoGetMsgType(MSG_MESSAGE_ID_T msgId, MSG_MESSAGE_TYPE_S* pMsgType);
83 MSG_ERROR_T MsgStoGetText(MSG_MESSAGE_ID_T MsgId, char *pSubject, char *pMsgText);
84 MSG_ERROR_T MsgStoGetQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_INFO_S *pMsg);
85 MSG_ERROR_T MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
86 MSG_ERROR_T MsgStoGetConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *pConvViewList);
87 MSG_ERROR_T MsgStoDeleteThreadMessageList(MSG_THREAD_ID_T ThreadId, MSG_MSGID_LIST_S *pMsgIdList);
88 MSG_ERROR_T MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pThreadCountInfo);
89 MSG_ERROR_T MsgStoSearchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
90 MSG_ERROR_T MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, MSG_LIST_S *pMsgList);
91 MSG_ERROR_T MsgStoGetMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *pMsgIdList);
92 MSG_ERROR_T MsgStoGetRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *pRejectMsgList);
93 MSG_ERROR_T MsgStoGetReportStatus(MSG_MESSAGE_ID_T msgId, MSG_REPORT_STATUS_INFO_S* pReportStatus);
94 MSG_ERROR_T MsgStoGetThreadUnreadCnt(MSG_THREAD_ID_T ThreadId, int *cnt);
95
96 // Folder
97 MSG_ERROR_T MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
98 MSG_ERROR_T MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
99 MSG_ERROR_T MsgStoDeleteFolder(MSG_FOLDER_ID_T FolderId);
100 MSG_ERROR_T MsgStoGetFolderList(MSG_FOLDER_LIST_S *pFolderList);
101
102 // Sim Operation related Functions
103 MSG_ERROR_T MsgInitSimMessage(MSG_SIM_STATUS_T SimStatus);
104 MSG_ERROR_T MsgStoClearSimMessageInDB();
105
106 // Internal Function
107 MSG_ERROR_T MsgMakeSortRule(const MSG_SORT_RULE_S *pSortRule, char *pSqlSort);
108 MSG_ERROR_T MsgStoGetSmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
109 MSG_ERROR_T MsgStoGetMmsSendOpt(MSG_MESSAGE_ID_T MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
110
111 // Scheduled Msg
112 MSG_ERROR_T MsgStoAddScheduledMessage(MSG_MESSAGE_ID_T MsgID, int AlarmId, int ListenerFd);
113 MSG_ERROR_T MsgStoGetScheduledMessage(int AlarmId, MSG_REQUEST_INFO_S *pReqInfo, int *pListenerFd);
114 MSG_ERROR_T MsgStoDeleteScheduledMessage(MSG_MESSAGE_ID_T MsgId);
115
116 // SyncML Msg
117 MSG_ERROR_T MsgStoGetSyncMLExtId(MSG_MESSAGE_ID_T msgId, int *extId);
118 bool MsgStoCheckSyncMLMsgInThread(MSG_THREAD_ID_T threadId);
119
120 MSG_ERROR_T MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg);
121 MSG_ERROR_T MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo);
122 MSG_ERROR_T MsgStoSetReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus);
123
124
125 ///////////////////////////////////////////////////////////////////////////////////
126 MSG_ERROR_T MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg);
127 MSG_ERROR_T MsgStoUpdateNetworkStatus(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NETWORK_STATUS_T Status);
128 MSG_ERROR_T MsgStoGetSubject(MSG_MESSAGE_ID_T MsgId, char* pSubject);
129 MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S *pRecipientList);
130 MSG_ERROR_T MsgStoGetReadStatus(MSG_MESSAGE_ID_T MsgId, bool *pReadStatus);
131 MSG_ERROR_T MsgStoGetAddrInfo(MSG_MESSAGE_ID_T MsgId, MSG_ADDRESS_INFO_S *pAddrInfo);
132
133 ///////////////////////////////////////////////////////////////////////////////////
134
135 MSG_ERROR_T MsgStoResetNetworkStatus();
136 MSG_ERROR_T MsgStoCleanAbnormalMmsData();
137 MSG_ERROR_T MsgStoCheckReadReportStatus(MSG_MESSAGE_ID_T msgId);
138
139 #endif // MSG_STORAGE_HANDLER_H
140