2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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 FNetIDnsEventListener.h
20 * @brief This is the header file for the %IDnsEventListener interface.
22 * This header file contains the declarations of the %IDnsEventListener interface.
25 #ifndef _FNET_IDNS_EVENT_LISTENER_H_
26 #define _FNET_IDNS_EVENT_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
30 namespace Tizen { namespace Net
34 * @interface IDnsEventListener
35 * @brief This interface implements listeners for DNS events.
39 * The %IDnsEventListener interface provides methods for creating notifications about different types of DNS events. These events are only sent
40 * out if a listener is added to the DNS object in the Construct() method. When a DNS event is generated, one of these methods is called. The
41 * methods of this interface may be overridden and used in any application that uses DNS.
43 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
45 * @see Tizen::Net::IpHostEntry
47 class _OSP_EXPORT_ IDnsEventListener
48 : virtual public Tizen::Base::Runtime::IEventListener
52 * 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.
56 virtual ~IDnsEventListener(void) {}
60 * Called to notify the result of the Dns request.
64 * @param[in] pIpHostEntry The information on the dns event
65 * @param[in] r The cause of the error
66 * @exception E_SUCCESS The method is successful.
67 * @exception E_IN_PROGRESS A previous request is in progress.
68 * @exception E_INVALID_SERVER The requested server is invalid.
69 * @exception E_INVALID_DOMAIN The requested domain of the server is invalid.
70 * @exception E_NETWORK_UNAVAILABLE The network is unavailable.
71 * @exception E_OUT_OF_MEMORY The memory is insufficient.
72 * @exception E_TIMEOUT An attempt to connect to the server has timed out.
73 * @exception E_NOT_RESPONDING There is no response.
74 * @exception E_DNS_NOT_FOUND The DNS lookup has failed.
75 * @remarks Always check the error code before accessing the result. @n
76 * If @c r is not @c E_SUCCESS, @c ipHostEntry may not exist.
78 virtual void OnDnsResolutionCompletedN(IpHostEntry* pIpHostEntry, result r) = 0;
79 }; // IDnsEventListener
83 #endif // _FNET_IDNS_EVENT_LISTENER_H_