2 * Copyright (c) 2015 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_CDMA_PLUGIN_EVENT_HANDLER_H
18 #define SMS_CDMA_PLUGIN_EVENT_HANDLER_H
21 /*==================================================================================================
23 ==================================================================================================*/
32 #include "MsgTextConvert.h"
33 #include "MsgPluginInterface.h"
34 #include "SmsCdmaPluginTypes.h"
37 /*==================================================================================================
39 ==================================================================================================*/
42 char data[SMS_MAX_USER_DATA_LEN+1];
45 typedef map<unsigned char, wap_data_s> wapDataMap;
47 typedef struct _sms_wap_msg_s {
49 unsigned char totalSeg;
53 typedef struct _sms_wap_info_s {
55 unsigned char totalSeg;
58 unsigned int totalSize;
63 /*==================================================================================================
65 ==================================================================================================*/
66 class SmsPluginEventHandler
69 static SmsPluginEventHandler* instance();
71 void registerListener(MSG_PLUGIN_LISTENER_S *pListener);
72 void handleSentStatus(msg_network_status_t NetStatus);
73 void handleMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg);
74 void handleCbMsgIncoming(sms_trans_broadcast_msg_s *p_cb_msg);
75 void handleWapMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg);
77 void handleResendMessage(void);
79 msg_error_t callbackMsgIncoming(MSG_MESSAGE_INFO_S *pMsgInfo);
80 msg_error_t callbackStorageChange(msg_storage_change_type_t storageChangeType, MSG_MESSAGE_INFO_S *pMsgInfo);
82 void convertTpduToMsginfo(sms_trans_p2p_msg_s *p_p2p_msg, MSG_MESSAGE_INFO_S *p_msg_info);
83 void convertTpduToMsginfo(sms_trans_broadcast_msg_s *p_cb_msg, MSG_MESSAGE_INFO_S *p_msg_info);
85 void SetSentInfo(sms_sent_info_s *pSentInfo);
87 void setDeviceStatus();
88 bool getDeviceStatus();
89 void setNeedInitConfig(bool bNeeded);
90 bool getNeedInitConfig();
92 void handleSyncMLMsgIncoming(msg_syncml_message_type_t msgType, char* pPushBody, int PushBodyLen, char* pWspHeader, int WspHeaderLen);
93 void handleLBSMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen);
94 void handlePushMsgIncoming(char* pPushHeader, char* pPushBody, int pushBodyLen, char *app_id, char *content_type);
97 SmsPluginEventHandler();
98 virtual ~SmsPluginEventHandler();
100 static SmsPluginEventHandler* pInstance;
102 MSG_PLUGIN_LISTENER_S listener;
104 sms_sent_info_s sentInfo;
107 bool bNeedInitConfig;
111 vector<sms_wap_info_s> wapList;
113 void convertDeliverMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
114 void convertCMASMsgToMsgInfo(sms_telesvc_deliver_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
115 void convertAckMsgToMsgInfo(sms_telesvc_deliver_ack_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
116 void convertReportMsgToMsgInfo(sms_telesvc_report_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info);
118 msg_encode_type_t getEncodeType(sms_encoding_type_t encode_type);
120 unsigned short checkWapMsg(sms_wap_msg_s *pMsg, sms_telesvc_userdata_s *pUserdata);
121 int MakeWapUserData(unsigned short msgId, char **ppTotalData);
123 bool checkCbOpt(sms_trans_svc_ctg_t svc_ctg);
126 #endif /* SMS_CDMA_PLUGIN_EVENT_HANDLER_H */