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.
35 #error "This is a C++ header file; it requires C++ to compile."
38 /*==================================================================================================
40 ==================================================================================================*/
41 #include "MsgStorageTypes.h"
42 #include "MsgTransportTypes.h"
43 #include "MsgSettingTypes.h"
44 #include "MsgCmdTypes.h"
45 #include "MsgInternalTypes.h"
46 #include "MsgIpcSocket.h"
48 /*==================================================================================================
50 ==================================================================================================*/
60 void closeHandle(MsgHandle* pHandle);
63 MSG_ERROR_T submitReq(MSG_REQUEST_S* pReq);
64 MSG_ERROR_T cancelReq(MSG_REQUEST_ID_T reqId);
66 MSG_ERROR_T regSentStatusCallback(msg_sent_status_cb onStatusChanged, void *pUserParam);
67 MSG_ERROR_T regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam);
68 MSG_ERROR_T regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam);
69 MSG_ERROR_T regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam);
70 MSG_ERROR_T regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam);
72 MSG_ERROR_T regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam);
74 MSG_ERROR_T operateSyncMLMessage(MSG_MESSAGE_ID_T msgId);
77 int addMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
78 MSG_ERROR_T addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg);
79 MSG_ERROR_T updateMessage(const MSG_MESSAGE_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
80 MSG_ERROR_T updateReadStatus(MSG_MESSAGE_ID_T MsgId, bool bRead);
81 MSG_ERROR_T updateProtectedStatus(MSG_MESSAGE_ID_T MsgId, bool bProtected);
82 MSG_ERROR_T deleteMessage(MSG_MESSAGE_ID_T MsgId);
83 MSG_ERROR_T deleteAllMessagesInFolder(MSG_FOLDER_ID_T FolderId, bool bOnlyDB);
84 MSG_ERROR_T moveMessageToFolder(MSG_MESSAGE_ID_T MsgId, MSG_FOLDER_ID_T DestFolderId);
85 MSG_ERROR_T moveMessageToStorage(MSG_MESSAGE_ID_T MsgId, MSG_STORAGE_ID_T DestStorageId);
86 MSG_ERROR_T countMessage(MSG_FOLDER_ID_T FolderId, MSG_COUNT_INFO_S *pCountInfo);
87 MSG_ERROR_T countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
88 MSG_ERROR_T countMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
89 MSG_ERROR_T getMessage(MSG_MESSAGE_ID_T MsgId, MSG_MESSAGE_S *pMsg, MSG_SENDINGOPT_S *pSendOpt);
90 MSG_ERROR_T getFolderViewList(MSG_FOLDER_ID_T FolderId, const MSG_SORT_RULE_S *pSortRule, MSG_LIST_S *pMsgFolderViewList);
91 MSG_ERROR_T addFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
92 MSG_ERROR_T updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
93 MSG_ERROR_T deleteFolder(MSG_FOLDER_ID_T FolderId);
94 MSG_ERROR_T getFolderList(MSG_FOLDER_LIST_S *pFolderList);
96 MSG_ERROR_T getThreadViewList(const MSG_SORT_RULE_S *pSortRule, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
97 MSG_ERROR_T getConversationViewList(MSG_THREAD_ID_T ThreadId, MSG_LIST_S *pConvViewList);
98 MSG_ERROR_T deleteThreadMessageList(MSG_THREAD_ID_T thread_id);
99 MSG_ERROR_T getQuickPanelData(MSG_QUICKPANEL_TYPE_T Type, MSG_MESSAGE_S *pMsg);
100 MSG_ERROR_T resetDatabase();
101 MSG_ERROR_T getMemSize(unsigned int* memsize);
104 MSG_ERROR_T setConfig(const MSG_SETTING_S *pSetting);
105 MSG_ERROR_T getConfig(MSG_SETTING_S *pSetting);
108 MSG_ERROR_T searchMessage(const char *pSearchString, MSG_THREAD_VIEW_LIST_S *pThreadViewList);
109 MSG_ERROR_T searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, MSG_LIST_S *pMsgList);
110 MSG_ERROR_T getMsgIdList(MSG_REFERENCE_ID_T RefId, MSG_MSGID_LIST_S *pMsgIdList);
111 MSG_ERROR_T getRejectMsgList(const char *pNumber, MSG_REJECT_MSG_LIST_S *pRejectMsgList);
112 MSG_ERROR_T regStorageChangeCallback(msg_storage_change_cb onStorageChange, void *pUserParam);
113 MSG_ERROR_T getReportStatus(MSG_MESSAGE_ID_T msg_id, MSG_REPORT_STATUS_INFO_S *pReport_status);
115 void convertMsgStruct(const MSG_MESSAGE_INFO_S *pSource, MSG_MESSAGE_S *pDest);
116 void convertSendOptStruct(const MSG_SENDINGOPT_INFO_S* pSrc, MSG_SENDINGOPT_S* pDest, MSG_MESSAGE_TYPE_S msgType);
119 void connectSocket();
120 void disconnectSocket();
121 void write(const char *pCmd, int CmdSize, char **ppEvent);
122 void read(char **ppEvent);
123 void generateConnectionId(char *ConnectionId);
124 void convertMsgStruct(const MSG_MESSAGE_S *pSource, MSG_MESSAGE_INFO_S *pDest);
125 void convertSendOptStruct(const MSG_SENDINGOPT_S* pSrc, MSG_SENDINGOPT_INFO_S* pDest, MSG_MESSAGE_TYPE_S msgType);
126 int getSettingCmdSize(MSG_OPTION_TYPE_T optionType);
128 char mConnectionId[20];
131 char mCookie[MAX_COOKIE_LEN];
133 MsgIpcClientSocket mClientSock;
136 #endif // MSG_HANDLE_H