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.
18 * @file FNetDns_DnsEventArg.h
19 * @brief This is the header file for the _DnsEventArg Class.
21 * This header file contains declaration of the _DnsEventArg Class.
23 #ifndef _FNET_INTERNAL_DNS_EVENT_ARG_H_
24 #define _FNET_INTERNAL_DNS_EVENT_ARG_H_
26 #include <FBaseDataType.h>
27 #include <FBaseObject.h>
28 #include <FBaseRtIEventArg.h>
30 namespace Tizen { namespace Net
33 //DNS related enum values
35 * @enum NetDnsEventType
36 * Type for specifying the type of %Dns events
41 NET_DNS_EVENT_NONE = 0,
42 NET_DNS_EVENT_HOSTNAME, /** < alias info is expected */
43 NET_DNS_EVENT_ADDRESS /** < Address info is expected */
50 * @brief This class is used as an argument of methods of the IDnsEventListener class.
53 * This class is used as an argument of IDnsEventListener's methods.
54 * When a %Dns event occurs, the _DnsEvent object finds a IDnsEventListener object
55 * which is registered for the Dns object and calls an appropriate method of the listener.
56 * @see IDnsEventListener for example codes
59 : public Tizen::Base::Object
60 , public Tizen::Base::Runtime::IEventArg
65 * This is constructor.
67 _DnsEventArg(result errorCode, IpHostEntry* pIpHostEntry);
70 * This is the class destructor.
72 virtual ~_DnsEventArg(void);
76 * Returns the IpHostEntry which contains the result of the Dns request.
78 * @return An IpHostEntry object which contains a domain name, an associated IP address list and an associated alias list.
79 * In case of error condition, null is returned.
80 * @remark You can refer detailed error cause by calling GetLastError()
81 * @exception E_INVALID_STATE - dns query succeed, but not valid info found
82 * @exception E_OPERATION_FAILED - operation failed, so no IpHostEntry info
83 * @exception E_SUCCESS - DNS query successful
85 IpHostEntry* GetIpHostEntry(void) const;
88 * Returns the cause of a Dns error.
90 * @return See the comment above.
92 result GetError(void) const;
96 * This is constructor.
101 * This is the copy constructor for this class. @n
102 * Do @b not use directly.
104 * @param[in] rhs An instance of _DnsEventArg
106 _DnsEventArg(const _DnsEventArg& rhs);
109 * This is the assignment operator. Do @b not use directly.
111 * @param[in] rhs An instance of _DnsEventArg
113 _DnsEventArg& operator =(const _DnsEventArg& rhs);
116 IpHostEntry* __pIpHostEntry;
122 #endif // _FNET_INTERNAL_DNS_EVENT_ARG_H_