Fixed bug.
[platform/framework/native/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.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://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 the 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
64          *              role. @n
65          *
66          * @since       2.0
67          * @endif
68          */
69         virtual ~WifiDirectGroupClient(void);
70
71         /**
72          * @if OSPDEPREC
73          * Closes the connection.
74          *
75          * @brief       <i> [Deprecated] </i>
76          * @deprecated  The %WifiDirectGroupClient class is deprecated. Therefore, this method is also deprecated, because
77          *              previously the Wi-Fi Direct APIs were provided centered on the role(e.g. group owner, group
78          *              client). @n
79          *              So it was necessary to use APIs in accordance with the strict role; however, it has been revised to
80          *              allow using APIs with ease without discerning the role. @n
81          *              It is integrated into WifiDirectDevice class. Use the WifiDirectDevice::Disconnect() method.
82          *
83          * @since       2.0
84          * @privlevel   public
85          * @privilege   %http://tizen.org/privilege/wifi.wifidirect.admin
86          *
87          * @return      An error code
88          * @exception   E_SUCCESS           The method is successful.
89          * @exception   E_SYSTEM            A system error has occurred.
90          * @exception   E_IN_PROGRESS       A previous request is in progress.
91          * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
92          *                                  For example, when the member type of a device is not a Wi-Fi Direct group client.
93          * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
94          * @see         IWifiDirectGroupClientListener::OnWifiDirectAssociationTerminated()
95          * @endif
96          */
97         result Disassociate(void);
98
99         /**
100          * @if OSPDEPREC
101          * Requests the WifiDirectDeviceInfo of the Wi-Fi Direct group owner.
102          *
103          * @brief       <i> [Deprecated] </i>
104          * @deprecated  The %WifiDirectGroupClient class is deprecated. Therefore, this method is also deprecated, because
105          *              previously the Wi-Fi Direct APIs were provided centered on the role(e.g. group owner, group
106          *              client) @n
107          *              so it was necessary to use APIs in accordance with the strict role; however, it has been revised to
108          *              allow using APIs with ease without discerning the role. @n
109          *              Instead of using this method, use the WifiDirectDevice::GetGroupOwnerInfoN() method.
110          *
111          * @since       2.0
112          * @privlevel   public
113          * @privilege   %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection
114          *              and %http://tizen.org/privilege/socket @n
115          *              All the above privileges are required.
116          *
117          * @return      An error code
118          * @param[in]   portNumber          A port number to connect to the group member information service
119          * @exception   E_SUCCESS           The method is successful.
120          * @exception   E_SYSTEM            A system error has occurred.
121          * @exception   E_IN_PROGRESS       The previous request for the group owner information is in progress.
122          * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
123          *                                  For example, when the member type of a device is not a Wi-Fi Direct group client.
124          * @exception   E_OUT_OF_RANGE      The specified port number is less than 1024 or greater than 65535.
125          * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
126          * @remarks     The port number used by the group owner must be specified if the group owner changes the port number
127          *              in WifiDirectGroupOwner::StartGroupMemberInfoService().
128          * @see         IWifiDirectGroupClientListener::OnWifiDirectGroupOwnerInfoReceived()
129          * @endif
130          */
131         result RequestGroupOwnerInfo(int portNumber = DEFAULT_PORT);
132
133         /**
134          * @if OSPDEPREC
135          * Requests the WifiDirectDeviceInfo list of the Wi-Fi Direct group members.
136          *
137          * @brief       <i> [Deprecated] </i>
138          * @deprecated  %WifiDirectGroupClient class is deprecated, therefore, this method is also deprecated. @n
139          *              Earlier, the Wi-Fi Direct APIs were strictly provided depending on the role (for example, group
140          *              owner, group client, and so on) and so it was necessary to use these APIs. @n
141          *              Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the
142          *              role. @n
143          *
144          * @since       2.0
145          * @privlevel   public
146          * @privilege   %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection
147          *              and %http://tizen.org/privilege/socket @n
148          *              All the above privileges are required.
149          *
150          * @return      An error code
151          * @param[in]   portNumber          A port number to connect to the group member information service
152          * @exception   E_SUCCESS           The method is successful.
153          * @exception   E_SYSTEM            A system error has occurred.
154          * @exception   E_IN_PROGRESS       The previous request for the group owner information is in progress.
155          * @exception   E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. @n
156          *                                  For example, when the member type of a device is not a Wi-Fi Direct group client.
157          * @exception   E_OUT_OF_RANGE      The specified port number is less than 1024 or greater than 65535.
158          * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
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         WifiDirectGroupClient(void);
171
172         //
173         // The implementation of this copy constructor is intentionally blank to prohibit copying of objects.
174         //
175         WifiDirectGroupClient(const WifiDirectGroupClient& value);
176
177         //
178         // Initializes this instance of %WifiDirectGroupClient with the specified parameter. @n
179         // This method is intentionally declared as private so that only the platform can initialize the instance.
180         //
181         result Construct(_WifiDirectGroupClientImpl& wifiDirectGroupClientImpl);
182
183         //
184         // The implementation of this copy assignment operator is intentionally blank to prohibit copying of objects.
185         //
186         WifiDirectGroupClient& operator=(const WifiDirectGroupClient& rhs);
187
188 private:
189         static const int DEFAULT_PORT = 3895;
190
191         _WifiDirectGroupClientImpl* __pWifiDirectGroupClientImpl;
192
193         friend class _WifiDirectGroupClientImpl;
194 }; // WifiDirectGroupClient
195
196 } } } // Tizen::Net::Wifi
197 #endif // _FNET_WIFI_WIFI_DIRECT_GROUP_CLIENT_H_