Initialize Tizen 2.3
[framework/osp/net.git] / src / inc / FNetWifi_WifiSecurityInfoImpl.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    FNetWifi_WifiSecurityInfoImpl.h
19  * @brief   This is the header file for the _WifiSecurityInfoImpl class.
20  * @version 1.0
21  *
22  * This header file contains declarations of the _WifiSecurityInfoImpl class.
23  */
24
25 #ifndef _FNET_WIFI_INTERNAL_WIFI_SECURITY_INFO_IMPL_H_
26 #define _FNET_WIFI_INTERNAL_WIFI_SECURITY_INFO_IMPL_H_
27
28 #include <FOspConfig.h>
29 #include <FBaseObject.h>
30 #include <FNetWifiWifiTypes.h>
31 #include "FNetWifi_WifiUtility.h"
32
33 namespace Tizen { namespace Net {  namespace Wifi
34 {
35 class WifiSecurityInfo;
36 /**
37  * @class   _WifiSecurityInfoImpl
38  * @brief   This class provides extended methods to manage the additional security information of a Wi-Fi network.
39  * @since   1.2
40  *
41  * This class is used with the WifiSecurityInfo class to set and get the additional security information of a Wi-Fi network.
42  */
43
44 class _OSP_EXPORT_ _WifiSecurityInfoImpl
45         : public Tizen::Base::Object
46 {
47
48 public:
49
50     /**
51      * This is the default constructor for this class.
52      */
53     _WifiSecurityInfoImpl(void);
54
55     /**
56      * Copying of objects using this copy constructor is allowed.
57      *
58      */
59     _WifiSecurityInfoImpl(const _WifiSecurityInfoImpl& value);
60
61     /**
62      * This destructor overrides Tizen::Base::Object::~Object().
63      *
64      */
65     ~_WifiSecurityInfoImpl(void);
66
67     /**
68      * @see WifiSecurityInfo::GetAuthenticationType()
69      */
70     WifiAuthenticationType GetAuthenticationType(void) const;
71
72     /**
73      * @see WifiSecurityInfo::GetEncryptionType()
74      */
75     WifiEncryptionType GetEncryptionType(void) const;
76
77     /**
78      * @see WifiSecurityInfo::SetNetworkKeyWep()
79      */
80     result SetNetworkKeyWep(WifiWepKeyLen keyLen, WifiWepKeyIndex keyIndex, const Tizen::Base::String& key);
81
82     /**
83      * @see WifiSecurityInfo::SetNetworkKeyAes()
84      */
85     result SetNetworkKeyAes(const Tizen::Base::String& key);
86
87     /**
88      * @see WifiSecurityInfo::SetNetworkKeyTkip()
89      */
90     result SetNetworkKeyTkip(const Tizen::Base::String& key);
91
92     /**
93      * @see WifiSecurityInfo::SetEapMethodInfo()
94      */
95     result SetEapMethodInfo(WifiEapType type, const Tizen::Base::String& userId, const Tizen::Base::String& password, bool validateServerCertificate = true);
96
97     /**
98      * Gets the type of EAP.
99      *
100      * @return      The EAP type
101      */
102     WifiEapType GetEapType(void) const;
103
104     /**
105      * Gets the user ID of EAP.
106      *
107      * @return      user ID
108      */
109     Tizen::Base::String GetEapUserId(void) const;
110
111     /**
112      * Gets the password of EAP
113      *
114      * @return      password
115      */
116     Tizen::Base::String GetEapPassword(void) const;
117
118
119     bool GetValidateServerCertificate(void) const;
120
121     /**
122      * @see WifiSecurityInfo::SetNetworkKey()
123      */
124     void SetNetworkKey(const Tizen::Base::String& key);
125
126     /**
127      * @see WifiSecurityInfo::SetAuthenticationType()
128      */
129     void SetAuthenticationType(WifiAuthenticationType type);
130
131     /**
132      * Gets the network key
133      *
134      * @return  The network key
135      */
136     Tizen::Base::String GetNetworkKey(void) const;
137
138     /**
139      * Sets the encryption type of this account.
140      *
141      * @param[in]   encryptionType  The encryption type
142      */
143     void SetEncryptionType(WifiEncryptionType encryptionType);
144
145     /**
146      * @see WifiSecurityInfo::Equals()
147      */
148     virtual bool Equals(const Tizen::Base::Object& obj) const;
149
150     /**
151      * @see WifiSecurityInfo::GetHashCode()
152      */
153     virtual int GetHashCode(void) const;
154
155     /**
156      * Gets the Impl instance.
157      *
158      * @since 2.1
159      * @return  The pointer to %_WifiSecurityInfoImpl
160      * @param[in]   wifiSecurityInfo   An instance of %WifiSecurityInfo
161      */
162     static _WifiSecurityInfoImpl* GetInstance(WifiSecurityInfo& wifiSecurityInfo);
163
164     /**
165      * Gets the Impl instance.
166      *
167      * @since 2.1
168      * @return  The pointer to %_WifiSecurityInfoImpl
169      * @param[in]   wifiSecurityInfo   An instance of %WifiSecurityInfo
170      */
171     static const _WifiSecurityInfoImpl* GetInstance(const WifiSecurityInfo& wifiSecurityInfo);
172
173     /**
174      * @see WifiSecurityInfo::GetHashCode()
175      */
176     _WifiSecurityInfoImpl& operator=(const _WifiSecurityInfoImpl& rhs);
177
178 private:
179     /**
180      * @brief   Defines IEEE 802.11 security info with the WEP encryption.
181      */
182     struct WifiNetworkKeyWep
183     {
184         WifiWepKeyLen   keyLen;
185         WifiWepKeyIndex keyIndex;
186     };
187
188     /**
189      * @brief   Defines Information of EAP method.
190      */
191     struct WifiEapMethodInfo
192     {
193         WifiEapType eapType;                    //< EAP method type.
194         bool validateCertificate;               //< The option to validate server certificate.
195         Tizen::Base::String userId;
196         Tizen::Base::String password;
197     };
198     WifiAuthenticationType __authenticationType;
199     WifiEncryptionType __encryptionType;
200     WifiNetworkKeyWep __webKeyInfo;
201     WifiEapMethodInfo __eapInfo;
202     Tizen::Base::String __networkKey;
203
204 }; // _WifiSecurityInfoImpl
205
206 } } } //Tizen::Net::Wifi
207
208 #endif // _FNET_WIFI_INTERNAL_WIFI_SECURITY_INFO_IMPL_H_