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.
18 * @file FNet_NetAccountInfoImpl.h
19 * @brief This is the header file for the _NetAccountInfoImpl class.
22 #ifndef _FNET_INTERNAL_NET_ACCOUNT_INFO_IMPL_H_
23 #define _FNET_INTERNAL_NET_ACCOUNT_INFO_IMPL_H_
25 #include <unique_ptr.h>
26 #include <FBaseDataType.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FNetNetTypes.h>
31 namespace Tizen { namespace Net
36 class _NetAccountManagerImpl;
38 class _NetAccountInfoImpl
39 : public Tizen::Base::Object
44 * This is the default constructor for this class.
47 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
50 _NetAccountInfoImpl(void);
53 * This is the destructor for this class.
57 virtual ~_NetAccountInfoImpl(void);
60 * @see NetAccountInfo::Construct()
62 result Construct(const _NetAccountInfoImpl& netAccountInfo);
65 * @see NetAccountInfo::Construct()
67 result Construct(void);
70 * Initializes this instance of %_NetAccountInfoImpl with the specified profile instance. @n
73 * @return An error code
74 * @param[in] pAccountInfo A %NetAccountInfo instance
75 * @param[in] pProfileHandle A profile handle
76 * @exception E_SUCCESS The method is successful.
77 * @exception E_INVALID_STATE This instance has already been constructed.
78 * @exception E_INVALID_ARG The specified @c pAccountInfo or @c pProfileInfo is invalid.
80 result Construct(NetAccountInfo* pAccountInfo, void* pProfileHandle);
84 * @see NetAccountInfo::GetAccountId()
86 NetAccountId GetAccountId(void) const;
89 * @see NetAccountInfo::GetAccountName()
91 Tizen::Base::String GetAccountName(void) const;
94 * @see NetAccountInfo::SetAccountName()
96 result SetAccountName(const Tizen::Base::String& accountName);
99 * @see NetAccountInfo::GetProtocolType()
101 NetProtocolType GetProtocolType(void) const;
104 * @see NetAccountInfo::SetProtocolType()
106 result SetProtocolType(NetProtocolType netProtocolType);
109 * @see NetAccountInfo::GetAccessPointName()
111 Tizen::Base::String GetAccessPointName(void) const;
114 * @see NetAccountInfo::SetAccessPointName()
116 result SetAccessPointName(const Tizen::Base::String& accessPointName);
119 * @see NetAccountInfo::GetLocalAddressScheme()
121 NetAddressScheme GetLocalAddressScheme(void) const;
124 * @see NetAccountInfo::GetLocalAddress()
126 const IpAddress* GetLocalAddress(void) const;
129 * @see NetAccountInfo::SetLocalAddress()
131 result SetLocalAddress(NetAddressScheme localAddrScheme, const IpAddress* pLocalAddress);
134 * @see NetAccountInfo::GetDnsAddressScheme()
136 NetAddressScheme GetDnsAddressScheme(void) const;
139 * @see NetAccountInfo::GetPrimaryDnsAddress()
141 const IpAddress* GetPrimaryDnsAddress(void) const;
144 * @see NetAccountInfo::GetSecondaryDnsAddress()
146 const IpAddress* GetSecondaryDnsAddress(void) const;
149 * @see NetAccountInfo::SetDnsAddress()
151 result SetDnsAddress(NetAddressScheme dnsAddrScheme, const IpAddress* pPrimaryDnsAddress, const IpAddress* pSecondaryDnsAddress);
154 * @see NetAccountInfo::GetProxyAddress()
156 const NetEndPoint* GetProxyAddress(void) const;
159 * @see NetAccountInfo::SetProxyAddress()
161 result SetProxyAddress(const NetEndPoint* pProxyEndPoint);
164 * @see NetAccountInfo::GetAuthenticationInfo()
166 result GetAuthenticationInfo(NetNapAuthType& authenticationType, Tizen::Base::String& id, Tizen::Base::String& password) const;
169 * @see NetAccountInfo::SetAuthenticationInfo()
171 result SetAuthenticationInfo(NetNapAuthType authenticationType, const Tizen::Base::String& id, const Tizen::Base::String& password);
174 * @see NetAccountInfo::GetBearerType()
176 NetBearerType GetBearerType(void) const;
179 * @see NetAccountInfo::GetHomeUrl()
181 Tizen::Base::String GetHomeUrl(void) const;
184 * @see NetAccountInfo::SetHomeUrl()
186 void SetHomeUrl(const Tizen::Base::String& homeUrl);
189 * @see NetAccountInfo::GetMaximumLengthOfId()
191 int GetMaximumLengthOfId(void) const;
194 * @see NetAccountInfo::GetMaximumLengthOfPassword()
196 int GetMaximumLengthOfPassword(void) const;
199 * @see NetAccountInfo::GetMaximumLengthOfAccountName()
201 int GetMaximumLengthOfAccountName(void) const;
204 * @see NetAccountInfo::IsReadOnly()
206 bool IsReadOnly(void) const;
208 result ConvertToProfileInfo(void* pProfileHandle) const;
211 * @see NetAccountInfo::Equals()
213 virtual bool Equals(const Tizen::Base::Object& rhs) const;
216 * @see NetAccountInfo::GetHashCode()
218 virtual int GetHashCode(void) const;
221 static NetAccountInfo* CreateNetAccountInfoN(void* pProfileHandle);
225 * Gets the Impl instance.
228 * @return The pointer to _NetAccountInfoImpl
229 * @param[in] netAccountInfo An instance of NetAccountInfo
231 static _NetAccountInfoImpl* GetInstance(NetAccountInfo& netAccountInfo);
234 * Gets the Impl instance.
237 * @return The pointer to _NetAccountInfoImpl
238 * @param[in] netAccountInfo An instance of NetAccountInfo
240 static const _NetAccountInfoImpl* GetInstance(const NetAccountInfo& netAccountInfo);
244 * Sets the bearer type.
248 * @return An error code
249 * @param[in] bearerType The type of the bearer
250 * @exception E_SUCCESS The method is successful.
251 * @exception E_INVALID_STATE This instance has not been constructed as yet.
252 * @remarks If this method fails, the state of this instance does not change.
253 * @see GetBearerType()
255 result SetBearerType(NetBearerType bearerType);
258 * Sets the account Id.
262 * @return An error code
263 * @param[in] accountId The account id
264 * @exception E_SUCCESS The method is successful.
265 * @exception E_INVALID_STATE This instance has not been constructed as yet.
266 * @remarks If this method fails, the state of this instance does not change.
267 * @see GetAccountId()
269 result SetAccountId(NetAccountId accountId);
273 * This is the copy constructor for this class. @n
274 * Do @b not use directly.
276 * @param[in] rhs An instance of _NetAccountInfoImpl
278 _NetAccountInfoImpl(const _NetAccountInfoImpl& rhs);
281 * This is the assignment operator for this class. @n
282 * Do @b not use directly.
284 * @param[in] rhs An instance of _NetAccountInfoImpl
286 _NetAccountInfoImpl& operator =(const _NetAccountInfoImpl& rhs);
289 NetAccountId __accountId;
290 Tizen::Base::String __accountName;
291 Tizen::Base::String __accessPointName;
292 NetNapAuthType __authType;
293 Tizen::Base::String __authId;
294 Tizen::Base::String __authPassword;
295 Tizen::Base::String __homeUrl;
296 NetBearerType __bearerType;
297 NetProtocolType __protocolType;
298 NetAddressScheme __localAddressScheme;
299 NetAddressScheme __dnsAddressScheme;
300 std::unique_ptr<IpAddress> __pLocalAddress;
301 std::unique_ptr<IpAddress> __pPrimaryDnsAddress;
302 std::unique_ptr<IpAddress> __pSecondaryDnsAddress;
303 std::unique_ptr<NetEndPoint> __pProxyAddress;
306 friend class _NetAccountManagerImpl;
307 }; // _NetAccountInfoImpl
311 #endif // _FNET_INTERNAL_NET_ACCOUNT_INFO_IMPL_H_