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_ContactChangeInfoImpl.cpp
19 * @brief This is the implementation for _ContactChangeInfoImpl class.
21 * This file contains definitions of @e _ContactChangeInfoImpl class.
25 #include <FBaseResult.h>
26 #include <FSclContactChangeInfo.h>
27 #include <FBaseSysLog.h>
28 #include "FScl_RecordImpl.h"
29 #include "FScl_ContactChangeInfoImpl.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Base::Collection;
34 namespace Tizen { namespace Social
37 _ContactChangeInfoImpl::_ContactChangeInfoImpl(void)
38 : __contactId(INVALID_RECORD_ID)
39 , __addressbookId(INVALID_ADDRESSBOOK_ID)
41 , __changeType(RECORD_CHANGE_TYPE_ADDED)
42 , __isThumbnailChanged(false)
47 _ContactChangeInfoImpl::_ContactChangeInfoImpl(const _ContactChangeInfoImpl& rhs)
49 __contactId = rhs.__contactId;
50 __addressbookId = rhs.__addressbookId;
51 __version = rhs.__version;
52 __changeType = rhs.__changeType;
53 __isThumbnailChanged = rhs.__isThumbnailChanged;
56 _ContactChangeInfoImpl::~_ContactChangeInfoImpl(void)
61 _ContactChangeInfoImpl&
62 _ContactChangeInfoImpl::operator =(const _ContactChangeInfoImpl& rhs)
69 __contactId = rhs.__contactId;
70 __addressbookId = rhs.__addressbookId;
71 __version = rhs.__version;
72 __changeType = rhs.__changeType;
73 __isThumbnailChanged = rhs.__isThumbnailChanged;
79 _ContactChangeInfoImpl::operator ==(const _ContactChangeInfoImpl& rhs) const
81 if (__contactId != rhs.__contactId)
86 if (__addressbookId != rhs.__addressbookId)
91 if (__version != rhs.__version)
96 if (__changeType != rhs.__changeType)
101 if (__isThumbnailChanged != rhs.__isThumbnailChanged)
112 _ContactChangeInfoImpl::Equals(const Object& rhs) const
114 const _ContactChangeInfoImpl* pContactChangeInfoImpl = dynamic_cast<const _ContactChangeInfoImpl*>(&rhs);
116 if (pContactChangeInfoImpl == null)
121 return *this == *pContactChangeInfoImpl;
125 _ContactChangeInfoImpl::GetHashCode(void) const
129 hashCode = __contactId;
130 hashCode += __addressbookId;
131 hashCode += __version;
132 hashCode += __changeType;
133 hashCode += __isThumbnailChanged;
139 _ContactChangeInfoImpl::GetAddressbookId(void) const
141 return __addressbookId;
145 _ContactChangeInfoImpl::SetAddressbookId(AddressbookId addressbookId)
147 __addressbookId = addressbookId;
151 _ContactChangeInfoImpl::GetContactId(void) const
157 _ContactChangeInfoImpl::GetVersion(void) const
163 _ContactChangeInfoImpl::GetChangeType(void) const
169 _ContactChangeInfoImpl::SetContactId(RecordId contactId)
171 __contactId = contactId;
175 _ContactChangeInfoImpl::SetVersion(int version)
181 _ContactChangeInfoImpl::SetChangeType(RecordChangeType changeType)
183 __changeType = changeType;
187 _ContactChangeInfoImpl::IsThumbnailChanged(void) const
189 return __isThumbnailChanged;
193 _ContactChangeInfoImpl::SetThumbnailChangeStatus(bool isChanged)
195 __isThumbnailChanged = isChanged;
198 _ContactChangeInfoImpl*
199 _ContactChangeInfoImpl::GetInstance(ContactChangeInfo& contactChangeInfo)
201 return contactChangeInfo.__pContactChangeInfoImpl;
204 const _ContactChangeInfoImpl*
205 _ContactChangeInfoImpl::GetInstance(const ContactChangeInfo& contactChangeInfo)
207 return contactChangeInfo.__pContactChangeInfoImpl;