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 SMS_PLUGIN_CONCAT_HANDLER_H
18 #define SMS_PLUGIN_CONCAT_HANDLER_H
21 /*==================================================================================================
23 ==================================================================================================*/
30 #include "MsgTextConvert.h"
31 #include "SmsPluginTypes.h"
34 /*==================================================================================================
36 ==================================================================================================*/
37 #define MAX_CONCAT_LIST 10
42 char data[MAX_USER_DATA_LEN+1];
45 typedef map<unsigned char, CONCAT_DATA_S> concatDataMap;
47 typedef struct _SMS_CONCAT_MSG_S
49 unsigned short msgRef;
50 unsigned char totalSeg;
53 SMS_TIMESTAMP_S timeStamp;
54 SMS_ADDRESS_S originAddress;
59 typedef struct _SMS_CONCAT_INFO_S
61 unsigned short msgRef;
62 unsigned char totalSeg;
65 SMS_TIMESTAMP_S timeStamp;
66 SMS_ADDRESS_S originAddress;
70 unsigned int totalSize;
74 typedef struct _SMS_SIM_ID_S
76 unsigned short msgRef;
81 /*==================================================================================================
83 ==================================================================================================*/
84 class SmsPluginConcatHandler
87 static SmsPluginConcatHandler* instance();
89 bool IsConcatMsg(SMS_USERDATA_S *pUserData);
90 void handleConcatMsg(SMS_TPDU_S *pTpdu);
91 // void handleConcatMsg(SMS_TPDU_S *pTpdu, msg_sim_id_t SimMsgId, bool bRead);
93 // void handleBrokenMsg();
96 SmsPluginConcatHandler();
97 virtual ~SmsPluginConcatHandler();
99 static SmsPluginConcatHandler* pInstance;
101 unsigned char checkConcatMsg(SMS_CONCAT_MSG_S *pConcatMsg, SMS_USERDATA_S *pUserData);
102 int makeConcatUserData(unsigned short MsgRef, char **ppTotalData);
104 void convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
105 // void convertSimMsgToMsginfo(const SMS_CONCAT_MSG_S *pConcatMsg, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
107 void removeFromConcatList(unsigned short MsgRef);
109 // void addToSimIdList(unsigned short MsgRef, msg_sim_id_t SimMsgId);
110 // void removeFromSimIdList(unsigned short MsgRef);
112 vector<SMS_CONCAT_INFO_S> concatList;
113 // vector<SMS_SIM_ID_S> simIdList;
115 MsgTextConvert textCvt;
118 #endif //SMS_PLUGIN_CONCAT_HANDLER_H