2 // Open Service Platform
3 // Copyright (c) 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.
19 * @brief This is the header file for the %Account class.
21 * This header file contains the declarations of the %Account class.
23 #ifndef _FSCL_ACCOUNT_H_
24 #define _FSCL_ACCOUNT_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FSclTypes.h>
30 namespace Tizen { namespace Base
39 namespace Tizen { namespace Social
41 class AccountProvider;
45 * @brief This class represents the account information.
48 * @final This class is not intended for extension.
50 * This %Account class represents the account information.
52 class _OSP_EXPORT_ Account
53 : public Tizen::Base::Object
57 * This is the default constructor for this class. @n
58 * It creates a fully initialized instance of the %Account class.
62 * @param[in] userName The user name
64 Account(const Tizen::Base::String& userName);
67 * Copying of objects using this copy constructor is allowed.
71 * @param[in] rhs An instance of %Account
73 Account(const Account& rhs);
76 * This destructor overrides Tizen::Base::Object::~Object().
80 virtual ~Account(void);
83 * Checks whether the value of the specified instance is equal to the value of the current instance.
87 * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance, @n
89 * @param[in] rhs An instance to compare
91 virtual bool Equals(const Tizen::Base::Object& rhs) const;
94 * Gets the hash value of the current instance.
98 * @return An integer value indicating the hash value of the current instance
100 virtual int GetHashCode(void) const;
103 * Gets the ID of an account.
107 * @return The account ID
109 AccountId GetId(void) const;
112 * Gets the account provider.
116 * @return The account provider
118 AccountProvider GetAccountProvider(void) const;
121 * Gets the user name.
125 * @return The user name
127 Tizen::Base::String GetUserName(void) const;
130 * Gets the extended data.
134 * @return The key-value lists of the extended data, @n
135 * else an empty list if there is no extended data, or @c null if an exception occurs (String, String list)
136 * @remarks The specific error code can be accessed using the GetLastResult() method.
138 Tizen::Base::Collection::IMap* GetExtendedDataN(void) const;
141 * Sets the user name.
145 * @return An error code
146 * @param[in] userName The user name
147 * @exception E_SUCCESS The method is successful.
148 * @exception E_INVALID_ARG The specified @c userName is an empty string.
150 result SetUserName(const Tizen::Base::String& userName);
153 * Sets the extended data with the specified @c key and @c value. @n
154 * If the specified @c key already exists, the corresponding value is overwritten with the specified @c value.
158 * @return An error code
159 * @param[in] key The key of the extended data
160 * @param[in] value The value of the extended data
161 * @exception E_SUCCESS The method is successful.
162 * @exception E_INVALID_ARG The specified @c key is an empty string.
164 result SetExtendedData(const Tizen::Base::String& key, const Tizen::Base::String& value);
167 * Copying of objects using this copy assignment operator is allowed.
171 * @param[in] rhs An instance of %Account
173 Account& operator =(const Account& rhs);
176 friend class _AccountImpl;
177 class _AccountImpl* __pAccountImpl;
183 #endif //_FSCL_ACCOUNT_H_