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_ContactChangeInfoImpl.cpp
18 * @brief This is the implementation for _ContactChangeInfoImpl class.
20 * This file contains definitions of @e _ContactChangeInfoImpl class.
24 #include <FBaseResult.h>
25 #include <FSclContactChangeInfo.h>
26 #include <FBaseSysLog.h>
27 #include "FScl_RecordImpl.h"
28 #include "FScl_ContactChangeInfoImpl.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
33 namespace Tizen { namespace Social
36 _ContactChangeInfoImpl::_ContactChangeInfoImpl(void)
37 : __contactId(INVALID_RECORD_ID)
38 , __addressbookId(INVALID_ADDRESSBOOK_ID)
40 , __changeType(RECORD_CHANGE_TYPE_ADDED)
41 , __isThumbnailChanged(false)
46 _ContactChangeInfoImpl::_ContactChangeInfoImpl(const _ContactChangeInfoImpl& rhs)
48 __contactId = rhs.__contactId;
49 __addressbookId = rhs.__addressbookId;
50 __version = rhs.__version;
51 __changeType = rhs.__changeType;
52 __isThumbnailChanged = rhs.__isThumbnailChanged;
55 _ContactChangeInfoImpl::~_ContactChangeInfoImpl(void)
60 _ContactChangeInfoImpl&
61 _ContactChangeInfoImpl::operator =(const _ContactChangeInfoImpl& rhs)
68 __contactId = rhs.__contactId;
69 __addressbookId = rhs.__addressbookId;
70 __version = rhs.__version;
71 __changeType = rhs.__changeType;
72 __isThumbnailChanged = rhs.__isThumbnailChanged;
78 _ContactChangeInfoImpl::operator ==(const _ContactChangeInfoImpl& rhs) const
80 if (__contactId != rhs.__contactId)
85 if (__addressbookId != rhs.__addressbookId)
90 if (__version != rhs.__version)
95 if (__changeType != rhs.__changeType)
100 if (__isThumbnailChanged != rhs.__isThumbnailChanged)
111 _ContactChangeInfoImpl::Equals(const Object& rhs) const
113 const _ContactChangeInfoImpl* pContactChangeInfoImpl = dynamic_cast<const _ContactChangeInfoImpl*>(&rhs);
115 if (pContactChangeInfoImpl == null)
120 return *this == *pContactChangeInfoImpl;
124 _ContactChangeInfoImpl::GetHashCode(void) const
128 hashCode = __contactId;
129 hashCode += __addressbookId;
130 hashCode += __version;
131 hashCode += __changeType;
132 hashCode += __isThumbnailChanged;
138 _ContactChangeInfoImpl::GetAddressbookId(void) const
140 return __addressbookId;
144 _ContactChangeInfoImpl::SetAddressbookId(AddressbookId addressbookId)
146 __addressbookId = addressbookId;
150 _ContactChangeInfoImpl::GetContactId(void) const
156 _ContactChangeInfoImpl::GetVersion(void) const
162 _ContactChangeInfoImpl::GetChangeType(void) const
168 _ContactChangeInfoImpl::SetContactId(RecordId contactId)
170 __contactId = contactId;
174 _ContactChangeInfoImpl::SetVersion(int version)
180 _ContactChangeInfoImpl::SetChangeType(RecordChangeType changeType)
182 __changeType = changeType;
186 _ContactChangeInfoImpl::IsThumbnailChanged(void) const
188 return __isThumbnailChanged;
192 _ContactChangeInfoImpl::SetThumbnailChangeStatus(bool isChanged)
194 __isThumbnailChanged = isChanged;
197 _ContactChangeInfoImpl*
198 _ContactChangeInfoImpl::GetInstance(ContactChangeInfo& contactChangeInfo)
200 return contactChangeInfo.__pContactChangeInfoImpl;
203 const _ContactChangeInfoImpl*
204 _ContactChangeInfoImpl::GetInstance(const ContactChangeInfo& contactChangeInfo)
206 return contactChangeInfo.__pContactChangeInfoImpl;