Fix issue : fail to make thumbnail
[platform/core/messaging/msg-service.git] / plugin / mms_plugin / include / MmsPluginConnManWrapper.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 MMS_PLUGIN_CONNMAN_H
18 #define MMS_PLUGIN_CONNMAN_H
19
20 #include "MsgMutex.h"
21 #include "net_connection.h"
22
23 typedef enum {
24         MSG_CM_ERR_NONE = 0,
25         MSG_CM_ERR_UNKNOWN,
26  } cm_error_e;
27
28 class MmsPluginCmAgent {
29 public:
30         static MmsPluginCmAgent *instance();
31
32         bool open();
33         void close();
34
35         bool getCmStatus() { return isCmOpened; }
36
37         void connection_profile_open_callback(connection_error_e result, void* user_data);
38         void connection_profile_close_callback(connection_error_e result, void* user_data);
39         void connection_profile_state_changed_cb(connection_profile_state_e state, void* user_data);
40         bool getInterfaceName(const char **deviceName);
41         bool getProxyAddr(const char **proxyAddr);
42         bool getHomeUrl(const char **homeURL);
43         bool getDnsAddrList(const char **dnsAddrList);
44
45 private:
46         MmsPluginCmAgent();
47         ~MmsPluginCmAgent();
48
49         static MmsPluginCmAgent *pInstance;
50
51         void lock() { mx.lock(); }
52         void unlock() { mx.unlock(); }
53         void signal() { cv.signal(); }
54
55         void setCmStatus() { isCmOpened = true; }
56         void resetCmStatus() { isCmOpened = false; }
57
58         bool isCmOpened; /* connection & profile connect */
59         bool waitProfileOpen;
60         char *home_url;
61         char *interface_name;
62         char *proxy_address;
63         char *dns_address_list;
64         MsgMutex mx;
65         MsgCndVar cv;
66 };
67
68 #endif /* MMS_PLUGIN_CONNMAN_H */