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 FSclContactEvent.cpp
19 * @brief This is the implementation for ContactEvent class.
21 * This file contains definitions of @e ContactEvent class.
24 #include <FSclContactEvent.h>
25 #include <FBaseSysLog.h>
26 #include "FScl_ContactEventImpl.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Social
33 ContactEvent::ContactEvent(void)
35 __pContactEventImpl = new (std::nothrow) _ContactEventImpl();
36 SysTryReturnVoidResult(NID_SCL, __pContactEventImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
39 ContactEvent::ContactEvent(const ContactEvent& rhs)
41 __pContactEventImpl = new (std::nothrow) _ContactEventImpl(*rhs.__pContactEventImpl);
42 SysTryReturnVoidResult(NID_SCL, __pContactEventImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
45 ContactEvent::~ContactEvent(void)
47 delete __pContactEventImpl;
51 ContactEvent::operator =(const ContactEvent& rhs)
58 *__pContactEventImpl = *rhs.__pContactEventImpl;
64 ContactEvent::operator ==(const ContactEvent& rhs) const
66 return *__pContactEventImpl == *rhs.__pContactEventImpl;
70 ContactEvent::operator !=(const ContactEvent& rhs) const
72 return !(*this == rhs);
76 ContactEvent::Equals(const Object& rhs) const
78 const ContactEvent* pContactEvent = dynamic_cast<const ContactEvent*>(&rhs);
79 if (pContactEvent == null)
84 return __pContactEventImpl->Equals(*pContactEvent->__pContactEventImpl);
88 ContactEvent::GetHashCode(void) const
90 return __pContactEventImpl->GetHashCode();
94 ContactEvent::GetType(void) const
96 return __pContactEventImpl->GetType();
100 ContactEvent::GetDate(void) const
102 return __pContactEventImpl->GetDate();
106 ContactEvent::GetLabel(void) const
108 return __pContactEventImpl->GetLabel();
112 ContactEvent::SetType(ContactEventType type)
114 __pContactEventImpl->SetType(type);
118 ContactEvent::SetDate(const DateTime& date)
120 __pContactEventImpl->SetDate(date);
124 ContactEvent::SetLabel(const String& label)
126 __pContactEventImpl->SetLabel(label);