diff options
Diffstat (limited to 'mobile_src/Calendar/ICalendar.h')
-rwxr-xr-x | mobile_src/Calendar/ICalendar.h | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/mobile_src/Calendar/ICalendar.h b/mobile_src/Calendar/ICalendar.h new file mode 100755 index 0000000..7ac6a93 --- /dev/null +++ b/mobile_src/Calendar/ICalendar.h @@ -0,0 +1,161 @@ +// +// Tizen Web Device API +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#ifndef _ABSTRACT_LAYER_ICALENDAR_H_ +#define _ABSTRACT_LAYER_ICALENDAR_H_ + +#include <string> +#include <sstream> +#include <dpl/shared_ptr.h> +#include "CalendarEvent.h" +#include "IEventAddEvent.h" +#include "IEventAddEvents.h" +#include "IEventDeleteEvent.h" +#include "IEventDeleteEvents.h" +#include "IEventFindEvents.h" +#include "IEventUpdateEvent.h" +#include "IEventUpdateEvents.h" +#include "IEventCreateEventFromString.h" +#include "IEventExportEventToString.h" +#include "IEventWatchChanges.h" +#include "IEventClearWatch.h" +#include "IEventExpandEventRecurrence.h" +#include "IEventGet.h" +#include "OnEventsChanged.h" + +namespace DeviceAPI { +namespace Calendar { + +class ICalendar : public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvent >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventAddEvents >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvent >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventDeleteEvents >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvent >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventUpdateEvents >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventFindEvents >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventCreateEventFromString >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventExportEventToString >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventWatchChanges >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventClearWatch >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventExpandEventRecurrence >, + public WrtDeviceApis::Commons::EventRequestReceiver< IEventGet > +{ + public: + ICalendar(); + virtual ~ICalendar(); + virtual void addEvent(IEventAddEventPtr &event); + virtual void addEvents(IEventAddEventsPtr &events); + virtual void updateEvent(IEventUpdateEventPtr &event); + virtual void updateEvents(IEventUpdateEventsPtr &events); + virtual void deleteEvent(IEventDeleteEventPtr &event); + virtual void deleteEvents(IEventDeleteEventsPtr &events); + virtual void findEvents(IEventFindEventsPtr &event); + virtual void createEventFromString(IEventCreateEventFromStringPtr &event); + virtual void exportEventToString(IEventExportEventToStringPtr &event); + virtual void watchChanges(IEventWatchChangesPtr &event); + virtual void clearWatch(IEventClearWatchPtr &event); + virtual void expandEventRecurrence(IEventExpandEventRecurrencePtr &event); + virtual void get(IEventGetPtr &event); + + virtual std::string getName() const + { + return m_name; + } + virtual void setName(const std::string &value) + { + m_name = value; + } + + virtual CalendarEvent::CalendarType getType() const + { + return m_type; + } + virtual void setType(const CalendarEvent::CalendarType value) + { + m_type = value; + } + + virtual std::string getId() const + { + return m_id; + } + virtual void setId(const int value) + { + std::stringstream ss; + ss<<value; + m_id = ss.str(); + } + + virtual int getAccountId() const + { + return m_accountId; + } + virtual void setAccountId(const int value) + { + m_accountId = value; + } + + virtual int getLastChangedVersion() + { + return m_lastChangedVersion; + } + virtual void setLastChangedVersion(int value) + { + m_lastChangedVersion = value; + } + + virtual bool getIsUnified() const + { + return m_isUnified; + } + virtual void setIsUnified(const bool value) + { + m_isUnified = value; + } + + OnEventsChangedEmitters m_changeEmitters; + + protected: + std::string m_id; + int m_accountId; + std::string m_name; + CalendarEvent::CalendarType m_type; + int m_lastChangedVersion; + bool m_isUnified; + + virtual void OnRequestReceived(const IEventAddEventPtr &event) = 0; + virtual void OnRequestReceived(const IEventAddEventsPtr &events) = 0; + virtual void OnRequestReceived(const IEventDeleteEventPtr &event) = 0; + virtual void OnRequestReceived(const IEventDeleteEventsPtr &events) = 0; + virtual void OnRequestReceived(const IEventUpdateEventPtr &event) = 0; + virtual void OnRequestReceived(const IEventUpdateEventsPtr &events) = 0; + virtual void OnRequestReceived(const IEventFindEventsPtr &event) = 0; + virtual void OnRequestReceived(const IEventCreateEventFromStringPtr &event) = 0; + virtual void OnRequestReceived(const IEventExportEventToStringPtr &event) = 0; + virtual void OnRequestReceived(const IEventWatchChangesPtr &event) = 0; + virtual void OnRequestReceived(const IEventClearWatchPtr &event) = 0; + virtual void OnRequestReceived(const IEventExpandEventRecurrencePtr &event) = 0; + virtual void OnRequestReceived(const IEventGetPtr &event) = 0; +}; + +typedef DPL::SharedPtr<ICalendar> ICalendarPtr; + +} +} + +#endif /* _ABSTRACT_LAYER_ICALENDAR_H_ */ |