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_CategoryChangeInfoImpl.cpp
19 * @brief This is the implementation for _CategoryChangeInfoImpl class.
21 * This file contains definitions of @e _CategoryChangeInfoImpl class.
25 #include <FBaseResult.h>
26 #include <FSclCategoryChangeInfo.h>
27 #include <FBaseSysLog.h>
28 #include "FScl_RecordImpl.h"
29 #include "FScl_CategoryChangeInfoImpl.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Base::Collection;
34 namespace Tizen { namespace Social
37 _CategoryChangeInfoImpl::_CategoryChangeInfoImpl(void)
38 : __categoryId(INVALID_RECORD_ID)
39 , __addressbookId(INVALID_ADDRESSBOOK_ID)
41 , __changeType(RECORD_CHANGE_TYPE_ADDED)
46 _CategoryChangeInfoImpl::_CategoryChangeInfoImpl(const _CategoryChangeInfoImpl& rhs)
48 __categoryId = rhs.__categoryId;
49 __addressbookId = rhs.__addressbookId;
50 __version = rhs.__version;
51 __changeType = rhs.__changeType;
54 _CategoryChangeInfoImpl::~_CategoryChangeInfoImpl(void)
59 _CategoryChangeInfoImpl&
60 _CategoryChangeInfoImpl::operator =(const _CategoryChangeInfoImpl& rhs)
67 __categoryId = rhs.__categoryId;
68 __addressbookId = rhs.__addressbookId;
69 __version = rhs.__version;
70 __changeType = rhs.__changeType;
76 _CategoryChangeInfoImpl::operator ==(const _CategoryChangeInfoImpl& rhs) const
78 if (__categoryId != rhs.__categoryId)
83 if (__addressbookId != rhs.__addressbookId)
88 if (__version != rhs.__version)
93 if (__changeType != rhs.__changeType)
103 _CategoryChangeInfoImpl::Equals(const Object& rhs) const
105 const _CategoryChangeInfoImpl* pCategoryChangeInfoImpl = dynamic_cast<const _CategoryChangeInfoImpl*>(&rhs);
107 if (pCategoryChangeInfoImpl == null)
112 return *this == *pCategoryChangeInfoImpl;
116 _CategoryChangeInfoImpl::GetHashCode(void) const
120 hashCode = __categoryId;
121 hashCode += __addressbookId;
122 hashCode += __version;
124 hashCode += __changeType;
130 _CategoryChangeInfoImpl::GetAddressbookId(void) const
132 return __addressbookId;
136 _CategoryChangeInfoImpl::SetAddressbookId(AddressbookId addressbookId)
138 __addressbookId = addressbookId;
142 _CategoryChangeInfoImpl::GetCategoryId(void) const
148 _CategoryChangeInfoImpl::GetVersion(void) const
154 _CategoryChangeInfoImpl::GetChangeType(void) const
160 _CategoryChangeInfoImpl::SetCategoryId(RecordId categoryId)
162 __categoryId = categoryId;
166 _CategoryChangeInfoImpl::SetVersion(int version)
172 _CategoryChangeInfoImpl::SetChangeType(RecordChangeType changeType)
174 __changeType = changeType;
177 _CategoryChangeInfoImpl*
178 _CategoryChangeInfoImpl::GetInstance(CategoryChangeInfo& categoryChangeInfo)
180 return categoryChangeInfo.__pCategoryChangeInfoImpl;
183 const _CategoryChangeInfoImpl*
184 _CategoryChangeInfoImpl::GetInstance(const CategoryChangeInfo& categoryChangeInfo)
186 return categoryChangeInfo.__pCategoryChangeInfoImpl;