RSA sync with private
[platform/core/messaging/msg-service.git] / plugin / mms_plugin / include / MmsPluginHttp.h
1 /*
2 * Copyright 2012  Samsung Electronics Co., Ltd
3 *
4 * Licensed under the Flora License, Version 1.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.tizenopensource.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 MMSPLUGINHTTP_H
18 #define MMSPLUGINHTTP_H
19
20 #include <map>
21
22 #include "MsgDebug.h"
23 #include "MmsPluginTypes.h"
24 #include "MsgMutex.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30
31 #ifdef __cplusplus
32 }
33 #endif
34
35
36 class MmsPluginHttpAgent
37 {
38         public:
39                 static MmsPluginHttpAgent *instance();
40
41                 int cmdRequest(MMS_HTTP_CMD_TYPE_T cmdType);
42
43                 int setSession(mmsTranQEntity *qEntity);
44
45                 void clearSession();
46
47                 void SetMMSProfile();
48
49                 MMS_PLUGIN_HTTP_DATA_S *getHttpConfigData();
50                 MMS_PLUGIN_HTTP_CONTEXT_S *getMmsPldCd();
51
52                 MMS_PLUGIN_HTTP_DATA_S httpConfigData;
53
54         private:
55                 static MmsPluginHttpAgent *pInstance;
56
57                 MmsPluginHttpAgent();
58                 ~MmsPluginHttpAgent();
59
60                 MMS_PLUGIN_HTTP_CONTEXT_S mmsPlgCd;
61
62                 std::map<MMS_HTTP_CMD_TYPE_T,int(*)(MMS_PLUGIN_HTTP_DATA_S *)> httpCmdHandler;
63 };
64
65
66 #define MSG_MMS_HH_CONTENT_TYPE     "application/vnd.wap.mms-message"
67 #define MSG_MMS_HH_ACCEPT           "application/vnd.wap.mms-message, */*"
68 #define MSG_MMS_HH_CHARSET          "utf-8"
69 #define MSG_MMS_HH_LANGUAGE         "zh-cn, en"
70 #define MSG_MMS_HH_ENCODING         "deflate,gzip"
71
72 #define MSG_MMS_HH_USER_AGENT           "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0"
73 #define MSG_MMS_WAP_PROFILE         ""
74
75 typedef unsigned int MMS_HTTP_HEADER_FIELD_T;
76
77
78 enum _MMS_HTTP_HEADER_FIELD_E {
79         MMS_HH_CONTENT_TYPE,
80         MMS_HH_HOST,
81         MMS_HH_ACCEPT,
82         MMS_HH_ACCEPT_CHARSET,
83         MMS_HH_ACCEPT_LANGUAGE,
84         MMS_HH_ACCEPT_ENCODING,
85         MMS_HH_USER_AGENT,
86         MMS_HH_WAP_PROFILE
87 };
88
89 #endif