2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
18 #ifndef _ABSTRACT_LAYER_ICALENDAR_H_
19 #define _ABSTRACT_LAYER_ICALENDAR_H_
23 #include <dpl/log/log.h>
24 #include <dpl/shared_ptr.h>
25 #include "CalendarEvent.h"
26 #include "EventFilter.h"
27 #include "IEventAddEvent.h"
28 #include "IEventAddEvents.h"
29 #include "IEventCreateEvent.h"
30 #include "IEventDeleteEvent.h"
31 #include "IEventDeleteEvents.h"
32 #include "IEventFindEvents.h"
33 #include "IEventUpdateEvent.h"
34 #include "IEventUpdateEvents.h"
35 #include "IEventCreateEventFromString.h"
36 #include "IEventExportEventToString.h"
37 #include "IEventWatchChanges.h"
38 #include "IEventClearWatch.h"
39 #include "IEventExpandEventRecurrence.h"
40 #include "OnAddEventsChanged.h"
41 #include "OnUpdateEventsChanged.h"
42 #include "OnDeleteEventsChanged.h"
43 #include "OnEventsChanged.h"
49 class ICalendar : public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvent >,
50 public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvents >,
51 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvent >,
52 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvents >,
53 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvent >,
54 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvents >,
55 public WrtDeviceApis::Commons::EventRequestReceiver< IEventFindEvents >,
56 public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateEvent >,
57 public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateEventFromString >,
58 public WrtDeviceApis::Commons::EventRequestReceiver< IEventExportEventToString >,
59 public WrtDeviceApis::Commons::EventRequestReceiver< IEventWatchChanges >,
60 public WrtDeviceApis::Commons::EventRequestReceiver< IEventClearWatch >,
61 public WrtDeviceApis::Commons::EventRequestReceiver< IEventExpandEventRecurrence >
66 virtual void createEvent(IEventCreateEventPtr &event);
67 virtual void addEvent(IEventAddEventPtr &event);
68 virtual void addEvents(IEventAddEventsPtr &events);
69 virtual void updateEvent(IEventUpdateEventPtr &event);
70 virtual void updateEvents(IEventUpdateEventsPtr &events);
71 virtual void deleteEvent(IEventDeleteEventPtr &event);
72 virtual void deleteEvents(IEventDeleteEventsPtr &events);
73 virtual void findEvents(IEventFindEventsPtr &event);
74 virtual void createEventFromString(IEventCreateEventFromStringPtr &event);
75 virtual void exportEventToString(IEventExportEventToStringPtr &event);
76 virtual void watchChanges(IEventWatchChangesPtr &event);
77 virtual void clearWatch(IEventClearWatchPtr &event);
78 virtual void expandEventRecurrence(IEventExpandEventRecurrencePtr &event);
80 virtual std::string getName() const
84 virtual void setName(const std::string &value)
89 virtual CalendarEvent::CalendarType getType() const
93 virtual void setType(const CalendarEvent::CalendarType value)
98 virtual std::string getId() const
102 virtual void setId(const int value)
104 std::stringstream ss;
109 virtual int getAccountId() const
113 virtual void setAccountId(const int value)
118 virtual OnAddEventsChangedEmitterPtr getAddEmitter() const
122 virtual void setAddEmitter(OnAddEventsChangedEmitterPtr value)
124 m_addEmitter = value;
127 virtual OnUpdateEventsChangedEmitterPtr getUpdateEmitter() const
129 return m_updateEmitter;
131 virtual void setUpdateEmitter(OnUpdateEventsChangedEmitterPtr value)
133 m_updateEmitter = value;
136 virtual OnDeleteEventsChangedEmitterPtr getDeleteEmitter() const
138 return m_deleteEmitter;
140 virtual void setDeleteEmitter(OnDeleteEventsChangedEmitterPtr value)
142 m_deleteEmitter = value;
145 virtual std::time_t getLastChangeFetchTime()
147 return m_lastChangeFetchTime;
149 virtual void setLastChangeFetchTime(std::time_t value)
151 m_lastChangeFetchTime = value;
154 OnEventsChangedEmitters m_changeEmitters;
160 CalendarEvent::CalendarType m_type;
161 OnAddEventsChangedEmitterPtr m_addEmitter;
162 OnUpdateEventsChangedEmitterPtr m_updateEmitter;
163 OnDeleteEventsChangedEmitterPtr m_deleteEmitter;
164 std::time_t m_lastChangeFetchTime;
166 virtual void OnRequestReceived(const IEventAddEventPtr &event) = 0;
167 virtual void OnRequestReceived(const IEventAddEventsPtr &events) = 0;
168 virtual void OnRequestReceived(const IEventDeleteEventPtr &event) = 0;
169 virtual void OnRequestReceived(const IEventDeleteEventsPtr &events) = 0;
170 virtual void OnRequestReceived(const IEventUpdateEventPtr &event) = 0;
171 virtual void OnRequestReceived(const IEventUpdateEventsPtr &events) = 0;
172 virtual void OnRequestReceived(const IEventFindEventsPtr &event) = 0;
173 virtual void OnRequestReceived(const IEventCreateEventPtr &event) = 0;
174 virtual void OnRequestReceived(const IEventCreateEventFromStringPtr &event) = 0;
175 virtual void OnRequestReceived(const IEventExportEventToStringPtr &event) = 0;
176 virtual void OnRequestReceived(const IEventWatchChangesPtr &event) = 0;
177 virtual void OnRequestReceived(const IEventClearWatchPtr &event) = 0;
178 virtual void OnRequestReceived(const IEventExpandEventRecurrencePtr &event) = 0;
181 typedef DPL::SharedPtr<ICalendar> ICalendarPtr;
187 #endif /* _ABSTRACT_LAYER_ICALENDAR_H_ */