Fixed update instance
[framework/osp/social.git] / src / FSclCalEventInstance.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file                FSclCalEventInstance.cpp
19  * @brief               This is the implementation for CalEventInstance class.
20  *
21  * This file contains definitions of @e CalEventInstance class.
22  */
23
24 #include <FBaseResult.h>
25 #include <FBaseString.h>
26 #include <FBaseDateTime.h>
27 #include <FSclCalEventInstance.h>
28 #include <FBaseSysLog.h>
29 #include "FScl_CalEventInstanceImpl.h"
30
31 using namespace Tizen::Base;
32
33 namespace Tizen { namespace Social {
34
35 CalEventInstance::CalEventInstance(void)
36         : __pCalEventInstanceImpl(null)
37 {
38         __pCalEventInstanceImpl = new (std::nothrow) _CalEventInstanceImpl();
39         SysTryReturnVoidResult(NID_SCL, __pCalEventInstanceImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
40 }
41
42 CalEventInstance::CalEventInstance(const CalEventInstance& rhs)
43         : __pCalEventInstanceImpl(null)
44 {
45         __pCalEventInstanceImpl = new (std::nothrow) _CalEventInstanceImpl(*rhs.__pCalEventInstanceImpl);
46         SysTryReturnVoidResult(NID_SCL, __pCalEventInstanceImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
47 }
48
49 CalEventInstance::~CalEventInstance(void)
50 {
51         delete __pCalEventInstanceImpl;
52 }
53
54 CalEventInstance&
55 CalEventInstance::operator =(const CalEventInstance& rhs)
56 {
57         if (this == &rhs)
58         {
59                 return *this;
60         }
61
62         *__pCalEventInstanceImpl = *rhs.__pCalEventInstanceImpl;
63
64         return *this;
65 }
66
67 bool
68 CalEventInstance::Equals(const Object& rhs) const
69 {
70         const CalEventInstance* pCalEventInstance = dynamic_cast<const CalEventInstance*>(&rhs);
71         if (pCalEventInstance == null)
72         {
73                 return false;
74         }
75
76         return __pCalEventInstanceImpl->Equals(*_CalEventInstanceImpl::GetInstance(*pCalEventInstance));
77 }
78
79 int
80 CalEventInstance::GetHashCode(void) const
81 {
82         return __pCalEventInstanceImpl->GetHashCode();
83 }
84
85 RecordId
86 CalEventInstance::GetOriginalEventId(void) const
87 {
88         return __pCalEventInstanceImpl->GetOriginalEventId();
89 }
90
91 RecordId
92 CalEventInstance::GetCalendarId(void) const
93 {
94         return __pCalEventInstanceImpl->GetCalendarId();
95 }
96
97 DateTime
98 CalEventInstance::GetStartTime(void) const
99 {
100         return __pCalEventInstanceImpl->GetStartTime();
101 }
102
103 DateTime
104 CalEventInstance::GetEndTime(void) const
105 {
106         return __pCalEventInstanceImpl->GetEndTime();
107 }
108
109 String
110 CalEventInstance::GetSubject(void) const
111 {
112         return __pCalEventInstanceImpl->GetSubject();
113 }
114
115 String
116 CalEventInstance::GetDescription(void) const
117 {
118         return __pCalEventInstanceImpl->GetDescription();
119 }
120
121 String
122 CalEventInstance::GetLocation(void) const
123 {
124         return __pCalEventInstanceImpl->GetLocation();
125 }
126
127 bool
128 CalEventInstance::IsAllDayEvent(void) const
129 {
130         return __pCalEventInstanceImpl->IsAllDayEvent();
131 }
132
133 BusyStatus
134 CalEventInstance::GetBusyStatus(void) const
135 {
136         return __pCalEventInstanceImpl->GetBusyStatus();
137 }
138
139 EventStatus
140 CalEventInstance::GetStatus(void) const
141 {
142         return __pCalEventInstanceImpl->GetStatus();
143 }
144
145 EventPriority
146 CalEventInstance::GetPriority(void) const
147 {
148         return __pCalEventInstanceImpl->GetPriority();
149 }
150
151 RecordSensitivity
152 CalEventInstance::GetSensitivity(void) const
153 {
154         return __pCalEventInstanceImpl->GetSensitivity();
155 }
156
157 bool
158 CalEventInstance::IsRecurring(void) const
159 {
160         return __pCalEventInstanceImpl->IsRecurring();
161 }
162
163 bool
164 CalEventInstance::HasReminder(void) const
165 {
166         return __pCalEventInstanceImpl->HasReminder();
167 }
168
169 }} // Tizen::Social