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.
31 #ifndef MSG_PLUGIN_MANAGER_H
32 #define MSG_PLUGIN_MANAGER_H
34 /*==================================================================================================
36 ==================================================================================================*/
40 #include "MsgPluginInterface.h"
41 #include "MsgPluginConfig.h"
44 /*==================================================================================================
46 ==================================================================================================*/
47 #define MSG_PLUGIN_CFG_PATH "/usr/share/msg-service/"
48 #define MSG_PLUGIN_CFG_NAME "plugin.cfg"
51 /*==================================================================================================
53 ==================================================================================================*/
57 MsgPlugin(MSG_MAIN_TYPE_T plgType = MSG_UNKNOWN_TYPE, const char* libPath = NULL);
60 MSG_ERROR_T initialize();
63 MSG_ERROR_T submitReq(MSG_REQUEST_INFO_S *pReqInfo, bool bReqCb);
64 MSG_ERROR_T registerListener(MSG_PLUGIN_LISTENER_S *pListener);
65 MSG_ERROR_T checkSimStatus(MSG_SIM_STATUS_T *pStatus);
66 MSG_ERROR_T checkDeviceStatus();
68 MSG_ERROR_T initSimMessage();
69 MSG_ERROR_T saveSimMessage(MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SIM_ID_LIST_S *pSimIdList);
70 MSG_ERROR_T deleteSimMessage(MSG_SIM_ID_T SimMsgId);
71 MSG_ERROR_T setReadStatus(MSG_SIM_ID_T SimMsgId);
72 MSG_ERROR_T setMemoryStatus(MSG_ERROR_T Error);
74 MSG_ERROR_T initConfigData(MSG_SIM_STATUS_T SimStatus);
75 MSG_ERROR_T setConfigData(const MSG_SETTING_S *pSetting);
76 MSG_ERROR_T getConfigData(MSG_SETTING_S *pSetting);
79 MSG_ERROR_T addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
80 MSG_ERROR_T updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
81 MSG_ERROR_T processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
82 MSG_ERROR_T getMmsMessage(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMmsMsg, char **pDestMsg);
83 MSG_ERROR_T updateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo);
84 MSG_ERROR_T composeReadReport(MSG_MESSAGE_INFO_S *pMsgInfo);
86 MSG_ERROR_T restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath);
88 operator void*() const {
89 return (mSupportedMsg==MSG_UNKNOWN_TYPE)? NULL:(void*) this;
93 MSG_MAIN_TYPE_T mSupportedMsg;
94 MSG_PLUGIN_HANDLER_S mPlgHandler;
96 void* mLibHandler; // plugin library pointer
100 /*==================================================================================================
102 ==================================================================================================*/
103 typedef std::map<MSG_MAIN_TYPE_T, MsgPlugin> MsgPluginMap;
106 /*==================================================================================================
108 ==================================================================================================*/
109 class MsgPluginManager
112 static MsgPluginManager* instance();
116 MsgPlugin* getPlugin(MSG_MAIN_TYPE_T mainType);
117 void loadPlugins(const char* path);
123 static MsgPluginManager* pInstance;
127 #endif // MSG_PLUGIN_MANAGER_H