Modify flora license version.
[platform/core/messaging/msg-service.git] / plugin / mms_plugin / include / MmsPluginHttp.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 MMS_PLUGIN_HTTP_H
18 #define MMS_PLUGIN_HTTP_H
19
20 #include <map>
21 #include "MmsPluginTypes.h"
22
23 #define MSG_MMS_HH_CONTENT_TYPE     "application/vnd.wap.mms-message"
24 #define MSG_MMS_HH_ACCEPT           "application/vnd.wap.mms-message, */*"
25 #define MSG_MMS_HH_CHARSET          "utf-8"
26 #define MSG_MMS_HH_LANGUAGE         "zh-cn, en"
27 #define MSG_MMS_HH_ENCODING         "deflate,gzip"
28
29 #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"
30 #define MSG_MMS_WAP_PROFILE         ""
31
32 typedef unsigned int MMS_HTTP_HEADER_FIELD_T;
33
34
35 enum _MMS_HTTP_HEADER_FIELD_E {
36         MMS_HH_CONTENT_TYPE,
37         MMS_HH_HOST,
38         MMS_HH_ACCEPT,
39         MMS_HH_ACCEPT_CHARSET,
40         MMS_HH_ACCEPT_LANGUAGE,
41         MMS_HH_ACCEPT_ENCODING,
42         MMS_HH_USER_AGENT,
43         MMS_HH_WAP_PROFILE
44 };
45
46 class MmsPluginHttpAgent
47 {
48         public:
49                 static MmsPluginHttpAgent *instance();
50
51                 int cmdRequest(MMS_HTTP_CMD_TYPE_T cmdType);
52
53                 int setSession(mmsTranQEntity *qEntity);
54
55                 void clearSession();
56
57                 void SetMMSProfile();
58
59                 MMS_PLUGIN_HTTP_DATA_S *getHttpConfigData();
60                 MMS_PLUGIN_HTTP_CONTEXT_S *getMmsPldCd();
61
62                 MMS_PLUGIN_HTTP_DATA_S httpConfigData;
63
64         private:
65                 static MmsPluginHttpAgent *pInstance;
66
67                 MmsPluginHttpAgent();
68                 ~MmsPluginHttpAgent();
69
70                 MMS_PLUGIN_HTTP_CONTEXT_S mmsPlgCd;
71
72                 std::map<MMS_HTTP_CMD_TYPE_T,int(*)(MMS_PLUGIN_HTTP_DATA_S *)> httpCmdHandler;
73 };
74
75 #endif //MMS_PLUGIN_HTTP_H