Fixed update instance
[framework/osp/social.git] / src / FSclAccountProvider.cpp
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                FSclAccountProvider.cpp
19  * @brief               This is the implementation for AccountProvider class.
20  *
21  * This file contains definitions of @e AccountProvider class.
22  */
23
24 #include <new>
25 #include <FBaseColIList.h>
26 #include <FBaseResult.h>
27 #include <FBaseString.h>
28 #include <FBaseSysLog.h>
29 #include <FSclAccountProvider.h>
30 #include "FScl_AccountProviderImpl.h"
31
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35
36 namespace Tizen { namespace Social
37 {
38
39 AccountProvider::AccountProvider(void)
40 {
41         __pAccountProviderImpl = new (std::nothrow) _AccountProviderImpl();
42         SysTryReturnVoidResult(NID_SCL, __pAccountProviderImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
43 }
44
45 AccountProvider::AccountProvider(const AccountProvider& rhs)
46 {
47         __pAccountProviderImpl = new (std::nothrow) _AccountProviderImpl();
48         SysTryReturnVoidResult(NID_SCL, __pAccountProviderImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
49
50
51         *__pAccountProviderImpl = *rhs.__pAccountProviderImpl;
52 }
53
54 AccountProvider::~AccountProvider(void)
55 {
56         delete __pAccountProviderImpl;
57 }
58
59 AccountProvider&
60 AccountProvider::operator =(const AccountProvider& rhs)
61 {
62         if (this == &rhs)
63         {
64                 return *this;
65         }
66
67         *__pAccountProviderImpl = *rhs.__pAccountProviderImpl;
68
69         return *this;
70 }
71
72 bool
73 AccountProvider::Equals(const Object& rhs) const
74 {
75         const AccountProvider* pAccountProvider = dynamic_cast<const AccountProvider*> (&rhs);
76
77         if (pAccountProvider == null)
78         {
79                 return false;
80         }
81
82         return __pAccountProviderImpl->Equals(*pAccountProvider->__pAccountProviderImpl);
83 }
84
85 int
86 AccountProvider::GetHashCode(void) const
87 {
88         return __pAccountProviderImpl->GetHashCode();
89 }
90
91 AppId
92 AccountProvider::GetAppId(void) const
93 {
94         return __pAccountProviderImpl->GetAppId();
95 }
96
97 IList*
98 AccountProvider::GetCapabilitiesN(void) const
99 {
100         return __pAccountProviderImpl->GetCapabilitiesN();
101 }
102
103 String
104 AccountProvider::GetDisplayName(void) const
105 {
106         return __pAccountProviderImpl->GetDisplayName();
107 }
108
109 String
110 AccountProvider::GetIconPath(void) const
111 {
112         return __pAccountProviderImpl->GetIconPath();
113 }
114
115 String
116 AccountProvider::GetSmallIconPath(void) const
117 {
118         return __pAccountProviderImpl->GetSmallIconPath();
119 }
120
121 bool
122 AccountProvider::IsMultipleAccountSupported(void) const
123 {
124         return __pAccountProviderImpl->IsMultipleAccountSupported();
125 }
126
127 }} //Tizen::Social