Git Init
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Calendar / EventWrapper.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17
18 #ifndef _EVENT_WRAPPER_H_
19 #define _EVENT_WRAPPER_H_
20
21 #include <string>
22 #include <calendar-svc-provider.h>
23 #include <dpl/shared_ptr.h>
24 #include <API/Calendar/CalendarEvent.h>
25 #include <API/Calendar/EventFilter.h>
26 #include <API/Calendar/EventAttendee.h>
27 #include <API/Calendar/EventRecurrenceRule.h>
28
29 namespace TizenApis {
30 namespace Platform {
31 namespace Calendar {
32
33 class EventWrapper
34 {
35   public:
36     EventWrapper(Api::Calendar::CalendarEvent::CalendarType type = Api::Calendar::CalendarEvent::EVENT_TYPE);
37     explicit EventWrapper(const Api::Calendar::CalendarEventPtr &event, Api::Calendar::CalendarEvent::CalendarType type = Api::Calendar::CalendarEvent::EVENT_TYPE);
38     explicit EventWrapper(cal_struct *event, Api::Calendar::CalendarEvent::CalendarType type = Api::Calendar::CalendarEvent::EVENT_TYPE);
39     virtual ~EventWrapper();
40     cal_struct  *convertAbstractEventToPlatformEvent();
41     Api::Calendar::CalendarEventPtr convertPlatformEventToAbstractEvent();
42     cal_struct* getPlatformEvent() const;
43     Api::Calendar::CalendarEventPtr getAbstractEvent() const;
44     void        freePlatformEvent();
45     void        saveEvent();
46     void        loadEvent(int id);
47     void        deleteEvent();
48     void        createEventFromString(std::string value);
49     std::string exportEventToString();    
50
51   protected:
52     int  getIDFromPlatformEvent() const;
53     void setDescriptionToPlatformEvent();
54     void setSummaryToPlatformEvent();
55     void setStartTimeToPlatformEvent();
56     void setEndTimeToPlatformEvent();
57     void setLocationToPlatformEvent();
58     void setRecurrenceRuleToPlatformEvent();
59     void setAlarmsToPlatformEvent();
60     void setStatusToPlatformEvent();
61     void setCategoriesToPlatformEvent();
62     void setIDToPlatformEvent();
63     void setIsAllDayToPlatformEvent();
64     void setOrganizerToPlatformEvent();
65     void setLastModifiedDateToPlatformEvent();
66     void setVisibilityToPlatformEvent();
67     void setAvailabilityToPlatformEvent();
68     void setUIdToPlatformEvent();
69     void setAttendeesToPlatformEvent();
70     void setPositionToPlatformEvent();
71         void setPriorityToPlatformEvent();
72         void setCreatedDateToPlatformEvent();
73         void setCompletedDateToPlatformEvent();
74         void setProgressToPlatformEvent();
75
76     void setDescriptionFromPlatformEvent();
77     void setSummaryFromPlatformEvent();
78     void setStartTimeFromPlatformEvent();
79     void setEndTimeFromPlatformEvent();
80     void setLocationFromPlatformEvent();
81     void setRecurrenceRuleFromPlatformEvent();
82     void setAlarmsFromPlatformEvent();
83     void setStatusFromPlatformEvent();
84     void setCategoriesFromPlatformEvent();
85     void setIDFromPlatformEvent();
86     void setIsAllDayFromPlatformEvent();
87     void setOrganizerFromPlatformEvent();
88     void setLastModifiedDateFromPlatformEvent();
89     void setVisibilityFromPlatformEvent();
90     void setAvailabilityFromPlatformEvent();
91     void setUIdFromPlatformEvent();
92     void setRecurrenceIdFromPlatformEvent();
93     void setAttendeesFromPlatformEvent();
94     void setPositionFromPlatformEvent();
95         void setPriorityFromPlatformEvent();
96         void setCreatedDateFromPlatformEvent();
97         void setCompletedDateFromPlatformEvent();
98         void setProgressFromPlatformEvent();
99
100   private:
101     void displayAbstractEvent();     //only for debugging
102     void displayPlatformEvent();     //only for debugging
103     Api::Calendar::CalendarEvent::CalendarType getType();
104
105     cal_struct             *m_platformEvent;
106     Api::Calendar::CalendarEventPtr m_abstractEvent;
107     Api::Calendar::CalendarEvent::CalendarType    m_calendarType;
108 };
109
110 typedef DPL::SharedPtr<EventWrapper> EventWrapperPtr;
111
112 }
113 }
114 }
115 #endif /* _EVENT_WRAPPER_H_ */