Fix issue : fail to make thumbnail
[platform/core/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginTransport.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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 extern "C"
32 {
33         #include <TelSat.h>
34 }
35
36 /*==================================================================================================
37                                      CLASS DEFINITIONS
38 ==================================================================================================*/
39 class SmsPluginTransport
40 {
41 public:
42         static SmsPluginTransport* instance();
43
44         void submitRequest(SMS_REQUEST_INFO_S *pReqInfo);
45         void sendDeliverReport(struct tapi_handle *handle, msg_error_t err);
46         void sendClass0DeliverReport(struct tapi_handle *handle, msg_error_t err);
47
48         void setSmscOptions(int simIndex, SMS_ADDRESS_S *pSmsc);
49
50         void msgInfoToSubmitData(const MSG_MESSAGE_INFO_S *pMsgInfo, SMS_SUBMIT_DATA_S *pData, SMS_CODING_SCHEME_T *pCharType, int addrIndex);
51         void setConcatHeader(SMS_UDH_S *pSrcHeader, SMS_UDH_S *pDstHeader);
52
53         void setNetStatus(SMS_NETWORK_STATUS_T sentStatus);
54         SMS_NETWORK_STATUS_T getNetStatus();
55
56         void setMoCtrlStatus(TelSatMoSmCtrlIndData_t *moCtrlData);
57         int getMoCtrlStatus();
58
59         unsigned char getMsgRef();
60
61 private:
62         SmsPluginTransport();
63         ~SmsPluginTransport();
64
65         void getSmsSendOption(int simIndex, SMS_SUBMIT_S *pSubmit);
66         void setSmsSendOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu);
67         void setSmsDcsOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu);
68         void setSmsReportOption(SMS_REQUEST_INFO_S *pReqInfo, SMS_TPDU_S* pSmsTpdu);
69
70         int getSegmentSize(SMS_CODING_SCHEME_T CodingScheme, int DataLen, bool bPortNum, MSG_LANGUAGE_ID_T LangId, int ReplyAddrLen);
71         SMS_PID_T convertPid(MSG_SMS_PID_T pid);
72
73         static SmsPluginTransport* pInstance;
74
75         unsigned char           msgRef;
76
77         unsigned char           msgRef8bit;
78         unsigned short  msgRef16bit;
79
80         SMS_NETWORK_STATUS_T curStatus;
81         TelSatMoSmCtrlIndData_t curMoCtrlData;
82
83         MsgMutex mx;
84         MsgCndVar cv;
85 };
86
87 #endif /* SMS_PLUGIN_TRANSPORT_H */
88