Tizen 2.1 base
[platform/framework/web/wrt-plugins-common.git] / src / modules / API / Calendar / ICalendar.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  * @file        ICalendar.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  */
21
22 #ifndef WRTDEVICEAPIS_CALENDAR_ICALENDAR_H_
23 #define WRTDEVICEAPIS_CALENDAR_ICALENDAR_H_
24
25 #include <string>
26 #include <dpl/log/log.h>
27 #include <dpl/shared_ptr.h>
28 #include <Calendar/CalendarEvent.h>
29 #include <Calendar/EventFilter.h>
30 #include <Calendar/EventAddEvent.h>
31 #include <Calendar/EventCreateEvent.h>
32 #include <Calendar/EventDeleteEvent.h>
33 #include <Calendar/EventFindEvents.h>
34 #include <Calendar/EventUpdateEvent.h>
35
36 namespace WrtDeviceApis {
37 namespace Calendar {
38 namespace Api {
39
40 class ICalendar :
41     public Commons::EventRequestReceiver<EventAddEvent>,
42     public Commons::EventRequestReceiver<EventDeleteEvent>,
43     public Commons::EventRequestReceiver<EventUpdateEvent>,
44     public Commons::EventRequestReceiver<EventFindEvents>,
45     public Commons::EventRequestReceiver<EventCreateEvent>
46 {
47   public:
48
49     typedef enum
50     {
51         SIM_CALENDAR,
52         DEVICE_CALENDAR
53     } CalendarType;
54
55     ICalendar();
56     virtual ~ICalendar();
57     virtual void createEvent(const EventCreateEventPtr &event);
58     virtual void addEvent(const EventAddEventPtr &event);
59     virtual void updateEvent(const EventUpdateEventPtr &event);
60     virtual void deleteEvent(const EventDeleteEventPtr &event);
61     virtual void findEvents(const EventFindEventsPtr &event);
62
63     virtual std::string getName() const
64     {
65         return m_name;
66     }
67     virtual void setName(const std::string &value)
68     {
69         m_name = value;
70     }
71     virtual CalendarType getType() const
72     {
73         return m_type;
74     }
75     virtual void setType(const CalendarType value)
76     {
77         m_type = value;
78     }
79     virtual int getId() const
80     {
81         return m_id;
82     }
83     virtual void setId(const int value)
84     {
85         m_id = value;
86     }
87     virtual int getAccountId() const
88     {
89         return m_accountId;
90     }
91     virtual void setAccountId(const int value)
92     {
93         m_accountId = value;
94     }
95   protected:
96     int m_id;
97     int m_accountId;
98     std::string m_name;
99     CalendarType m_type;
100
101     virtual void OnRequestReceived(const EventAddEventPtr &event) = 0;
102     virtual void OnRequestReceived(const EventDeleteEventPtr &event) = 0;
103     virtual void OnRequestReceived(const EventUpdateEventPtr &event) = 0;
104     virtual void OnRequestReceived(const EventFindEventsPtr &event) = 0;
105     virtual void OnRequestReceived(const EventCreateEventPtr &event) = 0;
106 };
107
108 typedef DPL::SharedPtr<ICalendar> ICalendarPtr;
109
110 }
111 }
112 }
113
114 #endif // WRTDEVICEAPIS_CALENDAR_ICALENDAR_H_