remove return on void function
[framework/osp/social.git] / src / FScl_ReminderImpl.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FScl_ReminderImpl.cpp
18  * @brief               This is the implementation for _ReminderImpl class.
19  *
20  * This file contains definitions of @e _ReminderImpl class.
21  */
22
23 #include <FBaseSysLog.h>
24 #include <FBaseDateTime.h>
25 #include <FSclReminder.h>
26 #include "FScl_ReminderImpl.h"
27 #include "FScl_CalendarbookUtil.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::App;
31
32 namespace Tizen { namespace Social
33 {
34
35 _ReminderImpl::_ReminderImpl(void)
36 {
37
38 }
39
40 _ReminderImpl::_ReminderImpl(const _ReminderImpl& rhs)
41         : __absoluteTime(rhs.__absoluteTime)
42         , __isAbsolute(false)
43 {
44
45 }
46
47 _ReminderImpl::~_ReminderImpl(void)
48 {
49 }
50
51 _ReminderImpl&
52 _ReminderImpl::operator =(const _ReminderImpl& rhs)
53 {
54         if (this == &rhs)
55         {
56                 return *this;
57         }
58
59         __absoluteTime = rhs.__absoluteTime;
60         __isAbsolute = rhs.__isAbsolute;
61
62         return *this;
63 }
64
65 bool
66 _ReminderImpl::Equals(const Object& rhs) const
67 {
68         const _ReminderImpl* pReminderImpl = dynamic_cast<const _ReminderImpl*>(&rhs);
69
70         if (pReminderImpl == null)
71         {
72                 return false;
73         }
74
75         return (__absoluteTime.Equals(pReminderImpl->__absoluteTime) && __isAbsolute == pReminderImpl->__isAbsolute);
76 }
77
78 int
79 _ReminderImpl::GetHashCode(void) const
80 {
81         int hashCode = 17;
82
83         hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __absoluteTime.GetHashCode();
84         hashCode = ( hashCode << 4 ) ^ ( hashCode >> 28 ) ^ __isAbsolute;
85
86         return hashCode;
87 }
88
89 result
90 _ReminderImpl::SetAbsoluteTime(const DateTime& time)
91 {
92         SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(time), E_INVALID_ARG, "Invalid argument is used. time = %S", time.ToString().GetPointer());
93
94         __absoluteTime = time;
95         __isAbsolute = true;
96
97         return E_SUCCESS;
98 }
99
100 DateTime
101 _ReminderImpl::GetAbsoluteTime(void) const
102 {
103         return __absoluteTime;
104 }
105
106 bool
107 _ReminderImpl::IsAbsolute(void) const
108 {
109         return __isAbsolute;
110 }
111
112 _ReminderImpl*
113 _ReminderImpl::GetInstance(Reminder& reminder)
114 {
115         return reminder.__pReminderImpl;
116 }
117
118 const _ReminderImpl*
119 _ReminderImpl::GetInstance(const Reminder& reminder)
120 {
121         return reminder.__pReminderImpl;
122 }
123
124 }}      // Tizen::Social