Modify the spec file for secure log
[framework/osp/social.git] / src / FSclContactEvent.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         FSclContactEvent.cpp
18 * @brief        This is the implementation for ContactEvent class.
19 *
20 * This file contains definitions of @e ContactEvent class.
21 */
22
23 #include <FSclContactEvent.h>
24 #include <FBaseSysLog.h>
25 #include "FScl_ContactEventImpl.h"
26
27 using namespace Tizen::Base;
28
29 namespace Tizen { namespace Social
30 {
31
32 ContactEvent::ContactEvent(void)
33 {
34         __pContactEventImpl = new (std::nothrow) _ContactEventImpl();
35         SysTryReturnVoidResult(NID_SCL, __pContactEventImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
36 }
37
38 ContactEvent::ContactEvent(const ContactEvent& rhs)
39 {
40         __pContactEventImpl = new (std::nothrow) _ContactEventImpl(*rhs.__pContactEventImpl);
41         SysTryReturnVoidResult(NID_SCL, __pContactEventImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
42 }
43
44 ContactEvent::~ContactEvent(void)
45 {
46         delete __pContactEventImpl;
47 }
48
49 ContactEvent&
50 ContactEvent::operator =(const ContactEvent& rhs)
51 {
52         if (this == &rhs)
53         {
54                 return *this;
55         }
56
57         *__pContactEventImpl = *rhs.__pContactEventImpl;
58
59         return *this;
60 }
61
62 bool
63 ContactEvent::operator ==(const ContactEvent& rhs) const
64 {
65         return *__pContactEventImpl == *rhs.__pContactEventImpl;
66 }
67
68 bool
69 ContactEvent::operator !=(const ContactEvent& rhs) const
70 {
71         return !(*this == rhs);
72 }
73
74 bool
75 ContactEvent::Equals(const Object& rhs) const
76 {
77         const ContactEvent* pContactEvent = dynamic_cast<const ContactEvent*>(&rhs);
78         if (pContactEvent == null)
79         {
80                 return false;
81         }
82
83         return __pContactEventImpl->Equals(*pContactEvent->__pContactEventImpl);
84 }
85
86 int
87 ContactEvent::GetHashCode(void) const
88 {
89         return __pContactEventImpl->GetHashCode();
90 }
91
92 ContactEventType
93 ContactEvent::GetType(void) const
94 {
95         return __pContactEventImpl->GetType();
96 }
97
98 DateTime
99 ContactEvent::GetDate(void) const
100 {
101         return __pContactEventImpl->GetDate();
102 }
103
104 String
105 ContactEvent::GetLabel(void) const
106 {
107         return __pContactEventImpl->GetLabel();
108 }
109
110 void
111 ContactEvent::SetType(ContactEventType type)
112 {
113         __pContactEventImpl->SetType(type);
114 }
115
116 void
117 ContactEvent::SetDate(const DateTime& date)
118 {
119         __pContactEventImpl->SetDate(date);
120 }
121
122 void
123 ContactEvent::SetLabel(const String& label)
124 {
125         __pContactEventImpl->SetLabel(label);
126 }
127
128 }} // Tizen::Social