wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Calendar / ICalendar.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #include "ICalendar.h"
20 #include <Commons/ThreadPool.h>
21 #include <Logger.h>
22
23 namespace DeviceAPI {
24 namespace Calendar {
25
26 ICalendar::ICalendar() :
27     WrtDeviceApis::Commons::EventRequestReceiver<IEventAddEvent>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
28     WrtDeviceApis::Commons::EventRequestReceiver<IEventAddEvents>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
29     WrtDeviceApis::Commons::EventRequestReceiver<IEventDeleteEvent>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
30     WrtDeviceApis::Commons::EventRequestReceiver<IEventDeleteEvents>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
31     WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateEvent>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
32     WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateEvents>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
33     WrtDeviceApis::Commons::EventRequestReceiver<IEventFindEvents>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
34     WrtDeviceApis::Commons::EventRequestReceiver<IEventCreateEventFromString>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
35     WrtDeviceApis::Commons::EventRequestReceiver<IEventExportEventToString>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
36     WrtDeviceApis::Commons::EventRequestReceiver<IEventWatchChanges>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
37     WrtDeviceApis::Commons::EventRequestReceiver<IEventClearWatch>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
38     WrtDeviceApis::Commons::EventRequestReceiver<IEventExpandEventRecurrence>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
39     WrtDeviceApis::Commons::EventRequestReceiver<IEventGet>(WrtDeviceApis::Commons::ThreadEnum::CALENDAR_THREAD),
40     m_id(UNDEFINED_ID),
41     m_accountId(UNDEFINED_CALENDAR_ID),
42     m_name(""),
43     m_type(CalendarEvent::UNDEFINED_TYPE),
44     m_lastChangedVersion(-1),
45     m_isUnified(false)
46 {
47 }
48
49 ICalendar::~ICalendar()
50 {
51 }
52
53 void ICalendar::addEvent(IEventAddEventPtr &event)
54 {
55     WrtDeviceApis::Commons::EventRequestReceiver<IEventAddEvent>::PostRequest(event);
56 }
57
58 void ICalendar::addEvents(IEventAddEventsPtr &events)
59 {
60     WrtDeviceApis::Commons::EventRequestReceiver<IEventAddEvents>::PostRequest(events);
61 }
62
63 void ICalendar::updateEvent(IEventUpdateEventPtr &event)
64 {
65     WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateEvent>::PostRequest(event);
66 }
67
68 void ICalendar::updateEvents(IEventUpdateEventsPtr &events)
69 {
70     WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateEvents>::PostRequest(events);
71 }
72
73 void ICalendar::deleteEvent(IEventDeleteEventPtr &event)
74 {
75     WrtDeviceApis::Commons::EventRequestReceiver<IEventDeleteEvent>::PostRequest(event);
76 }
77
78 void ICalendar::deleteEvents(IEventDeleteEventsPtr &events)
79 {
80     WrtDeviceApis::Commons::EventRequestReceiver<IEventDeleteEvents>::PostRequest(events);
81 }
82
83 void ICalendar::findEvents(IEventFindEventsPtr &event)
84 {
85     WrtDeviceApis::Commons::EventRequestReceiver<IEventFindEvents>::PostRequest(event);
86 }
87
88 void ICalendar::createEventFromString(IEventCreateEventFromStringPtr &event)
89 {
90     WrtDeviceApis::Commons::EventRequestReceiver<IEventCreateEventFromString>::PostRequest(event);
91 }
92
93 void ICalendar::exportEventToString(IEventExportEventToStringPtr &event)
94 {
95     WrtDeviceApis::Commons::EventRequestReceiver<IEventExportEventToString>::PostRequest(event);
96 }
97
98 void ICalendar::watchChanges(IEventWatchChangesPtr &event)
99 {
100     WrtDeviceApis::Commons::EventRequestReceiver<IEventWatchChanges>::PostRequest(event);
101 }
102
103 void ICalendar::clearWatch(IEventClearWatchPtr &event)
104 {
105     WrtDeviceApis::Commons::EventRequestReceiver<IEventClearWatch>::PostRequest(event);
106 }
107
108 void ICalendar::expandEventRecurrence(IEventExpandEventRecurrencePtr &event)
109 {
110     WrtDeviceApis::Commons::EventRequestReceiver<IEventExpandEventRecurrence>::PostRequest(event);
111 }
112
113 void ICalendar::get(IEventGetPtr &event)
114 {
115     WrtDeviceApis::Commons::EventRequestReceiver<IEventGet>::PostRequest(event);
116 }
117
118 }
119 }