2 // Tizen Web Device API
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.
19 #ifndef _ABSTRACT_LAYER_ICALENDAR_H_
20 #define _ABSTRACT_LAYER_ICALENDAR_H_
24 #include <dpl/shared_ptr.h>
25 #include "CalendarEvent.h"
26 #include "IEventAddEvent.h"
27 #include "IEventAddEvents.h"
28 #include "IEventDeleteEvent.h"
29 #include "IEventDeleteEvents.h"
30 #include "IEventFindEvents.h"
31 #include "IEventUpdateEvent.h"
32 #include "IEventUpdateEvents.h"
33 #include "IEventCreateEventFromString.h"
34 #include "IEventExportEventToString.h"
35 #include "IEventWatchChanges.h"
36 #include "IEventClearWatch.h"
37 #include "IEventExpandEventRecurrence.h"
38 #include "IEventGet.h"
39 #include "OnEventsChanged.h"
44 class ICalendar : public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvent >,
45 public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvents >,
46 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvent >,
47 public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvents >,
48 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvent >,
49 public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvents >,
50 public WrtDeviceApis::Commons::EventRequestReceiver< IEventFindEvents >,
51 public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateEventFromString >,
52 public WrtDeviceApis::Commons::EventRequestReceiver< IEventExportEventToString >,
53 public WrtDeviceApis::Commons::EventRequestReceiver< IEventWatchChanges >,
54 public WrtDeviceApis::Commons::EventRequestReceiver< IEventClearWatch >,
55 public WrtDeviceApis::Commons::EventRequestReceiver< IEventExpandEventRecurrence >,
56 public WrtDeviceApis::Commons::EventRequestReceiver< IEventGet >
61 virtual void addEvent(IEventAddEventPtr &event);
62 virtual void addEvents(IEventAddEventsPtr &events);
63 virtual void updateEvent(IEventUpdateEventPtr &event);
64 virtual void updateEvents(IEventUpdateEventsPtr &events);
65 virtual void deleteEvent(IEventDeleteEventPtr &event);
66 virtual void deleteEvents(IEventDeleteEventsPtr &events);
67 virtual void findEvents(IEventFindEventsPtr &event);
68 virtual void createEventFromString(IEventCreateEventFromStringPtr &event);
69 virtual void exportEventToString(IEventExportEventToStringPtr &event);
70 virtual void watchChanges(IEventWatchChangesPtr &event);
71 virtual void clearWatch(IEventClearWatchPtr &event);
72 virtual void expandEventRecurrence(IEventExpandEventRecurrencePtr &event);
73 virtual void get(IEventGetPtr &event);
75 virtual std::string getName() const
79 virtual void setName(const std::string &value)
84 virtual CalendarEvent::CalendarType getType() const
88 virtual void setType(const CalendarEvent::CalendarType value)
93 virtual std::string getId() const
97 virtual void setId(const int value)
104 virtual int getAccountId() const
108 virtual void setAccountId(const int value)
113 virtual int getLastChangedVersion()
115 return m_lastChangedVersion;
117 virtual void setLastChangedVersion(int value)
119 m_lastChangedVersion = value;
122 virtual bool getIsUnified() const
126 virtual void setIsUnified(const bool value)
131 OnEventsChangedEmitters m_changeEmitters;
137 CalendarEvent::CalendarType m_type;
138 int m_lastChangedVersion;
141 virtual void OnRequestReceived(const IEventAddEventPtr &event) = 0;
142 virtual void OnRequestReceived(const IEventAddEventsPtr &events) = 0;
143 virtual void OnRequestReceived(const IEventDeleteEventPtr &event) = 0;
144 virtual void OnRequestReceived(const IEventDeleteEventsPtr &events) = 0;
145 virtual void OnRequestReceived(const IEventUpdateEventPtr &event) = 0;
146 virtual void OnRequestReceived(const IEventUpdateEventsPtr &events) = 0;
147 virtual void OnRequestReceived(const IEventFindEventsPtr &event) = 0;
148 virtual void OnRequestReceived(const IEventCreateEventFromStringPtr &event) = 0;
149 virtual void OnRequestReceived(const IEventExportEventToStringPtr &event) = 0;
150 virtual void OnRequestReceived(const IEventWatchChangesPtr &event) = 0;
151 virtual void OnRequestReceived(const IEventClearWatchPtr &event) = 0;
152 virtual void OnRequestReceived(const IEventExpandEventRecurrencePtr &event) = 0;
153 virtual void OnRequestReceived(const IEventGetPtr &event) = 0;
156 typedef DPL::SharedPtr<ICalendar> ICalendarPtr;
161 #endif /* _ABSTRACT_LAYER_ICALENDAR_H_ */