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