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_ReminderImpl.cpp
19 * @brief This is the implementation for _ReminderImpl class.
21 * This file contains definitions of @e _ReminderImpl class.
24 #include <FBaseSysLog.h>
25 #include <FBaseDateTime.h>
26 #include <FSclReminder.h>
27 #include "FScl_ReminderImpl.h"
28 #include "FScl_CalendarbookUtil.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::App;
33 namespace Tizen { namespace Social
36 _ReminderImpl::_ReminderImpl(void)
41 _ReminderImpl::_ReminderImpl(const _ReminderImpl& rhs)
42 : __absoluteTime(rhs.__absoluteTime)
48 _ReminderImpl::~_ReminderImpl(void)
53 _ReminderImpl::operator =(const _ReminderImpl& rhs)
60 __absoluteTime = rhs.__absoluteTime;
61 __isAbsolute = rhs.__isAbsolute;
67 _ReminderImpl::Equals(const Object& rhs) const
69 const _ReminderImpl* pReminderImpl = dynamic_cast<const _ReminderImpl*>(&rhs);
71 if (pReminderImpl == null)
76 return (__absoluteTime.Equals(pReminderImpl->__absoluteTime) && __isAbsolute == pReminderImpl->__isAbsolute);
80 _ReminderImpl::GetHashCode(void) const
84 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __absoluteTime.GetHashCode();
85 hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __isAbsolute;
91 _ReminderImpl::SetAbsoluteTime(const DateTime& time)
93 SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(time), E_INVALID_ARG, "Invalid argument is used. time = %S", time.ToString().GetPointer());
95 __absoluteTime = time;
102 _ReminderImpl::GetAbsoluteTime(void) const
104 return __absoluteTime;
108 _ReminderImpl::IsAbsolute(void) const
114 _ReminderImpl::GetInstance(Reminder& reminder)
116 return reminder.__pReminderImpl;
120 _ReminderImpl::GetInstance(const Reminder& reminder)
122 return reminder.__pReminderImpl;