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