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_CalEventChangeInfoImpl.cpp
18 * @brief This is the implementation for _CalEventChangeInfoImpl class.
20 * This file contains definitions of @e _CalEventChangeInfoImpl class.
23 #include <FSclCalEventChangeInfo.h>
24 #include <FSclRecord.h>
25 #include "FScl_CalEventChangeInfoImpl.h"
26 #include "FScl_RecordImpl.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Social
33 const static int _INVALID_VERSION = -1;
35 _CalEventChangeInfoImpl::_CalEventChangeInfoImpl(void)
36 : __changeType(RECORD_CHANGE_TYPE_ADDED)
37 , __eventId(INVALID_RECORD_ID)
38 , __calendarId(INVALID_RECORD_ID)
39 , __version(_INVALID_VERSION)
43 _CalEventChangeInfoImpl::_CalEventChangeInfoImpl(const _CalEventChangeInfoImpl& rhs)
44 : __changeType(rhs.__changeType)
45 , __eventId(rhs.__eventId)
46 , __calendarId(rhs.__calendarId)
47 , __version(rhs.__version)
51 _CalEventChangeInfoImpl::~_CalEventChangeInfoImpl(void)
55 _CalEventChangeInfoImpl&
56 _CalEventChangeInfoImpl::operator =(const _CalEventChangeInfoImpl& rhs)
63 __changeType = rhs.__changeType;
64 __eventId = rhs.__eventId;
65 __calendarId = rhs.__calendarId;
66 __version = rhs.__version;
72 _CalEventChangeInfoImpl::Equals(const Object& rhs) const
74 const _CalEventChangeInfoImpl* pCalEventChangeInfoImpl = dynamic_cast<const _CalEventChangeInfoImpl*>(&rhs);
76 if (pCalEventChangeInfoImpl == null)
81 return (__changeType == pCalEventChangeInfoImpl->__changeType && __eventId == pCalEventChangeInfoImpl->__eventId
82 && __calendarId == pCalEventChangeInfoImpl->__calendarId && __version == pCalEventChangeInfoImpl->__version);
86 _CalEventChangeInfoImpl::GetHashCode(void) const
90 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __changeType;
91 hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __eventId);
92 hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __calendarId);
93 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __version;
99 _CalEventChangeInfoImpl::GetChangeType(void) const
105 _CalEventChangeInfoImpl::GetEventId(void) const
111 _CalEventChangeInfoImpl::GetCalendarId(void) const
117 _CalEventChangeInfoImpl::GetVersion(void) const
123 _CalEventChangeInfoImpl::SetChangeType(RecordChangeType changeType)
125 __changeType = changeType;
129 _CalEventChangeInfoImpl::SetEventId(RecordId eventId)
135 _CalEventChangeInfoImpl::SetCalendarId(RecordId calendarId)
137 __calendarId = calendarId;
141 _CalEventChangeInfoImpl::SetVersion(int version)
146 _CalEventChangeInfoImpl*
147 _CalEventChangeInfoImpl::GetInstance(CalEventChangeInfo& calEventChangeInfo)
149 return calEventChangeInfo.__pCalEventChangeInfoImpl;
152 const _CalEventChangeInfoImpl*
153 _CalEventChangeInfoImpl::GetInstance(const CalEventChangeInfo& calEventChangeInfo)
155 return calEventChangeInfo.__pCalEventChangeInfoImpl;