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 FNet_DnsImpl.h
19 * @brief This is the header file for the _DnsImpl class.
21 * This header file contains the declarations of the _DnsImpl Class.
24 #ifndef _FNET_INTERNAL_DNS_IMPL_H_
25 #define _FNET_INTERNAL_DNS_IMPL_H_
27 #include <FBaseDataType.h>
28 #include <FBaseObject.h>
29 #include "FNet_NetUtility.h"
31 namespace Tizen { namespace Base
36 namespace Tizen { namespace Base { namespace Collection
39 } } } // Tizen::Base::Collection
41 namespace Tizen { namespace Net
46 class NetConnectionManager;
47 class ManagedNetConnection;
48 class IDnsEventListener;
50 class _DnsManagedNetConnectionEventListener;
53 : public Tizen::Base::Object
58 * This is the default constructor for this class.
61 * @remarks After creating an instance of this class, you must explicitly call the
62 * Construct() method to initialize the instance.
68 * This is the destructor for this class.
72 virtual ~_DnsImpl(void);
75 * Initializes this instance of Dns with the specified parameters.
77 * @see Dns::Construct()
79 * @return An error code
82 result Construct(const NetConnection& netConnection, IDnsEventListener& listener);
85 * Initializes this instance of Dns with the specified listener.
87 * @see Dns::Construct()
89 * @return An error code
91 result Construct(IDnsEventListener& listener);
95 * Requests a DNS lookup by IP address. This method is asynchronous.
97 * @see Dns::GetHostByName()
99 * @return An error code
101 result GetHostByName(const Tizen::Base::String& hostName);
104 * Requests a DNS lookup by IP address. This method is asynchronous.
106 * @see Dns::GetHostByAddress()
108 * @return An error code
110 result GetHostByAddress(const IpAddress& ipAddress);
114 * Gets the Impl instance.
117 * @return The pointer to _DnsImpl
118 * @param[in] pDns An instance of Dns
120 static _DnsImpl* GetInstance(Dns& dns);
123 * Gets the Impl instance.
126 * @return The pointer to _DnsImpl
127 * @param[in] pDns An instance of Dns
129 static const _DnsImpl* GetInstance(const Dns& dns);
133 * This is the copy constructor for this class. @n
134 * Do @b not use directly.
136 * @param[in] rhs An instance of Dns
138 _DnsImpl(const _DnsImpl& rhs);
141 * This is the assignment operator. Do @b not use directly.
143 * @param[in] rhs An instance of Dns
145 _DnsImpl& operator =(const _DnsImpl& rhs);
148 Tizen::Net::NetConnection* __pNetConnection;
149 std::unique_ptr<_DnsEvent> __pDnsEvent;
150 std::unique_ptr<Tizen::Base::Collection::ArrayList, _CollectionDeleter> __pDnsRequestHandlerList; // List of Runnable to handle requests asynchronously
151 std::unique_ptr<_DnsManagedNetConnectionEventListener> __pManagedNetConnectionEventListener;
152 std::unique_ptr<ManagedNetConnection> __pManagedNetConnection;
157 #endif // _FNET_INTERNAL_DNS_IMPL_H_