Modify the spec file for secure log
[framework/osp/social.git] / src / FScl_CalEventInstanceImpl.cpp
1 //
2 // Copyright (c) 2012 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                FScl_CalEventInstanceImpl.cpp
18  * @brief               This is the implementation for _CalEventInstanceImpl class.
19  *
20  * This file contains definitions of @e _CalEventInstanceImpl class.
21  */
22
23 #include <FBaseDateTime.h>
24 #include <FBaseString.h>
25 #include <FSclCalEventInstance.h>
26 #include "FScl_CalEventInstanceImpl.h"
27 #include "FScl_RecordImpl.h"
28
29 using namespace Tizen::Base;
30
31 namespace Tizen { namespace Social
32 {
33
34 _CalEventInstanceImpl::_CalEventInstanceImpl(void)
35         : __originalEventId(INVALID_RECORD_ID)
36         , __calendarId(INVALID_RECORD_ID)
37         , __isAllDayEvent(false)
38         , __busyStatus(BUSY_STATUS_FREE)
39         , __status(EVENT_STATUS_NONE)
40         , __priority(EVENT_PRIORITY_NORMAL)
41         , __sensitivity(SENSITIVITY_PUBLIC)
42         , __isRecurring(false)
43         , __hasReminder(false)
44 {
45 }
46
47 _CalEventInstanceImpl::_CalEventInstanceImpl(const _CalEventInstanceImpl& rhs)
48         : __originalEventId(rhs.__originalEventId)
49         , __calendarId(rhs.__calendarId)
50         , __startDateTime(rhs.__startDateTime)
51         , __endDateTime(rhs.__endDateTime)
52         , __subject(rhs.__subject)
53         , __description(rhs.__description)
54         , __location(rhs.__location)
55         , __isAllDayEvent(rhs.__isAllDayEvent)
56         , __busyStatus(rhs.__busyStatus)
57         , __status(rhs.__status)
58         , __priority(rhs.__priority)
59         , __sensitivity(rhs.__sensitivity)
60         , __isRecurring(rhs.__isRecurring)
61         , __hasReminder(rhs.__hasReminder)
62 {
63 }
64
65 _CalEventInstanceImpl::~_CalEventInstanceImpl(void)
66 {
67 }
68
69 _CalEventInstanceImpl&
70 _CalEventInstanceImpl::operator =(const _CalEventInstanceImpl& rhs)
71 {
72         if (this == &rhs)
73         {
74                 return *this;
75         }
76
77         __originalEventId = rhs.__originalEventId;
78         __calendarId = rhs.__calendarId;
79         __startDateTime = rhs.__startDateTime;
80         __endDateTime = rhs.__endDateTime;
81         __subject = rhs.__subject;
82         __description = rhs.__description;
83         __location = rhs.__location;
84         __isAllDayEvent = rhs.__isAllDayEvent;
85         __busyStatus = rhs.__busyStatus;
86         __status = rhs.__status;
87         __priority = rhs.__priority;
88         __sensitivity = rhs.__sensitivity;
89         __isRecurring = rhs.__isRecurring;
90         __hasReminder = rhs.__hasReminder;
91
92         return *this;
93 }
94
95 bool
96 _CalEventInstanceImpl::Equals(const Object& rhs) const
97 {
98         const _CalEventInstanceImpl* pCalEventInstanceImpl = dynamic_cast<const _CalEventInstanceImpl*>(&rhs);
99
100         if (pCalEventInstanceImpl == null)
101         {
102                 return false;
103         }
104
105         return (__originalEventId == pCalEventInstanceImpl->__originalEventId && __calendarId == pCalEventInstanceImpl->__calendarId
106                         && __startDateTime == pCalEventInstanceImpl->__startDateTime);
107 }
108
109 int
110 _CalEventInstanceImpl::GetHashCode(void) const
111 {
112         int hashCode = 17;
113
114         hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __originalEventId);
115         hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __calendarId);
116         hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __startDateTime.GetHashCode();
117
118         return hashCode;
119 }
120
121 RecordId
122 _CalEventInstanceImpl::GetOriginalEventId(void) const
123 {
124         return __originalEventId;
125 }
126
127 RecordId
128 _CalEventInstanceImpl::GetCalendarId(void) const
129 {
130         return __calendarId;
131 }
132
133 DateTime
134 _CalEventInstanceImpl::GetStartTime(void) const
135 {
136         return __startDateTime;
137 }
138
139 DateTime
140 _CalEventInstanceImpl::GetEndTime(void) const
141 {
142         return __endDateTime;
143 }
144
145 String
146 _CalEventInstanceImpl::GetSubject(void) const
147 {
148         return __subject;
149 }
150
151 String
152 _CalEventInstanceImpl::GetDescription(void) const
153 {
154         return __description;
155 }
156
157 String
158 _CalEventInstanceImpl::GetLocation(void) const
159 {
160         return __location;
161 }
162
163 bool
164 _CalEventInstanceImpl::IsAllDayEvent(void) const
165 {
166         return __isAllDayEvent;
167 }
168
169 BusyStatus
170 _CalEventInstanceImpl::GetBusyStatus(void) const
171 {
172         return __busyStatus;
173 }
174
175 EventStatus
176 _CalEventInstanceImpl::GetStatus(void) const
177 {
178         return __status;
179 }
180
181 EventPriority
182 _CalEventInstanceImpl::GetPriority(void) const
183 {
184         return __priority;
185 }
186
187 RecordSensitivity
188 _CalEventInstanceImpl::GetSensitivity(void) const
189 {
190         return __sensitivity;
191 }
192
193 bool
194 _CalEventInstanceImpl::IsRecurring(void) const
195 {
196         return __isRecurring;
197 }
198
199 bool
200 _CalEventInstanceImpl::HasReminder(void) const
201 {
202         return __hasReminder;
203 }
204
205 void
206 _CalEventInstanceImpl::SetOriginalEventId(RecordId originalEventId)
207 {
208         __originalEventId = originalEventId;
209 }
210
211 void
212 _CalEventInstanceImpl::SetCalendarId(RecordId calendarId)
213 {
214         __calendarId = calendarId;
215 }
216
217 void
218 _CalEventInstanceImpl::SetStartTime(const DateTime& startTime)
219 {
220         __startDateTime = startTime;
221 }
222
223 void
224 _CalEventInstanceImpl::SetEndTime(const DateTime& endTime)
225 {
226         __endDateTime = endTime;
227 }
228
229 void
230 _CalEventInstanceImpl::SetSubject(const String& subject)
231 {
232         __subject = subject;
233 }
234
235 void
236 _CalEventInstanceImpl::SetDescription(const String& description)
237 {
238         __description = description;
239 }
240
241 void
242 _CalEventInstanceImpl::SetLocation(const String& location)
243 {
244         __location = location;
245 }
246
247 void
248 _CalEventInstanceImpl::SetAllDayEvent(bool isAllDayEvent)
249 {
250         __isAllDayEvent = isAllDayEvent;
251 }
252
253 void
254 _CalEventInstanceImpl::SetBusyStatus(BusyStatus busyStatus)
255 {
256         __busyStatus = busyStatus;
257 }
258
259 void
260 _CalEventInstanceImpl::SetStatus(EventStatus status)
261 {
262         __status = status;
263 }
264
265 void
266 _CalEventInstanceImpl::SetPriority(EventPriority priority)
267 {
268         __priority = priority;
269 }
270
271 void
272 _CalEventInstanceImpl::SetSensitivity(RecordSensitivity sensitivity)
273 {
274         __sensitivity = sensitivity;
275 }
276
277 void
278 _CalEventInstanceImpl::SetRecurring(bool isRecurring)
279 {
280         __isRecurring = isRecurring;
281 }
282
283 void
284 _CalEventInstanceImpl::SetHasReminder(bool hasReminder)
285 {
286         __hasReminder = hasReminder;
287 }
288
289 _CalEventInstanceImpl*
290 _CalEventInstanceImpl::GetInstance(CalEventInstance& eventInstance)
291 {
292         return eventInstance.__pCalEventInstanceImpl;
293 }
294
295 const _CalEventInstanceImpl*
296 _CalEventInstanceImpl::GetInstance(const CalEventInstance& eventInstance)
297 {
298         return eventInstance.__pCalEventInstanceImpl;
299 }
300
301 }} //Tizen::Social