The download UI application is added.
[apps/web/download-manager.git] / src / include / download-manager-network.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 /**
18  * @file        download-manager-network.h
19  * @author      Jungki Kwak (jungki.kwak@samsung.com)
20  * @brief       Download netowkr manager
21  */
22
23 #ifndef DOWNLOAD_MANAGER_NETWORK_H
24 #define DOWNLOAD_MANAGER_NETWORK_H
25
26 #include "net_connection.h"
27 #include "download-manager-event.h"
28
29 class NetMgr {
30 public:
31         static NetMgr& getInstance(void) {
32                 static NetMgr inst;
33                 return inst;
34         }
35         void initNetwork(void);
36         void deinitNetwork(void);
37         inline void subscribe(Observer *o) { m_subject.attach(o); }
38         inline void deSubscribe(Observer *o) { m_subject.detach(o); }
39         static void netTypeChangedCB(connection_type_e type, void *data);
40         static void netConfigChangedCB(const char *ip,
41                 const char *ipv6, void *data);
42 private:
43         NetMgr(void);
44         ~NetMgr(void);
45         void netTypeChanged(void);
46         void netConfigChanged(string ip);
47         int getConnectionState(void);
48         int getCellularStatus(void);
49         int getWifiStatus(void);
50         void getProxy(void);
51         void getIPAddress(void);
52         inline void notify(void) { m_subject.notify(); }
53         int m_netStatus;
54         Subject m_subject;
55         connection_h m_handle;
56 };
57
58 #endif