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 FNetLocalDhcpServer.h
20 * @brief This is the header file for the %LocalDhcpServer class.
22 * This header file contains the declarations of the %LocalDhcpServer class.
24 #ifndef _FNET_LOCAL_DHCP_SERVER_H_
25 #define _FNET_LOCAL_DHCP_SERVER_H_
27 #include <FBaseResult.h>
28 #include <FBaseObject.h>
29 #include <FBaseColIList.h>
31 namespace Tizen { namespace Net
34 class ILocalDhcpServerEventListener;
35 class _LocalDhcpServerImpl;
37 * @class LocalDhcpServer
38 * @brief This class provides methods for managing the local DHCP server.
42 * The %LocalDhcpServer class provides methods for managing the local DHCP server. The Wi-Fi Direct or USB NDIS requires the local DHCP server
43 * for data communication.
45 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/local_DHCP_server_access.htm">Local DHCP Server Access</a>.
47 class _OSP_EXPORT_ LocalDhcpServer
48 : public Tizen::Base::Object
52 * This destructor overrides Tizen::Base::Object::~Object().
56 virtual ~LocalDhcpServer(void);
59 * Gets a singleton instance of %LocalDhcpServer that it associated with the specified network connection.
63 * @return An instance of %LocalDhcpServer
64 * @param[in] netConnection A run-time session where a local DHCP server used
65 * @exception E_SUCCESS The method is successful.
66 * @exception E_INVALID_ARG The specified input parameter is invalid.
67 * @exception E_OUT_OF_MEMORY The memory is insufficient.
68 * @exception E_SYSTEM An internal error has occurred.
69 * @remarks The specific error code can be accessed using the GetLastResult() method.
71 static LocalDhcpServer* GetInstance(const NetConnection& netConnection);
75 * Sets a listener instance for the events about a local DHCP server.
79 * @param[in] pListener An instance of ILocalDhcpServerEventListener @n
80 * If it is @c null, it will reset the event listener.
81 * @return An error code
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_INVALID_STATE This instance has not been constructed as yet.
84 * @exception E_SYSTEM An internal error has occurred.
85 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, @n
86 * because the caller thread is a worker thread.
88 result SetLocalDhcpServerEventListener(ILocalDhcpServerEventListener* pListener);
92 * Gets a list of all the client information on the local DHCP server.
96 * @return An IList containing indexes to the DhcpClientInfo on the local DHCP server
97 * @exception E_SUCCESS The method is successful.
98 * @exception E_INVALID_STATE This instance is in an invalid state.
99 * @exception E_OUT_OF_MEMORY The memory is insufficient.
100 * @exception E_SYSTEM An internal error has occurred.
101 * @remarks In case of an error or if there is no active connection for the local DHCP server, @c null is returned.
102 * The specific error code can be accessed using the GetLastResult() method.
104 Tizen::Base::Collection::IList* GetDhcpClientInfoListN(void) const;
108 * This default constructor is intentionally declared as private so that only the platform can create an instance.
110 LocalDhcpServer(void);
113 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
115 * @param[in] rhs An instance of %LocalDhcpServer
117 LocalDhcpServer(const LocalDhcpServer& rhs);
120 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
122 * @param[in] rhs An instance of %LocalDhcpServer
124 LocalDhcpServer& operator =(const LocalDhcpServer& rhs);
127 _LocalDhcpServerImpl* __pLocalDhcpServerImpl;
128 friend class _LocalDhcpServerImpl;
129 }; // LocalDhcpServer
133 #endif // _FNET_LOCAL_DHCP_SERVER_H_