2 // Open Service Platform
\r
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Flora License, Version 1.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://floralicense.org/license/
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an AS IS BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
19 * @file FNetManagedNetConnection.h
\r
20 * @brief This is the header file for the %ManagedNetConnection class.
\r
22 * This header file contains the declarations of the %ManagedNetConnection class.
\r
24 #ifndef _FNET_MANAGED_NET_CONNECTION_H_
\r
25 #define _FNET_MANAGED_NET_CONNECTION_H_
\r
28 #include <FNetNetTypes.h>
\r
29 #include <FNetNetConnectionInfo.h>
\r
30 #include <FNetIManagedNetConnectionEventListener.h>
\r
32 namespace Tizen { namespace Net
\r
34 class _ManagedNetConnectionImpl;
\r
37 * @class ManagedNetConnection
\r
38 * @brief This class provides methods for the network connection managed by the system.
\r
42 * The %ManagedNetConnection class provides functionalities for accessing the information about the default connection for data communication
\r
43 * managed by the system. Once the connection is established, the applications can use sockets and HTTP interfaces.
\r
45 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/default_network_connection.htm">Default Network Connection</a>.
\r
47 class _OSP_EXPORT_ ManagedNetConnection
\r
48 : public Tizen::Base::Object
\r
52 * This destructor overrides Tizen::Base::Object::~Object().
\r
56 virtual ~ManagedNetConnection(void);
\r
60 * Sets a listener object to the current instance of %ManagedNetConnection.
\r
64 * @param[in] pListener An instance of IManagedNetConnectionEventListener @n
\r
65 * If this is @c null, it will reset the event listener.
\r
66 * @return An error code
\r
67 * @exception E_SUCCESS The method is successful.
\r
68 * @exception E_SYSTEM An internal error has occurred.
\r
69 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, @n
\r
70 * because the caller thread is a worker thread.
\r
72 result SetManagedNetConnectionEventListener(IManagedNetConnectionEventListener* pListener);
\r
75 * Gets the network account on which the current instance is based, to establish a connection with a remote server or a gateway.
\r
79 * @return The NetAccountId of the current instance of %ManagedNetConnection, @n
\r
80 * else @c INVALID_HANDLE if the network connection managed by the system is inactive
\r
81 * @exception E_SUCCESS The method is successful.
\r
82 * @exception E_INVALID_STATE The network connection is inactive.
\r
83 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
85 NetAccountId GetNetAccountId(void) const;
\r
88 * Gets the connection state of the current instance of %ManagedNetConnection.
\r
92 * @return An instance of NetConnectionState specifying the state of the network connection, @n
\r
93 * else @c NET_CONNECTION_STATE_STOPPED if the network connection managed by the system is inactive
\r
95 NetConnectionState GetConnectionState(void) const;
\r
98 * Gets the information about the current network connection.
\r
102 * @return A pointer to an instance of NetConnectionInfo specifying the information about this network connection
\r
103 * @exception E_SUCCESS The method is successful.
\r
104 * @exception E_INVALID_STATE The network connection is inactive.
\r
105 * @remarks This method requires a NetConnectionInfo instance reference.
\r
106 * %NetConnectionInfo is only available when the network connection managed by the system is active. In other states, this returns null.
\r
107 * The specific error code can be accessed using the GetLastResult() method.
\r
108 * @warning Do not delete the returned NetConnectionInfo instance. This instance is directly referencing the internal connectionInfo of
\r
109 * %ManagedNetConnection.
\r
111 const NetConnectionInfo* GetNetConnectionInfo(void) const;
\r
115 * This default constructor is intentionally declared as private so that only the platform can create an instance.
\r
117 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
\r
120 ManagedNetConnection(void);
\r
124 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
\r
126 * @param[in] rhs An instance of %ManagedNetConnection
\r
128 ManagedNetConnection(const ManagedNetConnection& rhs);
\r
131 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
\r
133 * @param[in] rhs An instance of %ManagedNetConnection
\r
135 ManagedNetConnection& operator =(const ManagedNetConnection& rhs);
\r
138 _ManagedNetConnectionImpl* __pManagedNetConnectionImpl;
\r
140 friend class _ManagedNetConnectionImpl;
\r
141 }; // ManagedNetConnection
\r
145 #endif // _FNET_MANAGED_NET_CONNECTION_H_
\r