// // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /** * @file FScl_ContactChangeInfoImpl.cpp * @brief This is the implementation for _ContactChangeInfoImpl class. * * This file contains definitions of @e _ContactChangeInfoImpl class. */ #include #include #include #include #include "FScl_RecordImpl.h" #include "FScl_ContactChangeInfoImpl.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; namespace Tizen { namespace Social { _ContactChangeInfoImpl::_ContactChangeInfoImpl(void) : __contactId(INVALID_RECORD_ID) , __addressbookId(INVALID_ADDRESSBOOK_ID) , __version(0) , __changeType(RECORD_CHANGE_TYPE_ADDED) , __isThumbnailChanged(false) { // empty body } _ContactChangeInfoImpl::_ContactChangeInfoImpl(const _ContactChangeInfoImpl& rhs) { __contactId = rhs.__contactId; __addressbookId = rhs.__addressbookId; __version = rhs.__version; __changeType = rhs.__changeType; __isThumbnailChanged = rhs.__isThumbnailChanged; } _ContactChangeInfoImpl::~_ContactChangeInfoImpl(void) { // empty body } _ContactChangeInfoImpl& _ContactChangeInfoImpl::operator =(const _ContactChangeInfoImpl& rhs) { if (this == &rhs) { return *this; } __contactId = rhs.__contactId; __addressbookId = rhs.__addressbookId; __version = rhs.__version; __changeType = rhs.__changeType; __isThumbnailChanged = rhs.__isThumbnailChanged; return *this; } bool _ContactChangeInfoImpl::operator ==(const _ContactChangeInfoImpl& rhs) const { if (__contactId != rhs.__contactId) { return false; } if (__addressbookId != rhs.__addressbookId) { return false; } if (__version != rhs.__version) { return false; } if (__changeType != rhs.__changeType) { return false; } if (__isThumbnailChanged != rhs.__isThumbnailChanged) { return false; } return true; } bool _ContactChangeInfoImpl::Equals(const Object& rhs) const { const _ContactChangeInfoImpl* pContactChangeInfoImpl = dynamic_cast(&rhs); if (pContactChangeInfoImpl == null) { return false; } return *this == *pContactChangeInfoImpl; } int _ContactChangeInfoImpl::GetHashCode(void) const { int hashCode = 0; hashCode = __contactId; hashCode += __addressbookId; hashCode += __version; hashCode += __changeType; hashCode += __isThumbnailChanged; return hashCode; } AddressbookId _ContactChangeInfoImpl::GetAddressbookId(void) const { return __addressbookId; } void _ContactChangeInfoImpl::SetAddressbookId(AddressbookId addressbookId) { __addressbookId = addressbookId; } RecordId _ContactChangeInfoImpl::GetContactId(void) const { return __contactId; } int _ContactChangeInfoImpl::GetVersion(void) const { return __version; } RecordChangeType _ContactChangeInfoImpl::GetChangeType(void) const { return __changeType; } void _ContactChangeInfoImpl::SetContactId(RecordId contactId) { __contactId = contactId; } void _ContactChangeInfoImpl::SetVersion(int version) { __version = version; } void _ContactChangeInfoImpl::SetChangeType(RecordChangeType changeType) { __changeType = changeType; } bool _ContactChangeInfoImpl::IsThumbnailChanged(void) const { return __isThumbnailChanged; } void _ContactChangeInfoImpl::SetThumbnailChangeStatus(bool isChanged) { __isThumbnailChanged = isChanged; } _ContactChangeInfoImpl* _ContactChangeInfoImpl::GetInstance(ContactChangeInfo& contactChangeInfo) { return contactChangeInfo.__pContactChangeInfoImpl; } const _ContactChangeInfoImpl* _ContactChangeInfoImpl::GetInstance(const ContactChangeInfo& contactChangeInfo) { return contactChangeInfo.__pContactChangeInfoImpl; } }} // Tizen::Social