2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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
9 // http://floralicense.org/license/
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.
19 * @file FNetIManagedNetConnectionEventListener.h
20 * @brief This is the header file for the %IManagedNetConnectionEventListener interface.
22 * This header file contains the declarations of the %IManagedNetConnectionEventListener interface.
25 #ifndef _FNET_IMANAGED_NET_CONNECTION_EVENT_LISTENER_H_
26 #define _FNET_IMANAGED_NET_CONNECTION_EVENT_LISTENER_H_
29 #include <FNetNetTypes.h>
31 namespace Tizen { namespace Net
33 class ManagedNetConnection;
35 * @interface IManagedNetConnectionEventListener
36 * @brief This interface is the listener for network connection events.
40 * The %IManagedNetConnectionEventListener interface specifies the methods used to create the notifications about the different kinds of network
41 * connection events. These events are sent only when %IManagedNetConnectionEventListener is added to the ManagedNetConnection instance, and
42 * this is done by invoking the ManagedNetConnection::SetManagedNetConnectionEventListener() method. A method of this interface is called when a network connection
45 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/managing_network_connections.htm">Managing Network Connections</a>.
47 class _OSP_EXPORT_ IManagedNetConnectionEventListener
48 : virtual public Tizen::Base::Runtime::IEventListener
51 /** This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
55 virtual ~IManagedNetConnectionEventListener(void) {}
59 * Called to notify that the bearer has been changed. @n
60 * An application can send or receive the data through the Socket or HTTP methods and can obtain the information related to the changed bearer.
64 * @param[in] managedNetConnection The network connection managed by the system
66 virtual void OnManagedNetConnectionBearerChanged(ManagedNetConnection& managedNetConnection) = 0;
69 * Called to notify the application that the network connection has been opened and connected. @n
70 * An application can then send or receive the data.
74 * @param[in] managedNetConnection The network connection managed by the system
76 virtual void OnManagedNetConnectionStarted(ManagedNetConnection& managedNetConnection) = 0;
79 * Called to notify that the network connection has been closed and disconnected.
83 * @param[in] managedNetConnection The network connection managed by the system
84 * @param[in] reason A reason code for the error
85 * @exception NET_CONNECTION_STOPPED_REASON_RESOURCE_RELEASED The network connection managed by the system has stopped because network resources have been released.
86 * @exception NET_CONNECTION_STOPPED_REASON_NETWORK_FAILED The network has failed.
87 * @exception NET_CONNECTION_STOPPED_REASON_DEVICE_OFFLINE The device is in the offline mode.
88 * @exception NET_CONNECTION_STOPPED_REASON_SERVICE_UNAVAILABLE The device is out of the coverage area or in the emergency mode.
89 * @exception NET_CONNECTION_STOPPED_REASON_RESOURCE_UNAVAILABLE The network resource is unavailable.
90 * @exception NET_CONNECTION_STOPPED_REASON_SYSTEM A system error has occurred.
92 virtual void OnManagedNetConnectionStopped(ManagedNetConnection& managedNetConnection, NetConnectionStoppedReason reason) = 0;
95 * Called to notify the application that the connection status has been changed or is in an unstable or suspended state. @n
96 * Thus an application may neither send nor receive data through the Socket or Http until the network connection is resumed.
100 * @param[in] managedNetConnection The network connection managed by the system
102 virtual void OnManagedNetConnectionSuspended(ManagedNetConnection& managedNetConnection) = 0;
105 * Called to notify the application that the network has recovered from a suspended state. @n
106 * Thus an application can send or receive data through the Socket or Http from now on.
110 * @param[in] managedNetConnection The network connection managed by the system
112 virtual void OnManagedNetConnectionResumed(ManagedNetConnection& managedNetConnection) = 0;
115 // Reserved virtual methods for later extension.
118 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
120 // This method is reserved and may change its name at any time without prior notice.
124 virtual void IManagedNetConnectionEventListener_Reserved1(void) {}
127 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
129 // This method is reserved and may change its name at any time without prior notice.
133 virtual void IManagedNetConnectionEventListener_Reserved2(void) {}
136 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
138 // This method is reserved and may change its name at any time without prior notice.
142 virtual void IManagedNetConnectionEventListener_Reserved3(void) {}
143 }; // IManagedNetConnectionEventListener
146 #endif // _FNET_IMANAGED_NET_CONNECTION_EVENTLISTENER_H_