2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 SMS_PLUGIN_EVENT_HANDLER_H
18 #define SMS_PLUGIN_EVENT_HANDLER_H
21 /*==================================================================================================
23 ==================================================================================================*/
25 #include "MsgTextConvert.h"
26 #include "MsgPluginInterface.h"
27 #include "SmsPluginTypes.h"
30 /*==================================================================================================
32 ==================================================================================================*/
33 class SmsPluginEventHandler
36 static SmsPluginEventHandler* instance();
38 void registerListener(MSG_PLUGIN_LISTENER_S *pListener);
39 void handleSentStatus(msg_network_status_t NetStatus);
40 void handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pTpdu);
41 void handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen, int simIndex);
42 void handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen);
43 void handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *app_id, char *content_type);
44 void handleResendMessage(void);
46 msg_error_t callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo);
47 msg_error_t callbackCBMsgIncoming(MSG_CB_MSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo);
48 msg_error_t callbackInitSimBySat();
49 msg_error_t callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
50 msg_error_t handleSimMsg(MSG_MESSAGE_INFO_S *pMsgInfo, int *simIdList, msg_message_id_t *retMsgId, int listSize);
51 msg_error_t updateIMSI(int sim_idx);
52 void handleSimMemoryFull(int simIndex);
54 void SetSentInfo(SMS_SENT_INFO_S *pSentInfo);
56 void setDeviceStatus(TapiHandle *handle);
57 bool getDeviceStatus(TapiHandle *handle);
60 void convertTpduToMsginfo(SMS_TPDU_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
62 MSG_SUB_TYPE_T convertMsgSubType(SMS_PID_T pid);
65 SmsPluginEventHandler();
66 virtual ~SmsPluginEventHandler();
68 void convertSubmitTpduToMsginfo(const SMS_SUBMIT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
69 void convertDeliverTpduToMsginfo(const SMS_DELIVER_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
70 void convertStatusRepTpduToMsginfo(const SMS_STATUS_REPORT_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo);
72 static SmsPluginEventHandler* pInstance;
74 MSG_PLUGIN_LISTENER_S listener;
75 MSG_SIM_COUNT_S* pSimCnt;
76 SMS_SENT_INFO_S sentInfo;
84 TapiHandle *devHandle;
87 #endif /* SMS_PLUGIN_EVENT_HANDLER_H */