4 * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #error "This is a C++ header file; it requires C++ to compile."
27 /*==================================================================================================
29 ==================================================================================================*/
30 #include "MsgStorageTypes.h"
31 #include "MsgTransportTypes.h"
32 #include "MsgFilterTypes.h"
33 #include "MsgSettingTypes.h"
34 #include "MsgCmdTypes.h"
35 #include "MsgInternalTypes.h"
36 #include "MsgIpcSocket.h"
38 /*==================================================================================================
40 ==================================================================================================*/
50 void closeHandle(MsgHandle* pHandle);
53 msg_error_t submitReq(MSG_REQUEST_S* pReq);
54 msg_error_t cancelReq(msg_request_id_t reqId);
56 msg_error_t regSentStatusCallback(msg_sent_status_cb onStatusChanged, void *pUserParam);
57 msg_error_t regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam);
58 msg_error_t regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam);
59 msg_error_t regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam);
60 msg_error_t regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam);
61 msg_error_t regPushMessageCallback(msg_push_msg_incoming_cb onPushMsgIncoming, const char *pAppId, void *pUserParam);
62 msg_error_t regCBMessageCallback(msg_cb_incoming_cb onCBIncoming, bool bSave, void *pUserParam);
63 msg_error_t regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam);
65 msg_error_t operateSyncMLMessage(msg_message_id_t msgId);
68 int addMessage(MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
69 msg_error_t addSyncMLMessage(const MSG_SYNCML_MESSAGE_S *pSyncMLMsg);
70 msg_error_t updateMessage(const MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt);
71 msg_error_t updateReadStatus(msg_message_id_t MsgId, bool bRead);
72 msg_error_t updateProtectedStatus(msg_message_id_t MsgId, bool bProtected);
73 msg_error_t deleteMessage(msg_message_id_t MsgId);
74 msg_error_t deleteAllMessagesInFolder(msg_folder_id_t FolderId, bool bOnlyDB);
75 msg_error_t deleteMessagesByList(msg_id_list_s *pMsgIdList);
76 msg_error_t moveMessageToFolder(msg_message_id_t MsgId, msg_folder_id_t DestFolderId);
77 msg_error_t moveMessageToStorage(msg_message_id_t MsgId, msg_storage_id_t DestStorageId);
78 msg_error_t countMessage(msg_folder_id_t FolderId, MSG_COUNT_INFO_S *pCountInfo);
79 msg_error_t countMsgByType(const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount);
80 msg_error_t countMsgByContact(const MSG_THREAD_LIST_INDEX_INFO_S *pAddrInfo, MSG_THREAD_COUNT_INFO_S *pMsgThreadCountList);
81 msg_error_t getMessage(msg_message_id_t MsgId, MSG_MESSAGE_HIDDEN_S *pMsg, MSG_SENDINGOPT_S *pSendOpt);
82 msg_error_t getConversationViewItem(msg_message_id_t MsgId, MSG_CONVERSATION_VIEW_S *pConv);
83 msg_error_t getFolderViewList(msg_folder_id_t FolderId, const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pMsgFolderViewList);
84 msg_error_t addFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
85 msg_error_t updateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
86 msg_error_t deleteFolder(msg_folder_id_t FolderId);
87 msg_error_t getFolderList(msg_struct_list_s *pFolderList);
89 msg_error_t getThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList);
90 msg_error_t getConversationViewList(msg_thread_id_t ThreadId, msg_struct_list_s *pConvViewList);
91 msg_error_t deleteThreadMessageList(msg_thread_id_t thread_id, bool include_protected_msg);
92 msg_error_t getQuickPanelData(msg_quickpanel_type_t Type, MSG_MESSAGE_HIDDEN_S *pMsg);
93 msg_error_t resetDatabase();
94 msg_error_t getMemSize(unsigned int* memsize);
96 msg_error_t getAddressList(const msg_thread_id_t threadId, msg_struct_list_s *pAddrList);
99 msg_error_t addFilter(const MSG_FILTER_S *pFilter);
100 msg_error_t updateFilter(const MSG_FILTER_S *pFilter);
101 msg_error_t deleteFilter(msg_filter_id_t FilterId);
102 msg_error_t getFilterList(msg_struct_list_s *pFilterList);
103 msg_error_t setFilterOperation(bool bSetFlag);
104 msg_error_t getFilterOperation(bool *pSetFlag);
105 msg_error_t setFilterActivation(msg_filter_id_t filter_id, bool active);
108 msg_error_t getSMSCOption(msg_struct_t msg_struct);
109 msg_error_t setSMSCOption(msg_struct_t msg_struct);
110 msg_error_t getCBOption(msg_struct_t msg_struct);
111 msg_error_t setCBOption(msg_struct_t msg_struct);
112 msg_error_t getSmsSendOpt(msg_struct_t msg_struct);
113 msg_error_t setSmsSendOpt(msg_struct_t msg_struct);
114 msg_error_t getMmsSendOpt(msg_struct_t msg_struct);
115 msg_error_t setMmsSendOpt(msg_struct_t msg_struct);
116 msg_error_t getMmsRecvOpt(msg_struct_t msg_struct);
117 msg_error_t setMmsRecvOpt(msg_struct_t msg_struct);;
118 msg_error_t getPushMsgOpt(msg_struct_t msg_struct);
119 msg_error_t setPushMsgOpt(msg_struct_t msg_struct);
120 msg_error_t getVoiceMsgOpt(msg_struct_t msg_struct);
121 msg_error_t setVoiceMsgOpt(msg_struct_t msg_struct);
122 msg_error_t getGeneralOpt(msg_struct_t msg_struct);
123 msg_error_t setGeneralOpt(msg_struct_t msg_struct);
124 msg_error_t getMsgSizeOpt(msg_struct_t msg_struct);
125 msg_error_t setMsgSizeOpt(msg_struct_t msg_struct);
128 msg_error_t backupMessage(msg_message_backup_type_t type, const char *backup_filepath);
129 msg_error_t restoreMessage(const char *backup_filepath);
130 msg_error_t getVobject(msg_message_id_t MsgId, void** encodedData);
132 msg_error_t searchMessage(const char *pSearchString, msg_struct_list_s *pThreadViewList);
133 msg_error_t searchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, msg_struct_list_s *pMsgList);
134 msg_error_t getRejectMsgList(const char *pNumber, msg_struct_list_s *pRejectMsgList);
135 msg_error_t regStorageChangeCallback(msg_storage_change_cb onStorageChange, void *pUserParam);
136 msg_error_t getReportStatus(msg_message_id_t msg_id, msg_struct_list_s *report_list);
137 msg_error_t getThreadIdByAddress(msg_struct_list_s *pAddrList, msg_thread_id_t *pThreadId);
138 msg_error_t getThread(msg_thread_id_t threadId, MSG_THREAD_VIEW_S* pThreadInfo);
139 msg_error_t getMessageList(msg_folder_id_t folderId, msg_thread_id_t threadId, msg_message_type_t msgType, msg_storage_id_t storageId, msg_struct_list_s *pMsgList);
142 msg_error_t addPushEvent(MSG_PUSH_EVENT_INFO_S *push_event);
143 msg_error_t deletePushEvent(MSG_PUSH_EVENT_INFO_S *push_event);
144 msg_error_t updatePushEvent(MSG_PUSH_EVENT_INFO_S *pSrc, MSG_PUSH_EVENT_INFO_S *pDst);
146 void convertMsgStruct(const MSG_MESSAGE_INFO_S *pSource, MSG_MESSAGE_HIDDEN_S *pDest);
147 void convertSendOptStruct(const MSG_SENDINGOPT_INFO_S* pSrc, MSG_SENDINGOPT_S* pDest, MSG_MESSAGE_TYPE_S msgType);
150 void connectSocket();
151 void disconnectSocket();
152 void write(const char *pCmd, int CmdSize, char **ppEvent);
153 void read(char **ppEvent);
154 void generateConnectionId(char *ConnectionId);
155 void convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSource, MSG_MESSAGE_INFO_S *pDest);
156 void convertSendOptStruct(const MSG_SENDINGOPT_S* pSrc, MSG_SENDINGOPT_INFO_S* pDest, MSG_MESSAGE_TYPE_S msgType);
157 int getSettingCmdSize(MSG_OPTION_TYPE_T optionType);
158 bool CheckEventData(char *pEventData);
160 char mConnectionId[20];
163 char mCookie[MAX_COOKIE_LEN];
165 MsgIpcClientSocket mClientSock;
168 #endif // MSG_HANDLE_H