Merge "Add the exception handling when using manual cert mode" into tizen_2.1
[platform/framework/native/net.git] / src / FNet_WifiSystemNetConnection.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FNet_WifiSystemNetConnection.h
19  * @brief       This is the header file for the %_WifiSystemNetConnection class.
20  *
21  * This header file contains the declarations of the %_WifiSystemNetConnection class.
22  */
23
24 #ifndef _FNET_INTERNAL_WIFI_SYSTEM_NET_CONNECTION_H_
25 #define _FNET_INTERNAL_WIFI_SYSTEM_NET_CONNECTION_H_
26
27 #include <FBase.h>
28 #include <FApp_IAppEventListener.h>
29 #include "FNet_SystemNetConnection.h"
30 #include "FNet_NetUtility.h"
31
32 namespace Tizen { namespace Net {
33 /**
34  * @class       _WifiSystemNetConnection
35  * @brief       This class provides methods for a Wifi system network connection.
36  *
37  * @since 2.1
38  *
39  * This class provides methods for a system network connection.
40  */
41
42 class _WifiSystemNetConnection
43         : public _SystemNetConnection
44         , public Tizen::App::_IAppEventListener
45         , virtual public Tizen::Base::Runtime::ITimerEventListener
46 {
47 public:
48         /**
49          * This is the default constructor for this class.
50          */
51                 _WifiSystemNetConnection(void);
52
53         /**
54          * This is the destructor for this class.
55          */
56         virtual ~_WifiSystemNetConnection(void);
57
58         /**
59          * Initializes a default instance.
60          *
61          * @since 2.1
62          *
63          * @return              An error code
64          * @exception   E_SUCCESS                       The method was successful.
65          * @exception   E_INVALID_STATE         This instance is in an invalid state.
66          * @exception   E_INVALID_ACCOUNT       The specified network account is invalid.
67          * @exception   E_SYSTEM                        An internal error occurred.
68          */
69         result Construct(void);
70
71         /**
72          * Starts the network connection.
73          *
74          * @since                       3.0
75          *
76          * @return                      An error code
77          * @exception   E_SUCCESS                               The method was successful.
78          * @exception   E_INVALID_STATE         This instance is in an invalid state.
79          * @exception   E_SYSTEM                                        An internal error occurred.
80          * @see                 Stop()
81          */
82         virtual result Start(_NetConnectionEvent& event);
83
84         virtual void HandleStartResponse(result error, void* pData);
85
86         virtual void OnApplicationLaunched(const Tizen::App::AppId& appId, int pid);
87         virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, int pid);
88
89         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
90
91         void UpdateConnectionInfo(void* pData);
92
93         void* GetConnectionHandle(void) const;
94
95 private:
96         /**
97          * This is the copy constructor for this class.
98          *
99          * @param[in]   rhs                     An instance of _WifiSystemNetConnection
100          */
101         _WifiSystemNetConnection(const _WifiSystemNetConnection& rhs);
102
103         /**
104          * This is the assignment operator. Do @b not use directly.
105          *
106          * @param[in]   rhs                             An instance of _WifiSystemNetConnection
107          */
108         _WifiSystemNetConnection& operator =(const _WifiSystemNetConnection& rhs);
109
110 private:
111         std::unique_ptr<void, _ConnectionDeleter> __pConnectionHandle;
112         std::unique_ptr<Tizen::Base::Runtime::Timer> __pTimer;
113
114 }; // _WifiSystemNetConnection
115
116 } }  // Tizen::Net
117 #endif // _FNET_INTERNAL_WIFI_SYSTEM_NET_CONNECTION_H_
118