Add DRAFT stubs for Vehicle plugin
[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 _CALENDAR_EVENT_WRAPPER_H_
19 #define _CALENDAR_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/EventAlarm.h>
26 #include <API/Calendar/EventAttendee.h>
27 #include <API/Calendar/EventRecurrenceRule.h>
28
29 using namespace TizenApis::Api::Calendar;
30
31 namespace TizenApis {
32 namespace Platform {
33 namespace Calendar {
34
35 class EventWrapper
36 {
37   public:
38     EventWrapper(CalendarEvent::CalendarType type = CalendarEvent::EVENT_TYPE);
39     explicit EventWrapper(const CalendarEventPtr &event, CalendarEvent::CalendarType type = CalendarEvent::EVENT_TYPE);
40     explicit EventWrapper(cal_struct *event, CalendarEvent::CalendarType type = CalendarEvent::EVENT_TYPE);
41     virtual ~EventWrapper();
42     cal_struct  *convertAbstractEventToPlatformEvent();
43     CalendarEventPtr convertPlatformEventToAbstractEvent();
44     cal_struct* getPlatformEvent() const;
45     CalendarEventPtr getAbstractEvent() const;
46     void        freePlatformEvent();
47     void        saveEvent();
48     void        loadEvent(int id);
49     void        deleteEvent();
50     void        createEventFromString(std::string value);
51     std::string exportEventToString();    
52
53         void setCalendarId(const std::string &value);
54         void setCalendarAccountId(const int value);
55
56     void displayAbstractEvent();     //only for debugging
57     void displayPlatformEvent();     //only for debugging
58
59   protected:
60     int  getIdFromPlatformEvent() const;
61
62     void setDescriptionToPlatformEvent();
63     void setSummaryToPlatformEvent();
64     void setStartTimeToPlatformEvent();
65     void setEndTimeToPlatformEvent();
66     void setLocationToPlatformEvent();
67     void setRecurrenceRuleToPlatformEvent();
68     void setAlarmsToPlatformEvent();
69     void setStatusToPlatformEvent();
70     void setCategoriesToPlatformEvent();
71     void setIdToPlatformEvent();
72     void setParentIdToPlatformEvent();
73     void setIsAllDayToPlatformEvent();
74     void setOrganizerToPlatformEvent();
75     void setLastModifiedDateToPlatformEvent();
76     void setVisibilityToPlatformEvent();
77     void setAvailabilityToPlatformEvent();
78     void setUIdToPlatformEvent();
79     void setAttendeesToPlatformEvent();
80     void setPositionToPlatformEvent();
81         void setPriorityToPlatformEvent();
82         void setCreatedDateToPlatformEvent();
83         void setCompletedDateToPlatformEvent();
84         void setProgressToPlatformEvent();
85
86     void setDescriptionFromPlatformEvent();
87     void setSummaryFromPlatformEvent();
88     void setStartTimeFromPlatformEvent();
89     void setEndTimeFromPlatformEvent();
90     void setLocationFromPlatformEvent();
91     void setRecurrenceRuleFromPlatformEvent();
92     void setAlarmsFromPlatformEvent();
93     void setStatusFromPlatformEvent();
94     void setCategoriesFromPlatformEvent();
95     void setIdFromPlatformEvent();
96     void setParentIdFromPlatformEvent();
97     void setIsAllDayFromPlatformEvent();
98     void setOrganizerFromPlatformEvent();
99     void setLastModifiedDateFromPlatformEvent();
100     void setVisibilityFromPlatformEvent();
101     void setAvailabilityFromPlatformEvent();
102     void setUIdFromPlatformEvent();
103     void setAttendeesFromPlatformEvent();
104     void setPositionFromPlatformEvent();
105         void setPriorityFromPlatformEvent();
106         void setCreatedDateFromPlatformEvent();
107         void setCompletedDateFromPlatformEvent();
108         void setProgressFromPlatformEvent();
109         void setIsDetachedFromPlatformEvent();
110
111   private:
112     CalendarEvent::CalendarType getType();
113
114     cal_struct             *m_platformEvent;
115     CalendarEventPtr m_abstractEvent;
116     CalendarEvent::CalendarType    m_calendarType;
117     std::string m_calendarId;
118     int m_calendarAccountId;
119 };
120
121 typedef DPL::SharedPtr<EventWrapper> EventWrapperPtr;
122
123 }
124 }
125 }
126 #endif /* _CALENDAR_EVENT_WRAPPER_H_ */