2 * Copyright 2012-2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.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 MSG_PLUGIN_MANAGER_H
18 #define MSG_PLUGIN_MANAGER_H
20 /*==================================================================================================
22 ==================================================================================================*/
26 #include "MsgPluginInterface.h"
27 #include "MsgPluginConfig.h"
30 /*==================================================================================================
32 ==================================================================================================*/
33 #define MSG_PLUGIN_CFG_PATH "/usr/share/msg-service/"
34 #define MSG_PLUGIN_CFG_NAME "plugin.cfg"
37 /*==================================================================================================
39 ==================================================================================================*/
43 MsgPlugin(MSG_MAIN_TYPE_T plgType = MSG_UNKNOWN_TYPE, const char* libPath = NULL);
46 msg_error_t initialize();
49 msg_error_t submitReq(MSG_REQUEST_INFO_S *pReqInfo);
50 msg_error_t registerListener(MSG_PLUGIN_LISTENER_S *pListener);
51 msg_error_t checkSimStatus(MSG_SIM_STATUS_T *pStatus);
52 msg_error_t checkDeviceStatus();
54 msg_error_t initSimMessage();
55 msg_error_t saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
56 msg_error_t deleteSimMessage(msg_sim_id_t SimMsgId);
57 msg_error_t setReadStatus(msg_sim_id_t SimMsgId);
58 msg_error_t setMemoryStatus(msg_error_t Error);
60 msg_error_t initConfigData(MSG_SIM_STATUS_T SimStatus);
61 msg_error_t setConfigData(const MSG_SETTING_S *pSetting);
62 msg_error_t getConfigData(MSG_SETTING_S *pSetting);
65 msg_error_t addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
66 msg_error_t updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
67 msg_error_t processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
68 msg_error_t getMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
69 msg_error_t updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
70 msg_error_t composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
72 msg_error_t restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath);
74 operator void*() const {
75 return (mSupportedMsg==MSG_UNKNOWN_TYPE)? NULL:(void*) this;
79 MSG_MAIN_TYPE_T mSupportedMsg;
80 MSG_PLUGIN_HANDLER_S mPlgHandler;
82 void *mLibHandler; // plugin library pointer
86 /*==================================================================================================
88 ==================================================================================================*/
89 typedef std::map<MSG_MAIN_TYPE_T, MsgPlugin*> MsgPluginMap;
92 /*==================================================================================================
94 ==================================================================================================*/
95 class MsgPluginManager
98 static MsgPluginManager* instance();
102 MsgPlugin* getPlugin(MSG_MAIN_TYPE_T mainType);
103 void loadPlugins(const char* path);
109 static MsgPluginManager* pInstance;
113 #endif // MSG_PLUGIN_MANAGER_H