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_LocalDhcpServerEvent.h
19 * @brief This is the header file for the _LocalDhcpServerEvent class.
21 * This header file contains declaration of the _LocalDhcpServerEvent class.
22 * The __LocalDhcpServerEvent class can call a method of a listener (ILocalDhcpServerEventListener object).
23 * So, when a dhcp server event occurs, an application can handle it appropriately.
26 #ifndef _FNET_INTERNAL_LOCAL_DHCP_SERVER_EVENT_H_
27 #define _FNET_INTERNAL_LOCAL_DHCP_SERVER_EVENT_H_
29 #include <FBaseDataType.h>
30 #include <FBaseRt_Event.h>
32 namespace Tizen { namespace Net
34 class LocalDhcpServer;
35 class _LocalDhcpServerImpl;
36 class ILocalDhcpServerEventListener;
40 * @class _LocalDhcpServerEvent
41 * @brief This class handles dhcp server events.
44 * When a dhcp server event occurs, the _LocalDhcpServerEvent class finds a listener and calls
45 * the appropriate method of the listener.
48 class _LocalDhcpServerEvent
49 : public Tizen::Base::Runtime::_Event
53 * This is the default class constructor.
55 * @remarks After creating an instance of this class, you must explicitly call
56 * construction methods to initialize the instance.
58 _LocalDhcpServerEvent(void);
61 * This is the class destructor.
63 virtual ~_LocalDhcpServerEvent(void);
66 * Initializes a new instance of the __LocalDhcpServerEvent class
68 * @return The error code
69 * @param[in] localDhcpServer An LocalDhcpServer object whose events are processed
70 * @exception E_SUCCESS - This method is successful.
71 * @exception E_INVALID_ARG - The argument passed to a method contains an invalid value.
72 * @exception E_OUT_OF_MEMORY - Failed to allocate required/requested memory.
73 * @exception E_SYSTEM - Internal error (System)
76 result Construct(const LocalDhcpServer& localDhcpServer);
80 * Gets an associated LocalDhcpServer object
82 * @return The LocalDhcpServer object 's pointer whose events are processed. If error happens, null is returned.
83 * @exception E_SUCCESS - This method is successful.
84 * @exception E_INVALID_STATE - succeed, but not valid info found
85 * @remark You can refer GetLastResult() for detailed error cause.
87 LocalDhcpServer* GetLocalDhcpServer(void) const;
90 * Sets a listener instance for events about a local DHCP server.
92 * @param[in] pListener An instance of ILocalDhcpServerEventListener if an argument is null, it will reset the event listener.
93 * @return An error code
94 * @exception E_SUCCESS The method was successful.
95 * @exception E_INVALID_STATE This instance has not been constructed as yet.
96 * @exception E_SYSTEM An internal error occurred.
98 result SetEventListener(ILocalDhcpServerEventListener* pListener);
102 * Checks the arg and finds out the type of event. After that this method calls appropriate
103 * pListener's method.
105 * @return A result code.
106 * @param[in] pListener It is a event listener related to this Http event.
107 * @param[in] arg It is an argument-like instance of Http event retransmitted to the listener's method as an argument.
108 * @exception E_SUCCESS - The method is successful.
109 * @exception E_INVALID_ARG - The argument passed to a method contains an invalid value.@n
111 void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
115 * This is the copy constructor for this class. @n
116 * Do @b not use directly.
118 * @param[in] rhs An instance of __LocalDhcpServerEvent
120 _LocalDhcpServerEvent(const _LocalDhcpServerEvent& rhs);
123 * This is the assignment operator. Do @b not use directly.
125 * @param[in] rhs An instance of __LocalDhcpServerEvent
127 _LocalDhcpServerEvent& operator =(const _LocalDhcpServerEvent& rhs);
130 LocalDhcpServer* __pLocalDhcpServer; //for reference
131 ILocalDhcpServerEventListener* __pLocalDhcpServerEventListener;
133 friend class _LocalDhcpServerImpl;
134 }; // _LocalDhcpServerEvent
137 #endif // _FNET_INTERNAL_DHCP_SERVER_EVENT_H_