2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FScl_CalEventInstanceImpl.cpp
18 * @brief This is the implementation for _CalEventInstanceImpl class.
20 * This file contains definitions of @e _CalEventInstanceImpl class.
23 #include <FBaseDateTime.h>
24 #include <FBaseString.h>
25 #include <FSclCalEventInstance.h>
26 #include "FScl_CalEventInstanceImpl.h"
27 #include "FScl_RecordImpl.h"
29 using namespace Tizen::Base;
31 namespace Tizen { namespace Social
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)
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)
65 _CalEventInstanceImpl::~_CalEventInstanceImpl(void)
69 _CalEventInstanceImpl&
70 _CalEventInstanceImpl::operator =(const _CalEventInstanceImpl& rhs)
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;
96 _CalEventInstanceImpl::Equals(const Object& rhs) const
98 const _CalEventInstanceImpl* pCalEventInstanceImpl = dynamic_cast<const _CalEventInstanceImpl*>(&rhs);
100 if (pCalEventInstanceImpl == null)
105 return (__originalEventId == pCalEventInstanceImpl->__originalEventId && __calendarId == pCalEventInstanceImpl->__calendarId
106 && __startDateTime == pCalEventInstanceImpl->__startDateTime);
110 _CalEventInstanceImpl::GetHashCode(void) const
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();
122 _CalEventInstanceImpl::GetOriginalEventId(void) const
124 return __originalEventId;
128 _CalEventInstanceImpl::GetCalendarId(void) const
134 _CalEventInstanceImpl::GetStartTime(void) const
136 return __startDateTime;
140 _CalEventInstanceImpl::GetEndTime(void) const
142 return __endDateTime;
146 _CalEventInstanceImpl::GetSubject(void) const
152 _CalEventInstanceImpl::GetDescription(void) const
154 return __description;
158 _CalEventInstanceImpl::GetLocation(void) const
164 _CalEventInstanceImpl::IsAllDayEvent(void) const
166 return __isAllDayEvent;
170 _CalEventInstanceImpl::GetBusyStatus(void) const
176 _CalEventInstanceImpl::GetStatus(void) const
182 _CalEventInstanceImpl::GetPriority(void) const
188 _CalEventInstanceImpl::GetSensitivity(void) const
190 return __sensitivity;
194 _CalEventInstanceImpl::IsRecurring(void) const
196 return __isRecurring;
200 _CalEventInstanceImpl::HasReminder(void) const
202 return __hasReminder;
206 _CalEventInstanceImpl::SetOriginalEventId(RecordId originalEventId)
208 __originalEventId = originalEventId;
212 _CalEventInstanceImpl::SetCalendarId(RecordId calendarId)
214 __calendarId = calendarId;
218 _CalEventInstanceImpl::SetStartTime(const DateTime& startTime)
220 __startDateTime = startTime;
224 _CalEventInstanceImpl::SetEndTime(const DateTime& endTime)
226 __endDateTime = endTime;
230 _CalEventInstanceImpl::SetSubject(const String& subject)
236 _CalEventInstanceImpl::SetDescription(const String& description)
238 __description = description;
242 _CalEventInstanceImpl::SetLocation(const String& location)
244 __location = location;
248 _CalEventInstanceImpl::SetAllDayEvent(bool isAllDayEvent)
250 __isAllDayEvent = isAllDayEvent;
254 _CalEventInstanceImpl::SetBusyStatus(BusyStatus busyStatus)
256 __busyStatus = busyStatus;
260 _CalEventInstanceImpl::SetStatus(EventStatus status)
266 _CalEventInstanceImpl::SetPriority(EventPriority priority)
268 __priority = priority;
272 _CalEventInstanceImpl::SetSensitivity(RecordSensitivity sensitivity)
274 __sensitivity = sensitivity;
278 _CalEventInstanceImpl::SetRecurring(bool isRecurring)
280 __isRecurring = isRecurring;
284 _CalEventInstanceImpl::SetHasReminder(bool hasReminder)
286 __hasReminder = hasReminder;
289 _CalEventInstanceImpl*
290 _CalEventInstanceImpl::GetInstance(CalEventInstance& eventInstance)
292 return eventInstance.__pCalEventInstanceImpl;
295 const _CalEventInstanceImpl*
296 _CalEventInstanceImpl::GetInstance(const CalEventInstance& eventInstance)
298 return eventInstance.__pCalEventInstanceImpl;