Fixed update instance
[framework/osp/social.git] / src / FScl_AccountAccessorImpl.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                FScl_AccountAccessorImpl.h
19  * @brief       This is the header file for the %_AccountAccessorImpl class.
20  *
21  * This header file contains the declarations of the %_AccountAccessorImpl class.
22  */
23
24 #ifndef _FSCL_INTERNAL_ACCOUNT_ACCESSOR_IMPL_H_
25 #define _FSCL_INTERNAL_ACCOUNT_ACCESSOR_IMPL_H_
26
27 #include <account-types.h>
28 #include <FAppTypes.h>
29 #include <FBaseObject.h>
30 #include <FBaseResult.h>
31 #include <FSclTypes.h>
32 #include "FScl_IAccountDbChangeEventListener.h"
33
34 namespace Tizen { namespace Base {
35 namespace Collection {
36 class IList;
37 }
38 }}
39
40 namespace Tizen { namespace Social
41 {
42 class Account;
43 class AccountAccessor;
44 class IAccountEventListener;
45
46 class _AccountAccessorImpl
47         : public Tizen::Base::Object
48         , virtual public _IAccountDbChangeEventListener
49 {
50 public:
51         _AccountAccessorImpl(void);
52
53         virtual ~_AccountAccessorImpl(void);
54
55         result Construct(void);
56
57         result SetEventListener(IAccountEventListener* pListener);
58
59         Account GetAccount(AccountId accountId) const;
60
61         Tizen::Base::Collection::IList* GetAccountsByAccountProviderN(const Tizen::App::AppId& accountProviderAppId) const;
62
63         Tizen::Base::Collection::IList* GetAllAccountsN(void) const;
64
65         AccountProvider GetAccountProvider(const Tizen::App::AppId& accountProviderAppId) const;
66
67         Tizen::Base::Collection::IList* GetAccountProvidersByCapabilityN(const Tizen::Base::String& capability) const;
68
69         Tizen::Base::Collection::IList* GetAllAccountProvidersN(void) const;
70
71         static _AccountAccessorImpl* GetInstance(AccountAccessor& AccountAccessor);
72
73         static const _AccountAccessorImpl* GetInstance(const AccountAccessor& AccountAccessor);
74
75         virtual void OnAccountAdded(AccountId accountId);
76
77         virtual void OnAccountUpdated(AccountId accountId);
78
79         virtual void OnAccountRemoved(AccountId accountId);
80
81 private:
82         _AccountAccessorImpl& operator =(const _AccountAccessorImpl& rhs);
83         _AccountAccessorImpl(const _AccountAccessorImpl& rhs);
84
85 private:
86         IAccountEventListener* __pIAccountEventListener;
87
88 };      // _AccountAccessorImpl
89
90 }}  // Tizen::Social
91
92 #endif //_FSCL_INTERNAL_ACCOUNT_ACCESSOR_IMPL_H_