2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FSclContactEvent.cpp
18 * @brief This is the implementation for ContactEvent class.
20 * This file contains definitions of @e ContactEvent class.
23 #include <FSclContactEvent.h>
24 #include <FBaseSysLog.h>
25 #include "FScl_ContactEventImpl.h"
27 using namespace Tizen::Base;
29 namespace Tizen { namespace Social
32 ContactEvent::ContactEvent(void)
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));
38 ContactEvent::ContactEvent(const ContactEvent& rhs)
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));
44 ContactEvent::~ContactEvent(void)
46 delete __pContactEventImpl;
50 ContactEvent::operator =(const ContactEvent& rhs)
57 *__pContactEventImpl = *rhs.__pContactEventImpl;
63 ContactEvent::operator ==(const ContactEvent& rhs) const
65 return *__pContactEventImpl == *rhs.__pContactEventImpl;
69 ContactEvent::operator !=(const ContactEvent& rhs) const
71 return !(*this == rhs);
75 ContactEvent::Equals(const Object& rhs) const
77 const ContactEvent* pContactEvent = dynamic_cast<const ContactEvent*>(&rhs);
78 if (pContactEvent == null)
83 return __pContactEventImpl->Equals(*pContactEvent->__pContactEventImpl);
87 ContactEvent::GetHashCode(void) const
89 return __pContactEventImpl->GetHashCode();
93 ContactEvent::GetType(void) const
95 return __pContactEventImpl->GetType();
99 ContactEvent::GetDate(void) const
101 return __pContactEventImpl->GetDate();
105 ContactEvent::GetLabel(void) const
107 return __pContactEventImpl->GetLabel();
111 ContactEvent::SetType(ContactEventType type)
113 __pContactEventImpl->SetType(type);
117 ContactEvent::SetDate(const DateTime& date)
119 __pContactEventImpl->SetDate(date);
123 ContactEvent::SetLabel(const String& label)
125 __pContactEventImpl->SetLabel(label);