Modify the spec file for secure log
[framework/osp/social.git] / src / FSclAccountProvider.cpp
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 /**
17  * @file                FSclAccountProvider.cpp
18  * @brief               This is the implementation for AccountProvider class.
19  *
20  * This file contains definitions of @e AccountProvider class.
21  */
22
23 #include <new>
24 #include <FBaseColIList.h>
25 #include <FBaseResult.h>
26 #include <FBaseString.h>
27 #include <FBaseSysLog.h>
28 #include <FSclAccountProvider.h>
29 #include "FScl_AccountProviderImpl.h"
30
31 using namespace Tizen::App;
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Collection;
34
35 namespace Tizen { namespace Social
36 {
37
38 AccountProvider::AccountProvider(void)
39 {
40         __pAccountProviderImpl = new (std::nothrow) _AccountProviderImpl();
41         SysTryReturnVoidResult(NID_SCL, __pAccountProviderImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
42 }
43
44 AccountProvider::AccountProvider(const AccountProvider& rhs)
45 {
46         __pAccountProviderImpl = new (std::nothrow) _AccountProviderImpl();
47         SysTryReturnVoidResult(NID_SCL, __pAccountProviderImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
48
49
50         *__pAccountProviderImpl = *rhs.__pAccountProviderImpl;
51 }
52
53 AccountProvider::~AccountProvider(void)
54 {
55         delete __pAccountProviderImpl;
56 }
57
58 AccountProvider&
59 AccountProvider::operator =(const AccountProvider& rhs)
60 {
61         if (this == &rhs)
62         {
63                 return *this;
64         }
65
66         *__pAccountProviderImpl = *rhs.__pAccountProviderImpl;
67
68         return *this;
69 }
70
71 bool
72 AccountProvider::Equals(const Object& rhs) const
73 {
74         const AccountProvider* pAccountProvider = dynamic_cast<const AccountProvider*> (&rhs);
75
76         if (pAccountProvider == null)
77         {
78                 return false;
79         }
80
81         return __pAccountProviderImpl->Equals(*pAccountProvider->__pAccountProviderImpl);
82 }
83
84 int
85 AccountProvider::GetHashCode(void) const
86 {
87         return __pAccountProviderImpl->GetHashCode();
88 }
89
90 AppId
91 AccountProvider::GetAppId(void) const
92 {
93         return __pAccountProviderImpl->GetAppId();
94 }
95
96 IList*
97 AccountProvider::GetCapabilitiesN(void) const
98 {
99         return __pAccountProviderImpl->GetCapabilitiesN();
100 }
101
102 String
103 AccountProvider::GetDisplayName(void) const
104 {
105         return __pAccountProviderImpl->GetDisplayName();
106 }
107
108 String
109 AccountProvider::GetIconPath(void) const
110 {
111         return __pAccountProviderImpl->GetIconPath();
112 }
113
114 String
115 AccountProvider::GetSmallIconPath(void) const
116 {
117         return __pAccountProviderImpl->GetSmallIconPath();
118 }
119
120 bool
121 AccountProvider::IsMultipleAccountSupported(void) const
122 {
123         return __pAccountProviderImpl->IsMultipleAccountSupported();
124 }
125
126 }} //Tizen::Social