2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FScl_CalEventInstanceImpl.cpp
19 * @brief This is the implementation for _CalEventInstanceImpl class.
21 * This file contains definitions of @e _CalEventInstanceImpl class.
24 #include <FBaseString.h>
25 #include <FBaseDateTime.h>
26 #include <FSclCalEventInstance.h>
27 #include "FScl_RecordImpl.h"
28 #include "FScl_CalEventInstanceImpl.h"
30 using namespace Tizen::Base;
32 namespace Tizen { namespace Social
35 _CalEventInstanceImpl::_CalEventInstanceImpl(void)
36 : __originalEventId(INVALID_RECORD_ID)
37 , __calendarId(INVALID_RECORD_ID)
38 , __isAllDayEvent(false)
39 , __busyStatus(BUSY_STATUS_FREE)
40 , __status(EVENT_STATUS_NONE)
41 , __priority(EVENT_PRIORITY_NORMAL)
42 , __sensitivity(SENSITIVITY_PUBLIC)
43 , __isRecurring(false)
44 , __hasReminder(false)
48 _CalEventInstanceImpl::_CalEventInstanceImpl(const _CalEventInstanceImpl& rhs)
49 : __originalEventId(rhs.__originalEventId)
50 , __calendarId(rhs.__calendarId)
51 , __startDateTime(rhs.__startDateTime)
52 , __endDateTime(rhs.__endDateTime)
53 , __subject(rhs.__subject)
54 , __description(rhs.__description)
55 , __location(rhs.__location)
56 , __isAllDayEvent(rhs.__isAllDayEvent)
57 , __busyStatus(rhs.__busyStatus)
58 , __status(rhs.__status)
59 , __priority(rhs.__priority)
60 , __sensitivity(rhs.__sensitivity)
61 , __isRecurring(rhs.__isRecurring)
62 , __hasReminder(rhs.__hasReminder)
66 _CalEventInstanceImpl::~_CalEventInstanceImpl(void)
70 _CalEventInstanceImpl&
71 _CalEventInstanceImpl::operator =(const _CalEventInstanceImpl& rhs)
78 __originalEventId = rhs.__originalEventId;
79 __calendarId = rhs.__calendarId;
80 __startDateTime = rhs.__startDateTime;
81 __endDateTime = rhs.__endDateTime;
82 __subject = rhs.__subject;
83 __description = rhs.__description;
84 __location = rhs.__location;
85 __isAllDayEvent = rhs.__isAllDayEvent;
86 __busyStatus = rhs.__busyStatus;
87 __status = rhs.__status;
88 __priority = rhs.__priority;
89 __sensitivity = rhs.__sensitivity;
90 __isRecurring = rhs.__isRecurring;
91 __hasReminder = rhs.__hasReminder;
97 _CalEventInstanceImpl::Equals(const Object& rhs) const
99 const _CalEventInstanceImpl* pCalEventInstanceImpl = dynamic_cast<const _CalEventInstanceImpl*>(&rhs);
101 if (pCalEventInstanceImpl == null)
106 return (__originalEventId == pCalEventInstanceImpl->__originalEventId && __calendarId == pCalEventInstanceImpl->__calendarId
107 && __startDateTime == pCalEventInstanceImpl->__startDateTime);
111 _CalEventInstanceImpl::GetHashCode(void) const
115 hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __originalEventId);
116 hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __calendarId);
117 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __startDateTime.GetHashCode();
123 _CalEventInstanceImpl::GetOriginalEventId(void) const
125 return __originalEventId;
129 _CalEventInstanceImpl::GetCalendarId(void) const
135 _CalEventInstanceImpl::GetStartTime(void) const
137 return __startDateTime;
141 _CalEventInstanceImpl::GetEndTime(void) const
143 return __endDateTime;
147 _CalEventInstanceImpl::GetSubject(void) const
153 _CalEventInstanceImpl::GetDescription(void) const
155 return __description;
159 _CalEventInstanceImpl::GetLocation(void) const
165 _CalEventInstanceImpl::IsAllDayEvent(void) const
167 return __isAllDayEvent;
171 _CalEventInstanceImpl::GetBusyStatus(void) const
177 _CalEventInstanceImpl::GetStatus(void) const
183 _CalEventInstanceImpl::GetPriority(void) const
189 _CalEventInstanceImpl::GetSensitivity(void) const
191 return __sensitivity;
195 _CalEventInstanceImpl::IsRecurring(void) const
197 return __isRecurring;
201 _CalEventInstanceImpl::HasReminder(void) const
203 return __hasReminder;
207 _CalEventInstanceImpl::SetOriginalEventId(RecordId originalEventId)
209 __originalEventId = originalEventId;
213 _CalEventInstanceImpl::SetCalendarId(RecordId calendarId)
215 __calendarId = calendarId;
219 _CalEventInstanceImpl::SetStartTime(const DateTime& startTime)
221 __startDateTime = startTime;
225 _CalEventInstanceImpl::SetEndTime(const DateTime& endTime)
227 __endDateTime = endTime;
231 _CalEventInstanceImpl::SetSubject(const String& subject)
237 _CalEventInstanceImpl::SetDescription(const String& description)
239 __description = description;
243 _CalEventInstanceImpl::SetLocation(const String& location)
245 __location = location;
249 _CalEventInstanceImpl::SetAllDayEvent(bool isAllDayEvent)
251 __isAllDayEvent = isAllDayEvent;
255 _CalEventInstanceImpl::SetBusyStatus(BusyStatus busyStatus)
257 __busyStatus = busyStatus;
261 _CalEventInstanceImpl::SetStatus(EventStatus status)
267 _CalEventInstanceImpl::SetPriority(EventPriority priority)
269 __priority = priority;
273 _CalEventInstanceImpl::SetSensitivity(RecordSensitivity sensitivity)
275 __sensitivity = sensitivity;
279 _CalEventInstanceImpl::SetRecurring(bool isRecurring)
281 __isRecurring = isRecurring;
285 _CalEventInstanceImpl::SetHasReminder(bool hasReminder)
287 __hasReminder = hasReminder;
290 _CalEventInstanceImpl*
291 _CalEventInstanceImpl::GetInstance(CalEventInstance& eventInstance)
293 return eventInstance.__pCalEventInstanceImpl;
296 const _CalEventInstanceImpl*
297 _CalEventInstanceImpl::GetInstance(const CalEventInstance& eventInstance)
299 return eventInstance.__pCalEventInstanceImpl;