9ae36e81fe3839232f7fe42f45759cef3831c281
[framework/osp/social.git] / inc / FSclAccount.h
1 //
2 // Open Service Platform
3 // Copyright (c) 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        FSclAccount.h
19  * @brief       This is the header file for the %Account class.
20  *
21  * This header file contains the declarations of the %Account class.
22  */
23 #ifndef _FSCL_ACCOUNT_H_
24 #define _FSCL_ACCOUNT_H_
25
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FSclTypes.h>
29
30 namespace Tizen { namespace Base
31 {
32 class String;
33 namespace Collection
34 {
35 class IMap;
36 }
37 }}
38
39 namespace Tizen { namespace Social
40 {
41 class AccountProvider;
42
43 /**
44  * @class       Account
45  * @brief       This class represents the account information.
46  * @since       2.1
47  *
48  * @final       This class is not intended for extension.
49  *
50  * This %Account class represents the account information.
51  */
52 class _OSP_EXPORT_ Account
53         : public Tizen::Base::Object
54 {
55 public:
56         /**
57          * This is the default constructor for this class. @n
58          * It creates a fully initialized instance of the %Account class.
59          *
60          * @since               2.1
61          *
62          * @param[in]   userName                The user name
63          */
64         Account(const Tizen::Base::String& userName);
65
66         /**
67          * Copying of objects using this copy constructor is allowed.
68          *
69          * @since               2.1
70          *
71          * @param[in]   rhs             An instance of %Account
72          */
73         Account(const Account& rhs);
74
75         /**
76          * This destructor overrides Tizen::Base::Object::~Object().
77          *
78          * @since               2.1
79          */
80         virtual ~Account(void);
81
82         /**
83          * Checks whether the value of the specified instance is equal to the value of the current instance.
84          *
85          * @since               2.1
86          *
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
88          *                              else @c false
89          * @param[in]   rhs             An instance to compare
90          */
91         virtual bool Equals(const Tizen::Base::Object& rhs) const;
92
93         /**
94          * Gets the hash value of the current instance.
95          *
96          * @since       2.1
97          *
98          * @return      An integer value indicating the hash value of the current instance
99          */
100         virtual int GetHashCode(void) const;
101
102         /**
103          * Gets the ID of an account.
104          *
105          * @since       2.1
106          *
107          * @return      The account ID
108          */
109         AccountId GetId(void) const;
110
111         /**
112          * Gets the account provider.
113          *
114          * @since       2.1
115          *
116          * @return      The account provider
117          */
118         AccountProvider GetAccountProvider(void) const;
119
120         /**
121          * Gets the user name.
122          *
123          * @since       2.1
124          *
125          * @return      The user name
126          */
127         Tizen::Base::String GetUserName(void) const;
128
129         /**
130          * Gets the extended data.
131          *
132          * @since       2.1
133          *
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.
137          */
138         Tizen::Base::Collection::IMap* GetExtendedDataN(void) const;
139
140         /**
141          * Sets the user name.
142          *
143          * @since               2.1
144          *
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.
149          */
150         result SetUserName(const Tizen::Base::String& userName);
151
152         /**
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.
155          *
156          * @since               2.1
157          *
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.
163          */
164         result SetExtendedData(const Tizen::Base::String& key, const Tizen::Base::String& value);
165
166         /**
167          * Copying of objects using this copy assignment operator is allowed.
168          *
169          * @since               2.1
170          *
171          * @param[in]   rhs             An instance of %Account
172          */
173         Account& operator =(const Account& rhs);
174
175 private:
176         friend class _AccountImpl;
177         class _AccountImpl* __pAccountImpl;
178
179 }; // Account
180
181 }} // Tizen::Social
182
183 #endif //_FSCL_ACCOUNT_H_