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 "IEventGet.h"
41 #include "OnAddEventsChanged.h"
42 #include "OnUpdateEventsChanged.h"
43 #include "OnDeleteEventsChanged.h"
44 #include "OnEventsChanged.h"
50 class ICalendar : public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvent >,
51 public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvents >,
52 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvent >,
53 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvents >,
54 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvent >,
55 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvents >,
56 public WrtDeviceApis::Commons::EventRequestReceiver< IEventFindEvents >,
57 public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateEvent >,
58 public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateEventFromString >,
59 public WrtDeviceApis::Commons::EventRequestReceiver< IEventExportEventToString >,
60 public WrtDeviceApis::Commons::EventRequestReceiver< IEventWatchChanges >,
61 public WrtDeviceApis::Commons::EventRequestReceiver< IEventClearWatch >,
62 public WrtDeviceApis::Commons::EventRequestReceiver< IEventExpandEventRecurrence >,
63 public WrtDeviceApis::Commons::EventRequestReceiver< IEventGet >
68 virtual void createEvent(IEventCreateEventPtr &event);
69 virtual void addEvent(IEventAddEventPtr &event);
70 virtual void addEvents(IEventAddEventsPtr &events);
71 virtual void updateEvent(IEventUpdateEventPtr &event);
72 virtual void updateEvents(IEventUpdateEventsPtr &events);
73 virtual void deleteEvent(IEventDeleteEventPtr &event);
74 virtual void deleteEvents(IEventDeleteEventsPtr &events);
75 virtual void findEvents(IEventFindEventsPtr &event);
76 virtual void createEventFromString(IEventCreateEventFromStringPtr &event);
77 virtual void exportEventToString(IEventExportEventToStringPtr &event);
78 virtual void watchChanges(IEventWatchChangesPtr &event);
79 virtual void clearWatch(IEventClearWatchPtr &event);
80 virtual void expandEventRecurrence(IEventExpandEventRecurrencePtr &event);
81 virtual void get(IEventGetPtr &event);
83 virtual std::string getName() const
87 virtual void setName(const std::string &value)
92 virtual CalendarEvent::CalendarType getType() const
96 virtual void setType(const CalendarEvent::CalendarType value)
101 virtual std::string getId() const
105 virtual void setId(const int value)
107 std::stringstream ss;
112 virtual int getAccountId() const
116 virtual void setAccountId(const int value)
121 virtual OnAddEventsChangedEmitterPtr getAddEmitter() const
125 virtual void setAddEmitter(OnAddEventsChangedEmitterPtr value)
127 m_addEmitter = value;
130 virtual OnUpdateEventsChangedEmitterPtr getUpdateEmitter() const
132 return m_updateEmitter;
134 virtual void setUpdateEmitter(OnUpdateEventsChangedEmitterPtr value)
136 m_updateEmitter = value;
139 virtual OnDeleteEventsChangedEmitterPtr getDeleteEmitter() const
141 return m_deleteEmitter;
143 virtual void setDeleteEmitter(OnDeleteEventsChangedEmitterPtr value)
145 m_deleteEmitter = value;
148 virtual std::time_t getLastChangeFetchTime()
150 return m_lastChangeFetchTime;
152 virtual void setLastChangeFetchTime(std::time_t value)
154 m_lastChangeFetchTime = value;
157 OnEventsChangedEmitters m_changeEmitters;
163 CalendarEvent::CalendarType m_type;
164 OnAddEventsChangedEmitterPtr m_addEmitter;
165 OnUpdateEventsChangedEmitterPtr m_updateEmitter;
166 OnDeleteEventsChangedEmitterPtr m_deleteEmitter;
167 std::time_t m_lastChangeFetchTime;
169 virtual void OnRequestReceived(const IEventAddEventPtr &event) = 0;
170 virtual void OnRequestReceived(const IEventAddEventsPtr &events) = 0;
171 virtual void OnRequestReceived(const IEventDeleteEventPtr &event) = 0;
172 virtual void OnRequestReceived(const IEventDeleteEventsPtr &events) = 0;
173 virtual void OnRequestReceived(const IEventUpdateEventPtr &event) = 0;
174 virtual void OnRequestReceived(const IEventUpdateEventsPtr &events) = 0;
175 virtual void OnRequestReceived(const IEventFindEventsPtr &event) = 0;
176 virtual void OnRequestReceived(const IEventCreateEventPtr &event) = 0;
177 virtual void OnRequestReceived(const IEventCreateEventFromStringPtr &event) = 0;
178 virtual void OnRequestReceived(const IEventExportEventToStringPtr &event) = 0;
179 virtual void OnRequestReceived(const IEventWatchChangesPtr &event) = 0;
180 virtual void OnRequestReceived(const IEventClearWatchPtr &event) = 0;
181 virtual void OnRequestReceived(const IEventExpandEventRecurrencePtr &event) = 0;
182 virtual void OnRequestReceived(const IEventGetPtr &event) = 0;
185 typedef DPL::SharedPtr<ICalendar> ICalendarPtr;
191 #endif /* _ABSTRACT_LAYER_ICALENDAR_H_ */