Applied, inspection header : osp-net
[framework/osp/net.git] / inc / FNetWifiIWifiDirectDeviceListener.h
1 // 
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. 
4 // 
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file                FNetWifiIWifiDirectDeviceListener.h
19  * @brief               This is the header file for the %IWifiDirectDeviceListener interface.
20  *
21  * This header file contains the declarations of the %IWifiDirectDeviceListener interface.
22  */
23 #ifndef _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_
24 #define _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_
25
26 #include <FBaseRtIEventListener.h>
27 #include <FNetWifiWifiTypes.h>
28 #include <FNetWifiWifiDirectGroupMember.h>
29
30 namespace Tizen { namespace Base { namespace Collection
31 {
32 class IList;
33 } } } // Tizen::Base::Collection
34
35 namespace Tizen { namespace Net { namespace Wifi
36 {
37 class WifiDirectGroupInfo;
38 class WifiDirectDeviceInfo;
39
40 /**
41  * @interface   IWifiDirectDeviceListener
42  * @brief       This interface implements listeners for the WifiDirectDevice events.
43  *
44  * @since       2.0
45  *
46  * The %IWifiDirectDeviceListener interface represents a listener to get the Wi-Fi Direct device status or information.
47  *
48  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/wi-fi_direct_connectivity.htm">Wi-Fi Direct Connectivity</a>.
49  */
50
51 class _OSP_EXPORT_ IWifiDirectDeviceListener
52         : virtual public Tizen::Base::Runtime::IEventListener
53 {
54 public:
55     /**
56      * This polymorphic destructor should be overridden if required. This way, 
57      * the destructors of the derived classes are called when the destructor of this interface is called.
58      *
59      * @since   2.0
60      */
61     virtual ~IWifiDirectDeviceListener(void) {}
62
63     /**
64      * Called to notify the application that the local Wi-Fi Direct mode is enabled.
65      *
66      * @since 2.0
67      *
68      * @param[in]   localDeviceId       The ID of the Wi-Fi Direct device
69      * @param[in]   r                   An error code
70      * @exception   E_SUCCESS   The activation is successful.
71      * @exception   E_SYSTEM    A system error has occurred.
72      * @see         WifiDirectDevice::Activate()
73      */
74     virtual void OnWifiDirectDeviceActivated(WifiDirectDeviceId localDeviceId, result r) = 0;
75
76     /**
77      * Called to notify the application that the local Wi-Fi Direct mode is disabled.
78      *
79      * @since 2.0
80      *
81      * @param[in]   localDeviceId   An ID for a Wi-Fi Direct device
82      * @param[in]   r               An error code
83      * @exception   E_SUCCESS   The deactivation is successful.
84      * @exception   E_SYSTEM    A system error has occurred.
85      * @see         WifiDirectDevice::Deactivate()
86      */
87     virtual void OnWifiDirectDeviceDeactivated(WifiDirectDeviceId localDeviceId, result r) = 0;
88
89     /**
90      * Called to notify the application when a Wi-Fi Direct connection is established with a remote device.
91      *
92      * @since 2.0
93      *
94      * @param[in]   localDeviceId           An ID for a Wi-Fi Direct device
95      * @param[in]   remoteDeviceInfo        The remote device
96      * @param[in]   r                       An error code
97      *
98      * @exception   E_SUCCESS               The Wi-Fi Direct group has been created successfully.
99      * @exception   E_SYSTEM                A system error has occurred.
100      * @exception   E_OPERATION_CANCELED    The operation has been cancelled explicitly.
101      * @exception   E_AUTHENTICATION        The authentication has failed during the Wi-Fi connection process.
102      * @exception   E_NOT_RESPONDING        The remote device is not responding.
103      * @see       WifiDirectDevice::Connect()
104      * @see       WifiDirectDevice::CancelConnect()
105      */
106     virtual void OnWifiDirectConnected(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo, result r) = 0;
107
108     /**
109      * Called to notify the application when the Wi-Fi Direct connection is disconnected with a peer device.
110      *
111      * @since 2.0
112      *
113      * @param[in]   localDeviceId     An ID for a Wi-Fi Direct device
114      * @param[in]   peerMacAddress    The mac address of the peer device
115      * @param[in]   r              An error code
116      * @exception   E_SUCCESS      The method is successful.
117      * @exception   E_SYSTEM       A system error has occurred.
118      * @see         WifiDirectDevice::Disconnect()
119      */
120     virtual void OnWifiDirectDisconnected(WifiDirectDeviceId localDeviceId, const Tizen::Base::String& peerMacAddress, result r) = 0;
121
122     /**
123       * Called to notify the application when an autonomous group is created.
124       *
125       * @since 2.0
126       *
127       * @param[in]   localDeviceId    An ID for a Wi-Fi Direct device
128       * @param[in]   r                An error code
129       * @exception   E_SUCCESS       The method is successful.
130       * @exception   E_SYSTEM        A system error has occurred.
131       * @see         WifiDirectDevice::CreateAutonomousGroup()
132       */
133     virtual void OnWifiDirectAutonomousGroupCreated(WifiDirectDeviceId localDeviceId, result r) = 0;
134
135     /**
136      * Called to notify the application when a local device leaves the group.
137      *
138      * @since 2.0
139      *
140      * @param[in]   localDeviceId  An ID for a Wi-Fi Direct device
141      * @param[in]   r              An error code
142      * @exception   E_SUCCESS      The method is successful.
143      * @exception   E_SYSTEM       A system error has occurred.
144      * @see         WifiDirectDevice::LeaveGroup()
145      */
146     virtual void OnWifiDirectGroupLeft(WifiDirectDeviceId localDeviceId, result r) = 0;
147
148     /**
149      * @if OSPDEPREC
150      * Called to notify the application about the result and related information when a group is created or when a request to create a group is cancelled.
151      * cancellation.
152      *
153      * @brief   <i> [Deprecated] </i>
154      * @deprecated  This method is deprecated because the Wi-Fi direct APIs have been revised to allow the use of APIs with ease irrespective of the role (for example, group owner, group client, and so on). @n
155          *              Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs. @n
156      *              Instead of using this method, use OnWifiDirectConnected() or OnWifiDirectAutonomousGroupCreated() method.
157      *
158      * @since 2.0
159      *
160      * @param[in]   localDeviceId                   An ID for a Wi-Fi Direct device
161      * @param[in]   wifiDirectGroupInfo             The WifiDirectGroupInfo instance set by the winning group owner after negotiation
162      * @param[in]   wifiDirectGroupOwnerDeviceInfo  The WifiDirectDeviceInfo instance of the group owner
163      * @param[in]   pWifiDirectMember               The WifiDirectGroupMember instance that is casted to the instance of 
164      *                                              WifiDirectGroupOwner or WifiDirectGroupClient as a result of negotiation
165      *                                              after the creation of a group
166      * @param[in]   r                               An error code
167      * @exception   E_SUCCESS                   The Wi-Fi Direct group creation is successful.
168      * @exception   E_SYSTEM                    A system error has occurred.
169      * @exception   E_OPERATION_CANCELED        The operation has been cancelled explicitly.
170      * @exception   E_AUTHENTICATION            The authentication has failed during the Wi-Fi connection process.
171      * @exception   E_DHCP                      The DHCP operation has failed.
172      * @exception   E_NOT_RESPONDING            The target is not responding.
173      * @exception   E_REJECTED                  The connection request has been rejected.
174      * @exception   E_REMOTE_DEVICE_NOT_FOUND   The Wi-Fi Direct device has not been found.
175      * @remarks     If a device becomes a group client, then the WifiDirectGroupInfo::GetGroupOwnerIntent() and WifiDirectGroupInfo::GetMaxNumberOfClients() methods will not contain valid information.
176          * @see         WifiDirectDevice::CreateGroup()
177          * @see                 WifiDirectDevice::CancelGroupCreation()
178          * @endif
179          */
180         virtual void OnWifiDirectGroupCreatedN(WifiDirectDeviceId localDeviceId, const WifiDirectGroupInfo& wifiDirectGroupInfo, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, WifiDirectGroupMember* pWifiDirectMember, result r) { delete pWifiDirectMember; }
181
182     /**
183      * Called to notify the application when the scan is completed.
184      *
185      * @since 2.0
186      *
187      * @param[in]   localDeviceId                   An ID for a Wi-Fi Direct device
188      * @param[in]   pWifiDirectDeviceInfoList       The WifiDirectDeviceInfo information list representing the
189      *                                              Wi-Fi Direct devices discovered by scan
190      * @param[in]   r                               An error code
191      * @exception   E_SUCCESS                       The scan is successful.
192      * @exception   E_SYSTEM                        A system error has occurred.
193      * @exception   E_OPERATION_CANCELED            The operation has been cancelled explicitly.
194      * @see         WifiDirectDevice::Scan()
195      * @see             WifiDirectDevice::CancelScan()
196      */
197     virtual void OnWifiDirectScanCompletedN(WifiDirectDeviceId localDeviceId, Tizen::Base::Collection::IList* pWifiDirectDeviceInfoList, result r) = 0;
198
199     /**
200      * @if OSPDEPREC
201      * Called to notify the application when the connection to a Wi-Fi Direct group owner is completely established.
202      *
203      * @brief   <i> [Deprecated] </i>
204      * @deprecated  This method is deprecated because the Wi-Fi direct APIs have been revised to allow the use of APIs with ease irrespective of the role (for example, group owner, group client, and so on). @n
205          *              Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to use these APIs. @n
206      *              Instead of using this method, use OnWifiDirectConnected() method.
207      *
208      * @since 2.0
209      *
210      * @param[in]    localDeviceId                   An ID for a Wi-Fi Direct device
211      * @param[in]    wifiDirectGroupOwnerDeviceInfo  The WifiDirectDeviceInfo of the connected Wi-Fi Direct group
212      *                                               owner
213      * @param[in]    r                               An error code
214      * @exception    E_SUCCESS                       The association is successful.
215      * @exception    E_SYSTEM                        A system error has occurred.
216      * @exception    E_AUTHENTICATION                The authentication has failed during the Wi-Fi connection process.
217      * @exception    E_DHCP                          The DHCP operation has failed.
218      * @exception    E_NOT_RESPONDING                The target is not responding.
219      * @exception    E_REJECTED                      The connection request has been rejected.
220      * @exception    E_REMOTE_DEVICE_NOT_FOUND       The Wi-Fi Direct device has not been found.
221      * @see          WifiDirectDevice::Associate()
222      * @endif
223      */
224     virtual void OnWifiDirectAssociationCompleted(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, result r) {}
225
226         /**
227      * Called to notify the application when a remote device is found during the Wi-Fi Direct scan process.
228      *
229      * @since 2.1
230      *
231      * @param[in]   localDeviceId      An ID for a Wi-Fi Direct device
232      * @param[in]   remoteDeviceInfo   The remote device that is found
233      * @see         WifiDirectDevice::Scan()
234      */
235      virtual void OnWifiDirectRemoteDeviceFound(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo) {}
236
237 protected:
238     //
239     // This method is for internal use only. Using this method can cause behavioral, security-related,
240     // and consistency-related issues in the application.
241     //
242     // This method is reserved and may change its name at any time without prior notice.
243     //
244     // @since    2.0
245     //
246     virtual void OnWifiDirectDeviceListener_Reserved1(void) {}
247
248     //
249     // This method is for internal use only. Using this method can cause behavioral, security-related,
250     // and consistency-related issues in the application.
251     //
252     // This method is reserved and may change its name at any time without prior notice.
253     //
254     // @since    2.0
255     //
256     virtual void OnWifiDirectDeviceListener_Reserved2(void) {}
257
258     //
259     // This method is for internal use only. Using this method can cause behavioral, security-related,
260     // and consistency-related issues in the application.
261     //
262     // This method is reserved and may change its name at any time without prior notice.
263     //
264     // @since    2.0
265     //
266     virtual void OnWifiDirectDeviceListener_Reserved3(void) {}
267
268     //
269     // This method is for internal use only. Using this method can cause behavioral, security-related,
270     // and consistency-related issues in the application.
271     //
272     // This method is reserved and may change its name at any time without prior notice.
273     //
274     // @since    2.0
275     //
276     virtual void OnWifiDirectDeviceListener_Reserved4(void) {}
277
278 }; // IWifiDirectDeviceListener
279
280 } } } //Tizen::Net::Wifi
281 #endif // _FNET_WIFI_IWIFI_DIRECT_DEVICE_LISTENER_H_