Modify flora license version.
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginTransport.h
1 /*
2 * Copyright 2012-2013  Samsung Electronics Co., Ltd
3 *
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
7 *
8 *    http://floralicense.org/license/
9 *
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.
15 */
16
17 #ifndef SMS_PLUGIN_TRANSPORT_H
18 #define SMS_PLUGIN_TRANSPORT_H
19
20
21 /*==================================================================================================
22                                          INCLUDE FILES
23 ==================================================================================================*/
24 #include "MsgMutex.h"
25 #include "MsgTextConvert.h"
26 #include "MsgTransportTypes.h"
27 #include "MsgSettingTypes.h"
28 #include "SmsPluginTypes.h"
29 #include "MsgInternalTypes.h"
30
31 /*==================================================================================================
32                                      CLASS DEFINITIONS
33 ==================================================================================================*/
34 class SmsPluginTransport
35 {
36 public:
37         static SmsPluginTransport* instance();
38
39         void submitRequest(SMS_REQUEST_INFO_S *pReqInfo);
40         void sendDeliverReport(msg_error_t err);
41         void sendClass0DeliverReport(msg_error_t err);
42
43         void setSmsSendOptions(SMS_SUBMIT_S *pSubmit);
44         void setSmscOptions(SMS_ADDRESS_S *pSmsc);
45
46         void msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType, int addrIndex);
47         void setConcatHeader(SMS_UDH_S *pSrcHeader, SMS_UDH_S *pDstHeader);
48
49         void setNetStatus(msg_network_status_t netStatus);
50         msg_network_status_t getNetStatus();
51
52         unsigned char getMsgRef();
53
54 private:
55         SmsPluginTransport();
56         ~SmsPluginTransport();
57
58         int getSegmentSize(SMS_CODING_SCHEME_T CodingScheme, int DataLen, bool bPortNum, MSG_LANGUAGE_ID_T LangId, int ReplyAddrLen);
59         SMS_PID_T convertPid(MSG_SMS_PID_T pid);
60
61         static SmsPluginTransport* pInstance;
62
63         unsigned char           msgRef;
64
65         unsigned char           msgRef8bit;
66         unsigned short  msgRef16bit;
67
68         msg_network_status_t curStatus;
69
70         Mutex mx;
71         CndVar cv;
72
73         MsgTextConvert textCvt;
74 };
75
76 #endif //SMS_PLUGIN_TRANSPORT_H
77