change version to 1.2.2.0
[platform/framework/native/net.git] / src / FNet_NetAccountDatabase.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        FNet_NetAccountDatabase.h
19  * @brief       This is the header file for the %_NetAccountDatabase class.
20  *
21  * This header file contains the declarations of the %_NetAccountDatabase class.
22  */
23
24 #ifndef _FNET_INTERNAL_NET_ACCOUNT_DATABASE_H_
25 #define _FNET_INTERNAL_NET_ACCOUNT_DATABASE_H_
26
27 #include <FBaseDataType.h>
28 #include <FNetNetTypes.h>
29
30 namespace Tizen { namespace Base
31 {
32 class String;
33 } } // Tizen::Base
34
35 namespace Tizen { namespace Base { namespace Collection
36 {
37 template<class Type> class IListT;
38 class IList;
39 } } } // Tizen::Base::Collection
40
41 namespace Tizen { namespace Net {
42
43 enum _NetAccountOwner
44 {
45         _NET_ACCOUNT_OWNER_OTHER,
46         _NET_ACCOUNT_OWNER_THIS
47 };
48
49 /**
50  * @class       _NetAccountDatabase
51  * @brief       This class represents a database for the network account.
52  * @since 2.1
53  *
54  * This class represents a database for the network account.
55  */
56 class _NetAccountDatabase
57 {
58 public:
59         static result InitializeRepository(void);
60         static result AddAccount(const Tizen::Base::String& accountName, const Tizen::Base::String& profileName, _NetAccountOwner owner, NetAccountId& accountId);
61         static result RemoveAccountByAccountId(NetAccountId accountId);
62         static result RemoveAccountByProfileName(const Tizen::Base::String& profileName);
63         static result UpdateAccountName(NetAccountId accountId, const Tizen::Base::String& accountName);
64         static Tizen::Base::Collection::IListT<NetAccountId>* GetAccountIdsN(void);
65         static Tizen::Base::Collection::IList* GetAccountNamesN(void);
66         static Tizen::Base::Collection::IList* GetProfileNamesN(void);
67         static result GetAccountName(NetAccountId accountId, Tizen::Base::String& accountName);
68         static result GetProfileName(NetAccountId accountId, Tizen::Base::String& profileName);
69         static result GetAccountIdByAccountName(const Tizen::Base::String& accountName, NetAccountId& accountId);
70         static result GetAccountIdByProfileName(const Tizen::Base::String& profileName, NetAccountId& accountId);
71         static bool IsReadOnly(NetAccountId accountId);
72
73 private:
74         static Tizen::Base::String GetDbPath(void);
75
76 private:
77     _NetAccountDatabase(void);
78         virtual ~_NetAccountDatabase(void);
79
80         _NetAccountDatabase(const _NetAccountDatabase& rhs);
81         _NetAccountDatabase& operator =(const _NetAccountDatabase& rhs);
82 }; // _NetAccountDatabase
83
84 } } // Tizen::Net
85 #endif // _FNET_INTERNAL_NET_ACCOUNT_DATABASE_H_
86