Fix code for TDIS-5396
[framework/osp/social.git] / src / FSclOrganization.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 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         FSclOrganization.cpp
19 * @brief        This is the implementation for Organization class.
20 *
21 * This file contains definitions of @e Organization class.
22 */
23
24 #include <FBaseSysLog.h>
25 #include <FSclOrganization.h>
26 #include <FBaseString.h>
27 #include "FScl_OrganizationImpl.h"
28
29 using namespace Tizen::Base;
30
31 namespace Tizen { namespace Social
32 {
33
34 Organization::Organization(void)
35 {
36         __pOrganizationImpl = new (std::nothrow) _OrganizationImpl();
37         SysTryReturnVoidResult(NID_SCL, __pOrganizationImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
38 }
39
40 Organization::Organization(const Organization& rhs)
41 :__pOrganizationImpl(null)
42 {
43         __pOrganizationImpl = new (std::nothrow) _OrganizationImpl(*rhs.__pOrganizationImpl);
44         SysTryReturnVoidResult(NID_SCL, __pOrganizationImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
45 }
46
47 Organization::~Organization(void)
48 {
49         delete __pOrganizationImpl;
50 }
51
52 Organization&
53 Organization::operator =(const Organization& rhs)
54 {
55         if (this == &rhs)
56         {
57                 return *this;
58         }
59
60         *__pOrganizationImpl = *rhs.__pOrganizationImpl;
61
62         return *this;
63 }
64
65 bool
66 Organization::operator ==(const Organization& rhs) const
67 {
68         return *__pOrganizationImpl == *rhs.__pOrganizationImpl;
69 }
70
71 bool
72 Organization::operator !=(const Organization& rhs) const
73 {
74         return !(*this == rhs);
75 }
76
77 bool
78 Organization::Equals(const Object& rhs) const
79 {
80         const Organization* pOrganization = dynamic_cast<const Organization*>(&rhs);
81         if (pOrganization == null)
82         {
83                 return false;
84         }
85
86         return __pOrganizationImpl->Equals(*pOrganization->__pOrganizationImpl);
87 }
88
89 int
90 Organization::GetHashCode(void) const
91 {
92         return __pOrganizationImpl->GetHashCode();
93 }
94
95 String
96 Organization::GetName(void) const
97 {
98         return __pOrganizationImpl->GetName();
99 }
100
101 String
102 Organization::GetJobTitle(void) const
103 {
104         return __pOrganizationImpl->GetJobTitle();
105 }
106
107 String
108 Organization::GetDepartment(void) const
109 {
110         return __pOrganizationImpl->GetDepartment();
111 }
112
113 String
114 Organization::GetRole(void) const
115 {
116         return __pOrganizationImpl->GetRole();
117 }
118
119 String
120 Organization::GetAgent(void) const
121 {
122         return __pOrganizationImpl->GetAgent();
123 }
124
125 OrganizationType
126 Organization::GetType(void) const
127 {
128         return __pOrganizationImpl->GetType();
129 }
130
131 String
132 Organization::GetLabel(void) const
133 {
134         return __pOrganizationImpl->GetLabel();
135 }
136
137 String
138 Organization::GetLocation(void) const
139 {
140         return __pOrganizationImpl->GetLocation();
141 }
142
143 String
144 Organization::GetDescription(void) const
145 {
146         return __pOrganizationImpl->GetDescription();
147 }
148
149 String
150 Organization::GetPhoneticName(void) const
151 {
152         return __pOrganizationImpl->GetPhoneticName();
153 }
154
155 String
156 Organization::GetLogoPath(void) const
157 {
158         return __pOrganizationImpl->GetLogoPath();
159 }
160
161 void
162 Organization::SetName(const String& name)
163 {
164         __pOrganizationImpl->SetName(name);
165 }
166
167 void
168 Organization::SetJobTitle(const String& jobTitle)
169 {
170         __pOrganizationImpl->SetJobTitle(jobTitle);
171 }
172
173 void
174 Organization::SetDepartment(const String& department)
175 {
176         __pOrganizationImpl->SetDepartment(department);
177 }
178
179 void
180 Organization::SetRole(const String& role)
181 {
182         __pOrganizationImpl->SetRole(role);
183 }
184
185 void
186 Organization::SetAgent(const String& agent)
187 {
188         __pOrganizationImpl->SetAgent(agent);
189 }
190
191 void
192 Organization::SetType(OrganizationType type)
193 {
194         __pOrganizationImpl->SetType(type);
195 }
196
197 void
198 Organization::SetLabel(const String& label)
199 {
200         __pOrganizationImpl->SetLabel(label);
201 }
202
203 void
204 Organization::SetLocation(const String& location)
205 {
206         __pOrganizationImpl->SetLocation(location);
207 }
208
209 void
210 Organization::SetDescription(const String& description)
211 {
212         __pOrganizationImpl->SetDescription(description);
213 }
214
215 void
216 Organization::SetPhoneticName(const String& phoneticName)
217 {
218         __pOrganizationImpl->SetPhoneticName(phoneticName);
219 }
220
221 result
222 Organization::SetLogo(const String& filePath)
223 {
224         return __pOrganizationImpl->SetLogo(filePath);
225 }
226
227 }} // Tizen::Social