Update change log and spec for wrt-plugins-tizen_0.4.49
[framework/web/wrt-plugins-tizen.git] / src / Contact / IAddressBook.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  * @file        IAddressBook.cpp
20  * @author      Kisub Song (kisubs.song@samsung.com)
21  * @version     0.1
22  * @brief
23  */
24
25 #include <Commons/ThreadPool.h>
26 #include "IAddressBook.h"
27 #include <Logger.h>
28
29 namespace DeviceAPI {
30 namespace Contact {
31
32 using namespace WrtDeviceApis::Commons;
33
34 IAddressBook::IAddressBook() :
35         //initialize all receivers to work on CONTACT_THREAD thread
36         EventRequestReceiver< EventAddressBookGet >(ThreadEnum::NULL_THREAD),
37         EventRequestReceiver< EventAddressBookAdd >(ThreadEnum::NULL_THREAD),
38         EventRequestReceiver< EventAddressBookAddBatch >(ThreadEnum::NULL_THREAD),
39         EventRequestReceiver< EventAddressBookUpdate >(ThreadEnum::NULL_THREAD),
40         EventRequestReceiver< EventAddressBookUpdateBatch >(ThreadEnum::NULL_THREAD),
41         EventRequestReceiver< EventAddressBookRemove >(ThreadEnum::NULL_THREAD),
42         EventRequestReceiver< EventAddressBookRemoveBatch >(ThreadEnum::NULL_THREAD),
43         EventRequestReceiver< EventAddressBookFind >(ThreadEnum::NULL_THREAD),
44         EventRequestReceiver< EventAddressBookAddChangeListener >(ThreadEnum::NULL_THREAD),
45         EventRequestReceiver< EventAddressBookRemoveChangeListener >(ThreadEnum::NULL_THREAD),
46         EventRequestReceiver< EventAddressBookGetGroup >(ThreadEnum::NULL_THREAD),
47         EventRequestReceiver< EventAddressBookAddGroup >(ThreadEnum::NULL_THREAD),
48         EventRequestReceiver< EventAddressBookUpdateGroup >(ThreadEnum::NULL_THREAD),
49         EventRequestReceiver< EventAddressBookRemoveGroup >(ThreadEnum::NULL_THREAD),
50         EventRequestReceiver< EventAddressBookGetGroups >(ThreadEnum::NULL_THREAD)
51 {
52         //Nothing to do
53         LoggerD("entered");
54 }
55
56 IAddressBook::~IAddressBook()
57 {
58         //Nothing to do
59 //      LoggerD("entered");
60 }
61
62 void IAddressBook::get(const EventAddressBookGetPtr &event)
63 {
64         //post event to PLATFORM implementation
65         EventRequestReceiver< EventAddressBookGet >::PostRequest(event);
66 }
67
68 void IAddressBook::add(const EventAddressBookAddPtr &event)
69 {
70         LoggerD("entered");
71         //post event to PLATFORM implementation
72         EventRequestReceiver< EventAddressBookAdd >::PostRequest(event);
73 }
74
75 void IAddressBook::addBatch(const EventAddressBookAddBatchPtr &event)
76 {
77         //post event to PLATFORM implementation
78         EventRequestReceiver< EventAddressBookAddBatch >::PostRequest(event);
79 }
80
81 void IAddressBook::update(const EventAddressBookUpdatePtr &event)
82 {
83         //post event to PLATFORM implementation
84         EventRequestReceiver< EventAddressBookUpdate >::PostRequest(event);
85 }
86
87 void IAddressBook::updateBatch(const EventAddressBookUpdateBatchPtr &event)
88 {
89         //post event to PLATFORM implementation
90         EventRequestReceiver< EventAddressBookUpdateBatch >::PostRequest(event);
91 }
92
93 void IAddressBook::remove(const EventAddressBookRemovePtr &event)
94 {
95         //post event to PLATFORM implementation
96         EventRequestReceiver< EventAddressBookRemove >::PostRequest(event);
97 }
98
99 void IAddressBook::removeBatch(const EventAddressBookRemoveBatchPtr &event)
100 {
101         //post event to PLATFORM implementation
102         EventRequestReceiver< EventAddressBookRemoveBatch >::PostRequest(event);
103 }
104
105 void IAddressBook::find(const EventAddressBookFindPtr &event)
106 {
107         //post event to PLATFORM implementation
108         EventRequestReceiver< EventAddressBookFind >::PostRequest(event);
109 }
110
111 void IAddressBook::addChangeListener(const EventAddressBookAddChangeListenerPtr &event)
112 {
113         //post event to PLATFORM implementation
114         EventRequestReceiver< EventAddressBookAddChangeListener >::PostRequest(event);
115 }
116
117 void IAddressBook::removeChangeListener(const EventAddressBookRemoveChangeListenerPtr &event)
118 {
119         //post event to PLATFORM implementation
120         EventRequestReceiver< EventAddressBookRemoveChangeListener >::PostRequest(event);
121 }
122
123 void IAddressBook::getGroup(const EventAddressBookGetGroupPtr &event)
124 {
125         //post event to PLATFORM implementation
126         EventRequestReceiver< EventAddressBookGetGroup >::PostRequest(event);
127 }
128
129 void IAddressBook::addGroup(const EventAddressBookAddGroupPtr &event)
130 {
131         //post event to PLATFORM implementation
132         EventRequestReceiver< EventAddressBookAddGroup >::PostRequest(event);
133 }
134
135 void IAddressBook::updateGroup(const EventAddressBookUpdateGroupPtr &event)
136 {
137         //post event to PLATFORM implementation
138         EventRequestReceiver< EventAddressBookUpdateGroup >::PostRequest(event);
139 }
140
141 void IAddressBook::removeGroup(const EventAddressBookRemoveGroupPtr &event)
142 {
143         //post event to PLATFORM implementation
144         EventRequestReceiver< EventAddressBookRemoveGroup >::PostRequest(event);
145 }
146
147 void IAddressBook::getGroups(const EventAddressBookGetGroupsPtr &event)
148 {
149         //post event to PLATFORM implementation
150         EventRequestReceiver< EventAddressBookGetGroups >::PostRequest(event);
151 }
152
153 } // Contact
154 } // DeviceAPI