Fix the boiler plate codes
[framework/osp/social.git] / src / FSclPhoneNumberContact.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                FSclPhoneNumberContact.cpp
18  * @brief               This is the implementation for PhoneNumberContact class.
19  *
20  * This file contains definitions of @e PhoneNumberContact class.
21  */
22
23 #include <new>
24 #include <FBaseSysLog.h>
25 #include <FSclPhoneNumberContact.h>
26 #include "FScl_PhoneNumberContactImpl.h"
27
28 using namespace Tizen::Base;
29
30 namespace Tizen { namespace Social
31 {
32
33 PhoneNumberContact::PhoneNumberContact(void)
34 {
35         __pPhoneNumberContactImpl = new (std::nothrow) _PhoneNumberContactImpl();
36         SysTryReturnVoidResult(NID_SCL, __pPhoneNumberContactImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
37 }
38
39 PhoneNumberContact::PhoneNumberContact(const PhoneNumberContact& rhs)
40 {
41         __pPhoneNumberContactImpl = new (std::nothrow) _PhoneNumberContactImpl(*rhs.__pPhoneNumberContactImpl);
42         SysTryReturnVoidResult(NID_SCL, __pPhoneNumberContactImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
43 }
44
45 PhoneNumberContact::~PhoneNumberContact(void)
46 {
47         delete __pPhoneNumberContactImpl;
48 }
49
50 PhoneNumberContact&
51 PhoneNumberContact::operator =(const PhoneNumberContact& rhs)
52 {
53         if (this == &rhs)
54         {
55                 return *this;
56         }
57
58         *__pPhoneNumberContactImpl = *rhs.__pPhoneNumberContactImpl;
59
60         return *this;
61 }
62
63 bool
64 PhoneNumberContact::Equals(const Object& obj) const
65 {
66         const PhoneNumberContact* pPhoneNumberContact = dynamic_cast<const PhoneNumberContact*>(&obj);
67
68         if (pPhoneNumberContact == null)
69         {
70                 return false;
71         }
72
73         return *__pPhoneNumberContactImpl == *pPhoneNumberContact->__pPhoneNumberContactImpl;
74 }
75
76 int
77 PhoneNumberContact::GetHashCode(void) const
78 {
79         return __pPhoneNumberContactImpl->GetHashCode();
80 }
81
82 PersonId
83 PhoneNumberContact::GetPersonId(void) const
84 {
85         return __pPhoneNumberContactImpl->GetPersonId();
86 }
87
88 AddressbookId
89 PhoneNumberContact::GetAddressbookId(void) const
90 {
91         return __pPhoneNumberContactImpl->GetAddressbookId();
92 }
93
94 RecordId
95 PhoneNumberContact::GetContactId(void) const
96 {
97         return __pPhoneNumberContactImpl->GetContactId();
98 }
99
100 String
101 PhoneNumberContact::GetDisplayName(void) const
102 {
103         return __pPhoneNumberContactImpl->GetDisplayName();
104 }
105
106 String
107 PhoneNumberContact::GetRingtonePath(void) const
108 {
109         return __pPhoneNumberContactImpl->GetRingtonePath();
110 }
111
112 String
113 PhoneNumberContact::GetThumbnailPath(void) const
114 {
115         return __pPhoneNumberContactImpl->GetThumbnailPath();
116 }
117
118 PhoneNumber
119 PhoneNumberContact::GetPhoneNumber(void) const
120 {
121         return __pPhoneNumberContactImpl->GetPhoneNumber();
122 }
123 }}  // Tizen::Social