update tizen source
[framework/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginCbMsgHandler.h
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #ifndef SMS_PLUGIN_CBMSG_HANDLER_H
32 #define SMS_PLUGIN_CBMSG_HANDLER_H
33
34
35 /*==================================================================================================
36                                          INCLUDE FILES
37 ==================================================================================================*/
38 #include <map>
39 #include <vector>
40
41 using namespace std;
42
43 #include "SmsPluginTypes.h"
44
45 extern "C"
46 {
47 #ifndef _TAPI_NETTEXT_H_
48         #include "ITapiNetText.h"
49 //      #include "ITapi_common.h"
50 #endif
51 }
52
53
54 /*==================================================================================================
55                                          VARIABLES
56 ==================================================================================================*/
57 typedef map<unsigned char, string> cbPageMap;
58
59
60 typedef struct _CB_PAGE_INFO_S
61 {
62         unsigned char           geoScope;
63         unsigned char           updateNum;
64         unsigned short          msgCode;
65         unsigned short          msgId;
66         unsigned char           totalPages;
67
68         unsigned char           pageCnt;
69         unsigned int            totalSize;
70         cbPageMap               data;
71 } CB_PAGE_INFO_S;
72
73
74 /*==================================================================================================
75                                      CLASS DEFINITIONS
76 ==================================================================================================*/
77 class SmsPluginCbMsgHandler
78 {
79 public:
80         static SmsPluginCbMsgHandler* instance();
81
82         void handleCbMsg(TelSmsCbMsg_t *pCbMsg);
83
84 private:
85         SmsPluginCbMsgHandler();
86         virtual ~SmsPluginCbMsgHandler();
87
88         static SmsPluginCbMsgHandler* pInstance;
89
90         void Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage);
91         void Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage);
92
93         bool checkCbOpt(SMS_CBMSG_PAGE_S CbPage, bool *pJavaMsg);
94         unsigned char checkCbPage(SMS_CBMSG_PAGE_S CbPage);
95         void MakeCbMsg(SMS_CBMSG_PAGE_S CbPage, SMS_CBMSG_S *pCbMsg);
96         void convertCbMsgToMsginfo(SMS_CBMSG_S cbMsg, MSG_MESSAGE_INFO_S *pMsgInfo);
97         void addToPageLiat(SMS_CBMSG_PAGE_S CbPage);
98         void removeFromPageList(SMS_CBMSG_PAGE_S CbPage);
99
100         void decodeCbMsgDCS(unsigned char dcsData, const unsigned char *pMsgData, SMS_CBMSG_DCS_S* pDcs);
101         void convertLangType(SMS_CBMSG_LANG_TYPE_T InType , MSG_CB_LANGUAGE_TYPE_T *pOutType);
102         unsigned long getRecvTime();
103         void getDisplayName(unsigned short      MsgId, char *pDisplayName);
104
105         vector<CB_PAGE_INFO_S> pageList;
106 };
107
108 #endif //SMS_PLUGIN_CBMSG_HANDLER_H
109