Initialize Tizen 2.3
[framework/osp/net.git] / inc / FNetWifiWifiDirectGroupClient.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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    FNetWifiWifiDirectGroupClient.h
19  * @brief   This is the header file for the %WifiDirectGroupClient class.
20  *
21  * This header file contains the declarations of the %WifiDirectGroupClient class.
22  */
23 #ifndef _FNET_WIFI_WIFI_DIRECT_GROUP_CLIENT_H_
24 #define _FNET_WIFI_WIFI_DIRECT_GROUP_CLIENT_H_
25
26 #include <FNetWifiWifiDirectGroupMember.h>
27
28 namespace Tizen { namespace Net { namespace Wifi
29 {
30 class _WifiDirectGroupClientImpl;
31
32 /**
33  * @if OSPDEPREC
34  * @class        WifiDirectGroupClient
35  * @brief        <i> [Deprecated] </i> This class provides methods for Wi-Fi Direct group client management.
36  * @deprecated   This method is deprecated because the Wi-Fi Direct APIs have been revised to allow the use of APIs
37  *               with ease irrespective of the role (for example, group owner, group client, and so on). @n
38  *               Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role and so it was necessary to
39  *               use these APIs.@n
40  *               As the APIs have been integrated into WifiDirectDevice class, use %WifiDirectDevice class instead.
41  *
42  * @since        2.0
43  *
44  * The %WifiDirectGroupClient class provides methods to manage the Wi-Fi Direct client.
45  *
46  * For more information on the class features, see
47  * <a href="../org.tizen.native.appprogramming/html/guide/net/wi-fi_direct_connectivity.htm">Wi-Fi Direct Connectivity</a>.
48  * @endif
49  */
50
51 class _OSP_EXPORT_ WifiDirectGroupClient
52         : public WifiDirectGroupMember
53 {
54 public:
55    /**
56         * @if OSPDEPREC
57         * This is the destructor for this class.
58         *
59         * @brief       <i> [Deprecated] </i>
60         * @deprecated  The %WifiDirectGroupClient class is deprecated, therefore, this method is also deprecated. @n
61         *              Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group
62         *              owner, group client, and so on) and so it was necessary to use these APIs. @n
63         *              Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role.
64         *
65         * @since       2.0
66         * @endif
67         */
68         virtual ~WifiDirectGroupClient(void);
69
70    /**
71         * @if OSPDEPREC
72         * Closes the connection.
73         *
74         * @brief       <i> [Deprecated] </i>
75         * @deprecated  The %WifiDirectGroupClient class is deprecated. Therefore, this method is also deprecated, because
76         *              previously the Wi-Fi Direct APIs were provided depending on the role(e.g. group owner, group client).@n
77         *              So it was necessary to use APIs in accordance with the strict role; however, it has been revised to
78         *              allow using APIs with ease without discerning the role. @n
79         *              It is integrated into the WifiDirectDevice class. Use the WifiDirectDevice::Disconnect() method.
80         *
81         * @since       2.0
82         * @privlevel   public
83         * @privilege   %http://tizen.org/privilege/wifi.wifidirect.admin
84         *
85         * @return      An error code
86         * @exception   E_SUCCESS           The method is successful.
87         * @exception   E_SYSTEM            A system error has occurred.
88         * @exception   E_IN_PROGRESS       A previous request is in progress.
89         * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
90         *                                  For example, when the member type of a device is not a Wi-Fi Direct group client.
91         * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
92         * @see         IWifiDirectGroupClientListener::OnWifiDirectAssociationTerminated()
93         * @endif
94         */
95         result Disassociate(void);
96
97    /**
98         * @if OSPDEPREC
99         * Requests the WifiDirectDeviceInfo of the Wi-Fi Direct group owner.
100         *
101         * @brief       <i> [Deprecated] </i>
102         * @deprecated  The %WifiDirectGroupClient class is deprecated. Therefore, this method is also deprecated, because
103         *              previously the Wi-Fi Direct APIs were provided depending on the role(e.g. group owner, group client) @n
104         *              so it was necessary to use APIs in accordance with the strict role; however, it has been revised to
105         *              allow using APIs with ease without discerning the role. @n
106         *              Instead of using this method, use the WifiDirectDevice::GetGroupOwnerInfoN() method.
107         *
108         * @since       2.0
109         * @privlevel   public
110         * @privilege   %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection
111         *              and %http://tizen.org/privilege/socket @n
112         *              All the above privileges are required.
113         *
114         * @return      An error code
115         * @param[in]   portNumber           The port number to connect to the group member information service
116         * @exception   E_SUCCESS            The method is successful.
117         * @exception   E_SYSTEM             A system error has occurred.
118         * @exception   E_IN_PROGRESS        The previous request for the group owner information is in progress.
119         * @exception   E_INVALID_OPERATION  The current state of the instance prohibits the execution of this operation. @n
120         *                                   For example, when the member type of a device is not a Wi-Fi Direct group client.
121         * @exception   E_OUT_OF_RANGE       The specified port number is either less than @c 1024 or greater than @c 65535.
122         * @exception   E_PRIVILEGE_DENIED   The application does not have the privilege to call this method.
123         * @exception   E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
124         *
125         * @remarks     The port number used by the group owner must be specified if the group owner changes the port number
126         *              in WifiDirectGroupOwner::StartGroupMemberInfoService().
127         * @see         IWifiDirectGroupClientListener::OnWifiDirectGroupOwnerInfoReceived()
128         * @endif
129         */
130         result RequestGroupOwnerInfo(int portNumber = DEFAULT_PORT);
131
132    /**
133         * @if OSPDEPREC
134         * Requests the WifiDirectDeviceInfo list of the Wi-Fi Direct group members.
135         *
136         * @brief       <i> [Deprecated] </i>
137         * @deprecated  %WifiDirectGroupClient class is deprecated, therefore, this method is also deprecated. @n
138         *              Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group
139         *              owner, group client, and so on) and so it was necessary to use these APIs. @n
140         *              Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the
141         *              role. @n
142         *
143         * @since       2.0
144         * @privlevel   public
145         * @privilege   %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection
146         *              and %http://tizen.org/privilege/socket @n
147         *              All the above privileges are required.
148         *
149         * @return      An error code
150         * @param[in]   portNumber           The port number to connect to the group member information service
151         * @exception   E_SUCCESS            The method is successful.
152         * @exception   E_SYSTEM             A system error has occurred.
153         * @exception   E_IN_PROGRESS        The previous request for the group owner information is in progress.
154         * @exception   E_INVALID_OPERATION  The current state of the instance prohibits the execution of this operation. @n
155         *                                   For example, when the member type of a device is not a Wi-Fi Direct group client.
156         * @exception   E_OUT_OF_RANGE       The specified port number is either less than @c 1024 or greater than @c 65535.
157         * @exception   E_PRIVILEGE_DENIED   The application does not have the privilege to call this method.
158         * @exception   E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1
159         * @remarks     The port number used by the group owner should be specified if the group owner changed the port
160         *              number in WifiDirectGroupOwner::StartGroupMemberInfoService().
161         * @see         IWifiDirectGroupClientListener::OnWifiDirectAllGroupMemberInfoReceivedN()
162         * @endif
163         */
164         result RequestAllGroupMemberInfo(int portNumber = DEFAULT_PORT);
165
166 private:
167         /**
168          * This default constructor is intentionally declared as private so that only the platform can create an instance.
169          *
170          * @remarks     After creating an instance of this class, the Construct() method must be called explicitly
171          *              to initialize this instance.
172          *
173          * @see         Construct()
174          */
175         WifiDirectGroupClient(void);
176
177         /**
178          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
179          *
180          * @param[in]   value                An instance of %WifiDirectGroupClient
181          */
182         WifiDirectGroupClient(const WifiDirectGroupClient& value);
183
184         /**
185          * Initializes this instance of %WifiDirectGroupClient with the specified parameter.
186          *
187          * @return An error code
188          *
189          * @param[in]   wifiDirectGroupClientImpl A reference to the _WifiDirectGroupClientImpl instance
190          * @exception   E_SUCCESS            The method is successful.
191          * @exception   E_SYSTEM             A system error has occurred.
192          */
193         result Construct(_WifiDirectGroupClientImpl& wifiDirectGroupClientImpl);
194
195         /**
196         * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit
197         * copying of objects.
198         *
199         * @param[in]   rhs                   An instance of %WifiDirectGroupClient
200         */
201         WifiDirectGroupClient& operator=(const WifiDirectGroupClient& rhs);
202
203 private:
204         static const int DEFAULT_PORT = 3895;
205
206         _WifiDirectGroupClientImpl* __pWifiDirectGroupClientImpl;
207
208         friend class _WifiDirectGroupClientImpl;
209 }; // WifiDirectGroupClient
210
211 } } } // Tizen::Net::Wifi
212 #endif // _FNET_WIFI_WIFI_DIRECT_GROUP_CLIENT_H_