Applied latest source code
[apps/native/preloaded/Settings.git] / inc / StWifiPresentationModel.h
1 //
2 // Copyright (c) 2012 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 /**
18  * @file                StWifiPresentationModel.h
19  * @brief               This is the header file for WifiPresentationModel class.
20  */
21
22 #ifndef _ST_WIFI_PRESENTATION_MODEL_H_
23 #define _ST_WIFI_PRESENTATION_MODEL_H_
24
25 #include <FNet.h>
26 #include "StIWifiPresentationModelEventListener.h"
27
28 class WifiPresentationModel
29         : public Tizen::Net::Wifi::IWifiManagerEventListener
30         , public Tizen::Net::Wifi::IWifiSystemMonitoringEventListener
31 {
32 public:
33         WifiPresentationModel(void);
34         virtual ~WifiPresentationModel(void);
35
36         result ActivateWifi(void);
37         result DeactivateWifi(void);
38         result ScanWifi(void);
39         bool IsWifiConnected(void);
40         result ConnectToAccessPointListAt(int index);
41         result SetWifiActivateScanMode(Tizen::Net::Wifi::WifiSystemScanMode wifiSystemScanMode);
42         result SetWifiBssInfoList(const Tizen::Base::Collection::IList* pWifiBssInfoList);
43         result SetWifiBssUnknownAt(int index);
44         Tizen::Base::String GetWifiMacAddress(void);
45
46         bool IsWifiActivated(void);
47         int GetAccessPointCount(void);
48         bool IsWifiBssInfoConnect(int index);
49         Tizen::Net::Wifi::WifiBssInfo* GetWifiBssInfoInAccessPointListAt(void);
50         Tizen::Net::Wifi::WifiBssInfo* GetWifiBssInfoListAt(int index);
51         Tizen::Base::String GetSsidInAccessPointListAt(int index);
52         long GetRssiInAccessPointListAt(int index);
53         Tizen::Net::Wifi::WifiAuthenticationType GetAuthenticationtypeInAccessPointListAt(int index);
54         WifiPresentationModelEvent GetWifiEventInProgress(void);
55
56         void SetWifiEventListener(const IWifiPresentationModelEventListener* pWifiEventListener);
57
58         static WifiPresentationModel* GetInstance(void);
59
60 protected:
61         result Construct(void);
62         void RemoveAccessPointList(void);
63         void SetAccessPointList(Tizen::Base::Collection::IList* pWifiBssInfoList);
64         void SetWifiEventInProgress(WifiPresentationModelEvent setEventInProgress);
65
66         result FireWifiEvnet(WifiPresentationModelEvent wifiEvent, result r = E_SUCCESS);
67
68         virtual void OnWifiActivated(result r);
69         virtual void OnWifiDeactivated(result r);
70         virtual void OnWifiConnected(const Tizen::Base::String& ssid, result r);
71         virtual void OnWifiDisconnected(void);
72         virtual void OnWifiRssiChanged(long rssi);
73         virtual void OnWifiScanCompletedN(const Tizen::Base::Collection::IList* pWifiBssInfoList, result r);
74         virtual void OnWifiConnectionStateChanged(Tizen::Net::Wifi::WifiConnectionState state);
75         virtual void OnWifiSystemScanResultUpdated(void);
76
77         static void CreateInstance(void);
78         static void DestroyInstance(void);
79
80 protected:
81         Tizen::Net::Wifi::WifiManager* __pWifiManager;
82         Tizen::Base::Collection::IList* __pAccessPointList;
83         const IWifiPresentationModelEventListener* __pIWifiPresentationModelEventListener;
84         WifiPresentationModelEvent __wifiEventInProgress;
85
86         static WifiPresentationModel* __pWifiPresentationModelInstance;
87 };
88
89 #endif // _ST_WIFI_PRESENTATION_MODEL_H_