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 FScl_ContactEventImpl.cpp
19 * @brief This is the implementation for _ContactEventImpl class.
21 * This file contains definitions of @e _ContactEventImpl 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 _ContactEventImpl::_ContactEventImpl(void)
34 : __type(CONTACT_EVENT_TYPE_BIRTHDAY)
35 , __isDateChanged(false)
39 _ContactEventImpl::_ContactEventImpl(const _ContactEventImpl& rhs)
43 __label = rhs.__label;
44 __isDateChanged = rhs.__isDateChanged;
47 _ContactEventImpl::~_ContactEventImpl(void)
53 _ContactEventImpl::operator =(const _ContactEventImpl& rhs)
62 __label = rhs.__label;
63 __isDateChanged = rhs.__isDateChanged;
69 _ContactEventImpl::operator ==(const _ContactEventImpl& rhs) const
71 if (__date != rhs.__date)
76 if (__type != rhs.__type)
81 if (__label != rhs.__label)
90 _ContactEventImpl::operator !=(const _ContactEventImpl& rhs) const
92 return !(*this == rhs);
96 _ContactEventImpl::Equals(const Object& rhs) const
98 const _ContactEventImpl* pContactEvent = dynamic_cast<const _ContactEventImpl*>(&rhs);
99 if (pContactEvent == null)
104 return *this == *pContactEvent;
108 _ContactEventImpl::GetHashCode(void) const
110 int hash = __date.GetHashCode() + __label.GetHashCode() + __type;
116 _ContactEventImpl::GetType(void) const
122 _ContactEventImpl::GetDate(void) const
128 _ContactEventImpl::GetLabel(void) const
134 _ContactEventImpl::SetType(ContactEventType type)
140 _ContactEventImpl::SetDate(const DateTime& date)
143 __isDateChanged = true;
147 _ContactEventImpl::SetLabel(const String& label)
153 _ContactEventImpl::IsDateChanged(void) const
155 return __isDateChanged;
158 const _ContactEventImpl*
159 _ContactEventImpl::GetInstance(const ContactEvent& contactEvent)
161 return contactEvent.__pContactEventImpl;
165 _ContactEventImpl::GetInstance(ContactEvent& contactEvent)
167 return contactEvent.__pContactEventImpl;