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 FScl_ContactEventImpl.cpp
18 * @brief This is the implementation for _ContactEventImpl class.
20 * This file contains definitions of @e _ContactEventImpl 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 _ContactEventImpl::_ContactEventImpl(void)
33 : __type(CONTACT_EVENT_TYPE_BIRTHDAY)
34 , __isDateChanged(false)
38 _ContactEventImpl::_ContactEventImpl(const _ContactEventImpl& rhs)
42 __label = rhs.__label;
43 __isDateChanged = rhs.__isDateChanged;
46 _ContactEventImpl::~_ContactEventImpl(void)
52 _ContactEventImpl::operator =(const _ContactEventImpl& rhs)
61 __label = rhs.__label;
62 __isDateChanged = rhs.__isDateChanged;
68 _ContactEventImpl::operator ==(const _ContactEventImpl& rhs) const
70 if (__date != rhs.__date)
75 if (__type != rhs.__type)
80 if (__label != rhs.__label)
89 _ContactEventImpl::operator !=(const _ContactEventImpl& rhs) const
91 return !(*this == rhs);
95 _ContactEventImpl::Equals(const Object& rhs) const
97 const _ContactEventImpl* pContactEvent = dynamic_cast<const _ContactEventImpl*>(&rhs);
98 if (pContactEvent == null)
103 return *this == *pContactEvent;
107 _ContactEventImpl::GetHashCode(void) const
109 int hash = __date.GetHashCode() + __label.GetHashCode() + __type;
115 _ContactEventImpl::GetType(void) const
121 _ContactEventImpl::GetDate(void) const
127 _ContactEventImpl::GetLabel(void) const
133 _ContactEventImpl::SetType(ContactEventType type)
139 _ContactEventImpl::SetDate(const DateTime& date)
142 __isDateChanged = true;
146 _ContactEventImpl::SetLabel(const String& label)
152 _ContactEventImpl::IsDateChanged(void) const
154 return __isDateChanged;
157 const _ContactEventImpl*
158 _ContactEventImpl::GetInstance(const ContactEvent& contactEvent)
160 return contactEvent.__pContactEventImpl;
164 _ContactEventImpl::GetInstance(ContactEvent& contactEvent)
166 return contactEvent.__pContactEventImpl;