Modify the spec file for secure log
[framework/osp/social.git] / src / FSclContactChangeInfo.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FSclContactChangeInfo.cpp
18  * @brief               This is the implementation for ContactChangeInfo class.
19  *
20  * This file contains definitions of @e ContactChangeInfo class.
21  */
22
23 #include <new>
24 #include <FBaseResult.h>
25 #include <FSclContactChangeInfo.h>
26 #include <FBaseSysLog.h>
27 #include "FScl_ContactChangeInfoImpl.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31
32 namespace Tizen { namespace Social
33 {
34
35 ContactChangeInfo::ContactChangeInfo(void)
36 {
37         __pContactChangeInfoImpl = new (std::nothrow) _ContactChangeInfoImpl();
38         SysTryReturnVoidResult(NID_SCL, __pContactChangeInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
39 }
40
41 ContactChangeInfo::ContactChangeInfo(const ContactChangeInfo& rhs)
42 {
43         __pContactChangeInfoImpl = new (std::nothrow) _ContactChangeInfoImpl(*rhs.__pContactChangeInfoImpl);
44         SysTryReturnVoidResult(NID_SCL, __pContactChangeInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
45 }
46
47 ContactChangeInfo::~ContactChangeInfo(void)
48 {
49         delete __pContactChangeInfoImpl;
50 }
51
52 ContactChangeInfo&
53 ContactChangeInfo::operator =(const ContactChangeInfo& rhs)
54 {
55         if (this == &rhs)
56         {
57                 return *this;
58         }
59
60         *__pContactChangeInfoImpl = *rhs.__pContactChangeInfoImpl;
61
62         return *this;
63 }
64
65 bool
66 ContactChangeInfo::Equals(const Object& rhs) const
67 {
68         const ContactChangeInfo* pContactChangeInfo = dynamic_cast<const ContactChangeInfo*>(&rhs);
69         if (pContactChangeInfo == null)
70         {
71                 return false;
72         }
73
74         return *__pContactChangeInfoImpl == *pContactChangeInfo->__pContactChangeInfoImpl;
75 }
76
77 int
78 ContactChangeInfo::GetHashCode(void) const
79 {
80         return __pContactChangeInfoImpl->GetHashCode();
81 }
82
83 AddressbookId
84 ContactChangeInfo::GetAddressbookId(void) const
85 {
86         return __pContactChangeInfoImpl->GetAddressbookId();
87 }
88
89 RecordId
90 ContactChangeInfo::GetContactId(void) const
91 {
92         return __pContactChangeInfoImpl->GetContactId();
93 }
94
95 int
96 ContactChangeInfo::GetVersion(void) const
97 {
98         return __pContactChangeInfoImpl->GetVersion();
99 }
100
101 RecordChangeType
102 ContactChangeInfo::GetChangeType(void) const
103 {
104         return __pContactChangeInfoImpl->GetChangeType();
105 }
106
107 bool
108 ContactChangeInfo::IsThumbnailChanged(void) const
109 {
110         return __pContactChangeInfoImpl->IsThumbnailChanged();
111 }
112
113 }} // Tizen::Social