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 FNetWifi_WifiDirectEventArg.h
20 * @brief This is the header file for the _WifiDirectEventArg Class.
22 * This header file contains declaration of the _WifiDirectEventArg Class.
25 #ifndef _FNET_WIFI_INTERNAL_WIFI_DIRECT_EVENT_ARG_H_
26 #define _FNET_WIFI_INTERNAL_WIFI_DIRECT_EVENT_ARG_H_
28 #include <unique_ptr.h>
29 #include <FBaseObject.h>
30 #include <FBaseRtIEventArg.h>
31 #include <FNetWifiWifiTypes.h>
33 namespace Tizen { namespace Base { namespace Collection
37 }}} // Tizen::Base::Collection
40 namespace Tizen { namespace Net
46 class WifiDirectGroupInfo;
47 class WifiDirectDeviceInfo;
48 class WifiDirectGroupMember;
51 * @enum __WifiDirectDeviceEventType
52 * Enumeration type to specify the type of WifiDirect events.
54 enum _WifiDirectEventType
56 WIFI_DIRECT_DEVICE_EVENT_NONE,
57 WIFI_DIRECT_DEVICE_EVENT_ACTIVATED,
58 WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED,
59 WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED,
60 WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND,
61 WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED,
62 WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED,
63 WIFI_DIRECT_DEVICE_EVENT_CONNECTED,
64 WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED,
65 WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED,
66 WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT,
67 WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED,
68 WIFI_DIRECT_GO_EVENT_CLIENT_DISASSOCIATED,
69 WIFI_DIRECT_GO_EVENT_GROUP_DESTROYED,
70 WIFI_DIRECT_GO_EVENT_SERVICE_STARTED,
71 WIFI_DIRECT_GO_EVENT_SERVICE_STOPPED,
72 WIFI_DIRECT_GC_EVENT_DISASSOCIATED,
73 WIFI_DIRECT_GC_EVENT_GROUP_OWNER_INFO_RESPONDED,
74 WIFI_DIRECT_GC_EVENT_GROUP_MEMBER_INFO_LIST_RESPONDED
77 * @class _WifiDirectEventArg
78 * @brief This class is used as an argument of methods of the IWifiDirectDeviceListener class.
80 * This class is used as an argument of IWifiDirectDeviceListener's methods.
81 * When a %WifiDirectDevice event occurs, the __WifiDirectDeviceEvent object finds a IWifiDirectDeviceListener object
82 * which is registered for the WifiDirectDevice object and calls an appropriate method of the listener.
85 class _WifiDirectEventArg
86 : public Tizen::Base::Runtime::IEventArg
87 , public Tizen::Base::Object
91 * This is the default constructor for this class.
93 _WifiDirectEventArg(void);
96 * This is the copy constructor.
98 * @param[in] rhs An instance of %_WifiDirectEventArg
100 _WifiDirectEventArg(const _WifiDirectEventArg& rhs);
103 * This destructor overrides Tizen::Base::Object::~Object().
106 virtual ~_WifiDirectEventArg(void);
109 * This constructor initializes the instance of this class with the specified values.
111 * @param[in] memberType The type of the member.
112 * @param[in] eventType The type of the WifiDirectDeviceEvent.
113 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
114 * @param[in] r The error code.
116 * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_ACTIVATED, WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED,
117 * WIFI_DIRECT_GO_EVENT_GROUP_DESTROYED, WIFI_DIRECT_GO_EVENT_SERVICE_STOPPED
118 * WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED or WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT events.
120 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, result r = E_SUCCESS);
123 * This constructor initializes the instance of this class with the specified values.
125 * @param[in] memberType The type of the member.
126 * @param[in] eventType The type of the WifiDirectDeviceEvent.
127 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
128 * @param[in] wifiDirectGroupInfo A reference to the WifiDirecrGroupInfo instance.
129 * @param[in] wifiDirectGroupOwnerDeviceInfo A reference to the WifiDirectDeviceInfo instance of the group owner.
130 * @param[in] wifiDirectMemberType the type of a Wi-Fi Direct device.
131 * @param[in] r The error code.
133 * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED event.
136 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, const WifiDirectGroupInfo& wifiDirectGroupInfo, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, const WifiDirectGroupMemberType wifiDirectMemberType, result r = E_SUCCESS);
139 * This constructor initializes the instance of this class with the specified values.
141 * @param[in] memberType The type of the member.
142 * @param[in] eventType The type of the WifiDirectDeviceEvent.
143 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
144 * @param[in] pGroupOwnerInfoList The list of WifiDirectDeviceInfo information.
145 * @param[in] pDeviceInfoList The list of WifiDirectDeviceInfo information.
146 * @param[in] r The error code.
148 * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED
149 * or WIFI_DIRECT_GC_EVENT_GROUP_MEMBER_INFO_LIST_RESPONDED event.
151 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, Tizen::Base::Collection::IList* pDeviceInfoList, result r = E_SUCCESS);
154 * This constructor initializes the instance of this class with the specified values.
156 * @param[in] memberType The type of the member.
157 * @param[in] eventType The type of the WifiDirectDeviceEvent.
158 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
159 * @param[in] wifiDirectGroupOwnerDeviceInfo A reference to the WifiDirectDeviceInfo instance of the group owner.
160 * @param[in] r The error code.
162 * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND, WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED, WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED
163 * ,WIFI_DIRECT_GC_EVENT_GROUP_OWNER_INFO_RESPONDED or WIFI_DIRECT_DEVICE_EVENT_CONNECTED event.
165 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& wifiDirectDeviceInfo, result r = E_SUCCESS);
168 * This constructor initializes the instance of this class with the specified values.
170 * @param[in] memberType The type of the member.
171 * @param[in] eventType The type of the WifiDirectGroupOwnerEvent.
172 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
173 * @param[in] wifiDirectDeviceInfo A reference to the WifiDirectDeviceInfo instance.
174 * @param[in] disassociationReason The reason of association termination
175 * @param[in] r The error code.
177 * @remarks This method can be used for WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED or WIFI_DIRECT_GO_EVENT_CLIENT_DISASSOCIATED
179 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& wifiDirectDeviceInfo, WifiDirectAssociationTerminationReason disassociationReason, result r = E_SUCCESS);
182 * This constructor initializes the instance of this class with the specified values.
184 * @param[in] memberType The type of the member.
185 * @param[in] eventType The type of the WifiDirectGroupClientEvent.
186 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
187 * @param[in] disassociationReason The reason of association termination
188 * @param[in] r The error code.
190 * @remarks This method can be used for WIFI_DIRECT_GC_EVENT_DISASSOCIATED event.
192 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, WifiDirectAssociationTerminationReason disassociationReason, result r = E_SUCCESS);
195 * This constructor initializes the instance of this class with the specified values.
197 * @param[in] memberType The type of the member.
198 * @param[in] eventType The type of the WifiDirectGroupClientEvent.
199 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
200 * @param[in] pNetConnection The network connection that started with the Wi-Fi Direct net account.
201 * @param[in] r The error code.
203 * @remarks This method can be used for WIFI_DIRECT_GO_EVENT_SERVICE_STARTED event.
205 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, Tizen::Net::NetConnection* pNetConnection, result r = E_SUCCESS);
208 * This constructor initializes the instance of this class with the specified values.
210 * @param[in] memberType The type of the member.
211 * @param[in] eventType The type of the WifiDirectGroupClientEvent.
212 * @param[in] localDeviceId An Id for a Wi-Fi Direct device.
213 * @param[in] pNetConnection The network connection that started with the Wi-Fi Direct net account.
214 * @param[in] r The error code.
216 * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED event.
218 _WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId, const Tizen::Base::String& remoteDeviceMacAddress, result r = E_SUCCESS);
222 * Sets the group member instance.
224 * @param[in] pGroupMember The WifiDirectGroupMember instance.
226 * @remark This takes the ownership of @c arg. So arg should be created on a heap and should not be deleted.
228 void SetGroupMember(WifiDirectGroupMember* pGroupMember);
231 * Gets the group member instance.
233 * @return WifiDirectGroupMember Group member instance.
236 WifiDirectGroupMember* GetGroupMember(void) const;
239 * Gets the event type.
241 * @return __WifiDirectDeviceEventType Event type of this argument.
243 * @see __WifiDirectDeviceEventType
245 _WifiDirectEventType GetEventType(void) const;
248 * Gets the error code.
250 * @return WifiDirectManagerError Error code of this argument.
252 * @see WifiDirectManagerError
254 result GetError(void) const;
257 * Gets the device Id.
259 * @return The Id of Wi-Fi Direct device.
261 * @see WifiDirectDeviceId
264 WifiDirectDeviceId GetDeviceId(void) const;
267 * Gets the list of WifiDirectDeviceInfo.
269 * @return Pointer to the ArrayList object which contains information of group members' information @n
270 * @c null, if no associated node exists
272 Tizen::Base::Collection::IList* GetDeviceInfoList(void) const;
275 * Gets the WifiDirectGroupInfo.
277 * @return Pointer to the WifiDirectGroupInfo object
280 WifiDirectGroupInfo* GetGroupInfo(void) const;
283 * Gets the WifiDirectDeviceInfo
285 * @return Pointer to the WifiDirectDeviceInfo object
288 WifiDirectDeviceInfo* GetDeviceInfo(void) const;
291 * Gets the WifiDirectGroupMemberType.
293 * @return the type of a Wi-Fi Direct device.
296 WifiDirectGroupMemberType GetGroupMemberType(void) const;
299 * Sets the list of WifiDirectDeviceInfo information
301 * @param[in] pDeviceInfoList Pointer to the ArrayList object which contains information of group members' information.
304 void SetDeviceInfoList(Tizen::Base::Collection::IList* pDeviceInfoList);
307 * Gets the reason of Wi-Fi Direct group client association termination.
309 * @return The reason of association termination
312 WifiDirectAssociationTerminationReason GetDisassociationReason(void) const;
316 * Gets the network connection that started with the Wi-Fi Direct net account.
318 * @return The network connection
321 Tizen::Net::NetConnection* GetNetConnection(void) const;
324 * Gets the mac address of remote device.
326 * @return The mac address
329 Tizen::Base::String GetMacAddress(void) const;
333 * Copying of objects using this copy assignment operator is allowed.
335 * @param[in] rhs An instance of %_WifiDirectEventArg
337 _WifiDirectEventArg& operator =(const _WifiDirectEventArg& rhs);
340 _WifiDirectEventType __eventType;
341 WifiDirectDeviceId __localDeviceId;
344 std::unique_ptr<WifiDirectGroupInfo> __pGroupInfo;
345 std::unique_ptr<WifiDirectDeviceInfo> __pDeviceInfo;
346 std::unique_ptr<Tizen::Base::Collection::ArrayList> __pDeviceInfoList;
348 WifiDirectGroupMemberType __wifiDirectGroupMemberType;
349 WifiDirectAssociationTerminationReason __disassociationReason;
351 Tizen::Net::NetConnection* __pNetConnection;
352 Tizen::Base::String __remoteDeviceMacAddress;
353 WifiDirectGroupMember* __pGroupMember;
355 }; // _WifiDirectEventArg
357 }}} // Tizen::Net::Wifi
359 #endif // _FNET_WIFI_INTERNAL_WIFI_DIRECT_EVENT_ARG_H_