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_CalEventChangeInfoImpl.cpp
19 * @brief This is the implementation for _CalEventChangeInfoImpl class.
21 * This file contains definitions of @e _CalEventChangeInfoImpl class.
24 #include <FSclCalEventChangeInfo.h>
25 #include <FSclRecord.h>
26 #include "FScl_CalEventChangeInfoImpl.h"
27 #include "FScl_RecordImpl.h"
29 using namespace Tizen::Base;
31 namespace Tizen { namespace Social
34 const static int _INVALID_VERSION = -1;
36 _CalEventChangeInfoImpl::_CalEventChangeInfoImpl(void)
37 : __changeType(RECORD_CHANGE_TYPE_ADDED)
38 , __eventId(INVALID_RECORD_ID)
39 , __calendarId(INVALID_RECORD_ID)
40 , __version(_INVALID_VERSION)
44 _CalEventChangeInfoImpl::_CalEventChangeInfoImpl(const _CalEventChangeInfoImpl& rhs)
45 : __changeType(rhs.__changeType)
46 , __eventId(rhs.__eventId)
47 , __calendarId(rhs.__calendarId)
48 , __version(rhs.__version)
52 _CalEventChangeInfoImpl::~_CalEventChangeInfoImpl(void)
56 _CalEventChangeInfoImpl&
57 _CalEventChangeInfoImpl::operator =(const _CalEventChangeInfoImpl& rhs)
64 __changeType = rhs.__changeType;
65 __eventId = rhs.__eventId;
66 __calendarId = rhs.__calendarId;
67 __version = rhs.__version;
73 _CalEventChangeInfoImpl::Equals(const Object& rhs) const
75 const _CalEventChangeInfoImpl* pCalEventChangeInfoImpl = dynamic_cast<const _CalEventChangeInfoImpl*>(&rhs);
77 if (pCalEventChangeInfoImpl == null)
82 return (__changeType == pCalEventChangeInfoImpl->__changeType && __eventId == pCalEventChangeInfoImpl->__eventId
83 && __calendarId == pCalEventChangeInfoImpl->__calendarId && __version == pCalEventChangeInfoImpl->__version);
87 _CalEventChangeInfoImpl::GetHashCode(void) const
91 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __changeType;
92 hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __eventId);
93 hashCode = static_cast<int>(( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __calendarId);
94 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __version;
100 _CalEventChangeInfoImpl::GetChangeType(void) const
106 _CalEventChangeInfoImpl::GetEventId(void) const
112 _CalEventChangeInfoImpl::GetCalendarId(void) const
118 _CalEventChangeInfoImpl::GetVersion(void) const
124 _CalEventChangeInfoImpl::SetChangeType(RecordChangeType changeType)
126 __changeType = changeType;
130 _CalEventChangeInfoImpl::SetEventId(RecordId eventId)
136 _CalEventChangeInfoImpl::SetCalendarId(RecordId calendarId)
138 __calendarId = calendarId;
142 _CalEventChangeInfoImpl::SetVersion(int version)
147 _CalEventChangeInfoImpl*
148 _CalEventChangeInfoImpl::GetInstance(CalEventChangeInfo& calEventChangeInfo)
150 return calEventChangeInfo.__pCalEventChangeInfoImpl;
153 const _CalEventChangeInfoImpl*
154 _CalEventChangeInfoImpl::GetInstance(const CalEventChangeInfo& calEventChangeInfo)
156 return calEventChangeInfo.__pCalEventChangeInfoImpl;