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_CategoryChangeInfoImpl.cpp
18 * @brief This is the implementation for _CategoryChangeInfoImpl class.
20 * This file contains definitions of @e _CategoryChangeInfoImpl class.
24 #include <FBaseResult.h>
25 #include <FSclCategoryChangeInfo.h>
26 #include <FBaseSysLog.h>
27 #include "FScl_RecordImpl.h"
28 #include "FScl_CategoryChangeInfoImpl.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
33 namespace Tizen { namespace Social
36 _CategoryChangeInfoImpl::_CategoryChangeInfoImpl(void)
37 : __categoryId(INVALID_RECORD_ID)
38 , __addressbookId(INVALID_ADDRESSBOOK_ID)
40 , __changeType(RECORD_CHANGE_TYPE_ADDED)
45 _CategoryChangeInfoImpl::_CategoryChangeInfoImpl(const _CategoryChangeInfoImpl& rhs)
47 __categoryId = rhs.__categoryId;
48 __addressbookId = rhs.__addressbookId;
49 __version = rhs.__version;
50 __changeType = rhs.__changeType;
53 _CategoryChangeInfoImpl::~_CategoryChangeInfoImpl(void)
58 _CategoryChangeInfoImpl&
59 _CategoryChangeInfoImpl::operator =(const _CategoryChangeInfoImpl& rhs)
66 __categoryId = rhs.__categoryId;
67 __addressbookId = rhs.__addressbookId;
68 __version = rhs.__version;
69 __changeType = rhs.__changeType;
75 _CategoryChangeInfoImpl::operator ==(const _CategoryChangeInfoImpl& rhs) const
77 if (__categoryId != rhs.__categoryId)
82 if (__addressbookId != rhs.__addressbookId)
87 if (__version != rhs.__version)
92 if (__changeType != rhs.__changeType)
102 _CategoryChangeInfoImpl::Equals(const Object& rhs) const
104 const _CategoryChangeInfoImpl* pCategoryChangeInfoImpl = dynamic_cast<const _CategoryChangeInfoImpl*>(&rhs);
106 if (pCategoryChangeInfoImpl == null)
111 return *this == *pCategoryChangeInfoImpl;
115 _CategoryChangeInfoImpl::GetHashCode(void) const
119 hashCode = __categoryId;
120 hashCode += __addressbookId;
121 hashCode += __version;
123 hashCode += __changeType;
129 _CategoryChangeInfoImpl::GetAddressbookId(void) const
131 return __addressbookId;
135 _CategoryChangeInfoImpl::SetAddressbookId(AddressbookId addressbookId)
137 __addressbookId = addressbookId;
141 _CategoryChangeInfoImpl::GetCategoryId(void) const
147 _CategoryChangeInfoImpl::GetVersion(void) const
153 _CategoryChangeInfoImpl::GetChangeType(void) const
159 _CategoryChangeInfoImpl::SetCategoryId(RecordId categoryId)
161 __categoryId = categoryId;
165 _CategoryChangeInfoImpl::SetVersion(int version)
171 _CategoryChangeInfoImpl::SetChangeType(RecordChangeType changeType)
173 __changeType = changeType;
176 _CategoryChangeInfoImpl*
177 _CategoryChangeInfoImpl::GetInstance(CategoryChangeInfo& categoryChangeInfo)
179 return categoryChangeInfo.__pCategoryChangeInfoImpl;
182 const _CategoryChangeInfoImpl*
183 _CategoryChangeInfoImpl::GetInstance(const CategoryChangeInfo& categoryChangeInfo)
185 return categoryChangeInfo.__pCategoryChangeInfoImpl;