merge with master
[framework/osp/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_SYSTEM_INTERNET,
46         _NET_ACCOUNT_OWNER_SYSTEM_MMS,
47         _NET_ACCOUNT_OWNER_SYSTEM,
48         _NET_ACCOUNT_OWNER_OTHER,
49         _NET_ACCOUNT_OWNER_THIS
50 };
51
52 /**
53  * @class       _NetAccountDatabase
54  * @brief       This class represents a database for the network account.
55  * @since 2.1
56  *
57  * This class represents a database for the network account.
58  */
59 class _NetAccountDatabase
60 {
61 public:
62         static result InitializeRepository(void);
63         static result AddAccount(const Tizen::Base::String& accountName, const Tizen::Base::String& profileName, _NetAccountOwner owner, NetAccountId& accountId);
64         static result RemoveAccountByAccountId(NetAccountId accountId);
65         static result RemoveAccountByProfileName(const Tizen::Base::String& profileName);
66         static result UpdateAccountName(NetAccountId accountId, const Tizen::Base::String& accountName);
67         static Tizen::Base::Collection::IListT<NetAccountId>* GetAccountIdsN(void);
68         static Tizen::Base::Collection::IList* GetAccountNamesN(void);
69         static Tizen::Base::Collection::IList* GetProfileNamesN(void);
70         static Tizen::Base::Collection::IList* GetAppProfileNamesN(void);
71         static result GetAccountName(NetAccountId accountId, Tizen::Base::String& accountName);
72         static result GetProfileName(NetAccountId accountId, Tizen::Base::String& profileName);
73         static result GetAccountIdByAccountName(const Tizen::Base::String& accountName, NetAccountId& accountId);
74         static result GetAccountIdByProfileName(const Tizen::Base::String& profileName, NetAccountId& accountId);
75         static bool IsReadOnly(NetAccountId accountId);
76
77 private:
78         static Tizen::Base::String GetDbPath(void);
79
80 private:
81     _NetAccountDatabase(void);
82         virtual ~_NetAccountDatabase(void);
83
84         _NetAccountDatabase(const _NetAccountDatabase& rhs);
85         _NetAccountDatabase& operator =(const _NetAccountDatabase& rhs);
86 }; // _NetAccountDatabase
87
88 } } // Tizen::Net
89 #endif // _FNET_INTERNAL_NET_ACCOUNT_DATABASE_H_
90