summaryrefslogtreecommitdiff
path: root/mobile_src/Calendar/EventWrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'mobile_src/Calendar/EventWrapper.h')
-rwxr-xr-xmobile_src/Calendar/EventWrapper.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/mobile_src/Calendar/EventWrapper.h b/mobile_src/Calendar/EventWrapper.h
new file mode 100755
index 0000000..45b6c89
--- /dev/null
+++ b/mobile_src/Calendar/EventWrapper.h
@@ -0,0 +1,119 @@
+//
+// 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 _CALENDAR_EVENT_WRAPPER_H_
+#define _CALENDAR_EVENT_WRAPPER_H_
+
+#include <string>
+#include <calendar2.h>
+#include <dpl/shared_ptr.h>
+#include "CalendarEvent.h"
+#include "EventAlarm.h"
+#include "EventAttendee.h"
+#include "EventRecurrenceRule.h"
+
+namespace DeviceAPI {
+namespace Calendar {
+
+class EventWrapper
+{
+ public:
+ EventWrapper(CalendarEvent::CalendarType type = CalendarEvent::EVENT_TYPE);
+ explicit EventWrapper(const CalendarEventPtr &event, CalendarEvent::CalendarType type = CalendarEvent::EVENT_TYPE);
+ explicit EventWrapper(calendar_record_h event, CalendarEvent::CalendarType type = CalendarEvent::EVENT_TYPE);
+ virtual ~EventWrapper();
+ calendar_record_h convertAbstractEventToPlatformEvent(bool loadBeforeConvert = false);
+ CalendarEventPtr convertPlatformEventToAbstractEvent();
+ calendar_record_h getPlatformEvent() const;
+ CalendarEventPtr getAbstractEvent() const;
+ void freePlatformEvent();
+
+ void saveEvent();
+ void loadEvent(int id);
+ void deleteEvent();
+ void createEventFromString(std::string value);
+ std::string exportEventToString(CalendarEvent::VObjectFormat format);
+
+ void displayAbstractEvent();
+ void displayPlatformEvent();
+
+ protected:
+ void setCalendarIdToPlatformEvent();
+ void setDescriptionToPlatformEvent();
+ void setSummaryToPlatformEvent();
+ void setStartTimeToPlatformEvent();
+ void setEndTimeToPlatformEvent();
+ void setLocationToPlatformEvent();
+ void setRecurrenceRuleToPlatformEvent();
+ void setAlarmsToPlatformEvent();
+ void setStatusToPlatformEvent();
+ void setCategoriesToPlatformEvent();
+ void setRecurrenceIdToPlatformEvent();
+ void setParentIdToPlatformEvent();
+ void setIsAllDayToPlatformEvent();
+ void setOrganizerToPlatformEvent();
+ void setVisibilityToPlatformEvent();
+ void setAvailabilityToPlatformEvent();
+ void setUIdToPlatformEvent();
+ void setAttendeesToPlatformEvent();
+ void setPositionToPlatformEvent();
+ void setPriorityToPlatformEvent();
+ void setCreatedDateToPlatformEvent();
+ void setCompletedDateToPlatformEvent();
+ void setProgressToPlatformEvent();
+
+ void setCalendarIdFromPlatformEvent();
+ void setDescriptionFromPlatformEvent();
+ void setSummaryFromPlatformEvent();
+ void setStartTimeFromPlatformEvent();
+ void setEndTimeFromPlatformEvent();
+ void setLocationFromPlatformEvent();
+ void setRecurrenceRuleFromPlatformEvent();
+ void setAlarmsFromPlatformEvent();
+ void setStatusFromPlatformEvent();
+ void setCategoriesFromPlatformEvent();
+ void setIdFromPlatformEvent();
+ void setRecurrenceIdFromPlatformEvent();
+ void setParentIdFromPlatformEvent();
+ void setIsAllDayFromPlatformEvent();
+ void setOrganizerFromPlatformEvent();
+ void setLastModifiedDateFromPlatformEvent();
+ void setVisibilityFromPlatformEvent();
+ void setAvailabilityFromPlatformEvent();
+ void setUIdFromPlatformEvent();
+ void setAttendeesFromPlatformEvent();
+ void setPositionFromPlatformEvent();
+ void setPriorityFromPlatformEvent();
+ void setCreatedDateFromPlatformEvent();
+ void setCompletedDateFromPlatformEvent();
+ void setProgressFromPlatformEvent();
+ void setIsDetachedFromPlatformEvent();
+
+ private:
+ CalendarEvent::CalendarType getType();
+
+ calendar_record_h m_platformEvent;
+ CalendarEventPtr m_abstractEvent;
+ CalendarEvent::CalendarType m_calendarType;
+};
+
+typedef DPL::SharedPtr<EventWrapper> EventWrapperPtr;
+
+}
+}
+#endif /* _CALENDAR_EVENT_WRAPPER_H_ */