Merge "Add the exception handling when using manual cert mode" into tizen_2.1
[platform/framework/native/net.git] / src / FNet_DnsManagedNetConnectionEventListener.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_FNet_DnsManagedNetConnectionEventListener.h
19  * @brief       This is the header file for _DnsManagedNetConnectionEventListener class.
20  * @version     3.0
21  *
22  * This header file contains the declarations of _DnsManagedNetConnectionEventListener class.
23  */
24
25 #ifndef _FNET_INTERNAL_DNS_MANAGED_NET_CONNECTION_EVENT_LISTENER_H_
26 #define _FNET_INTERNAL_DNS_MANAGED_NET_CONNECTION_EVENT_LISTENER_H_
27
28 #include <FBaseDataType.h>
29 #include <FNetIManagedNetConnectionEventListener.h>
30 #include <FNetNetTypes.h>
31
32 namespace Tizen { namespace Base { namespace Collection
33 {
34 class ArrayList;
35 } } } // Tizen::Base::Collection
36
37 namespace Tizen { namespace Net
38 {
39
40 class ManagedNetConnection;
41
42 /**
43 * @class _DnsManagedNetConnectionEventListener
44 * @brief This class is the listener for network connection events.
45 */
46
47 class _DnsManagedNetConnectionEventListener
48         : public IManagedNetConnectionEventListener
49 {
50
51 public:
52         _DnsManagedNetConnectionEventListener(Tizen::Base::Collection::ArrayList* pDnsRequestHandlerList);
53
54         virtual ~_DnsManagedNetConnectionEventListener(void);
55
56 public:
57         /**
58          * Called to notify that the bearer has been changed. @n
59          * An application can send or receive the data through the Socket or HTTP methods and can obtain the
60          * information related to the changed bearer.
61          *
62          * @param[in]   managedNetConnection    The network connection managed by the system
63          */
64         void OnManagedNetConnectionBearerChanged(ManagedNetConnection& managedNetConnection);
65
66         /**
67          * Called to notify the application that the network connection has been opened and connected. @n
68          * An application can then send or receive the data.
69          *
70          * @param[in]   managedNetConnection    The network connection managed by the system
71          */
72         void OnManagedNetConnectionStarted(ManagedNetConnection& managedNetConnection);
73
74         /**
75          * Called to notify that the network connection has been closed and disconnected.
76          *
77          * @param[in]   managedNetConnection    The network connection managed by the system
78          * @param[in]   reason                  A reason code for the error
79          *
80          */
81         void OnManagedNetConnectionStopped(ManagedNetConnection& managedNetConnection,
82                                                 NetConnectionStoppedReason reason);
83
84         /**
85          * Called to notify the application that the connection status has been changed or is in an unstable or suspended state. @n
86          * Thus an application may neither send nor receive data through the Socket or Http until the network connection is resumed.
87          *
88          * @param[in]   managedNetConnection    The network connection managed by the system
89          */
90         void OnManagedNetConnectionSuspended(ManagedNetConnection& managedNetConnection);
91
92         /**
93          * Called to notify the application that the network has recovered from a suspended state. @n
94          * Thus an application can send or receive data through the Socket or Http from now on.
95          *
96          * @param[in]   managedNetConnection    The network connection managed by the system
97          */
98         void OnManagedNetConnectionResumed(ManagedNetConnection& managedNetConnection);
99
100 private:
101         /**
102          * Default ctor
103          */
104         _DnsManagedNetConnectionEventListener(void);
105
106         /**
107          * This is the copy constructor.
108          *
109          * @param[in]   rhs     An instance of _DnsManagedNetConnectionEventListener
110          * @remarks             The function is declared but not implemented.
111          */
112         _DnsManagedNetConnectionEventListener(const _DnsManagedNetConnectionEventListener& rhs);
113
114         /**
115          * This is the assignment operator.
116          *
117          * @param[in]   rhs             An instance of _DnsManagedNetConnectionEventListener
118          * @remarks             The function is declared but not implemented.
119          */
120         _DnsManagedNetConnectionEventListener& operator =(const _DnsManagedNetConnectionEventListener& rhs);
121
122 private:
123         Tizen::Base::Collection::ArrayList* __pDnsRequestHandlerList; // List of Runnable to handle requests asynchronously, not owned
124         bool __isConnected;
125         friend class _DnsImpl;
126 }; // _DnsManagedNetConnectionEventListener
127
128 } } // Tizen::Net
129
130 #endif // _FNET_INTERNAL_DNS_MANAGED_NET_CONNECTION_EVENT_LISTENER_H_
131