2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file IAddressBook.cpp
20 * @author Kisub Song (kisubs.song@samsung.com)
25 #include <Commons/ThreadPool.h>
26 #include "IAddressBook.h"
32 using namespace WrtDeviceApis::Commons;
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)
56 IAddressBook::~IAddressBook()
59 // LoggerD("entered");
62 void IAddressBook::get(const EventAddressBookGetPtr &event)
64 //post event to PLATFORM implementation
65 EventRequestReceiver< EventAddressBookGet >::PostRequest(event);
68 void IAddressBook::add(const EventAddressBookAddPtr &event)
71 //post event to PLATFORM implementation
72 EventRequestReceiver< EventAddressBookAdd >::PostRequest(event);
75 void IAddressBook::addBatch(const EventAddressBookAddBatchPtr &event)
77 //post event to PLATFORM implementation
78 EventRequestReceiver< EventAddressBookAddBatch >::PostRequest(event);
81 void IAddressBook::update(const EventAddressBookUpdatePtr &event)
83 //post event to PLATFORM implementation
84 EventRequestReceiver< EventAddressBookUpdate >::PostRequest(event);
87 void IAddressBook::updateBatch(const EventAddressBookUpdateBatchPtr &event)
89 //post event to PLATFORM implementation
90 EventRequestReceiver< EventAddressBookUpdateBatch >::PostRequest(event);
93 void IAddressBook::remove(const EventAddressBookRemovePtr &event)
95 //post event to PLATFORM implementation
96 EventRequestReceiver< EventAddressBookRemove >::PostRequest(event);
99 void IAddressBook::removeBatch(const EventAddressBookRemoveBatchPtr &event)
101 //post event to PLATFORM implementation
102 EventRequestReceiver< EventAddressBookRemoveBatch >::PostRequest(event);
105 void IAddressBook::find(const EventAddressBookFindPtr &event)
107 //post event to PLATFORM implementation
108 EventRequestReceiver< EventAddressBookFind >::PostRequest(event);
111 void IAddressBook::addChangeListener(const EventAddressBookAddChangeListenerPtr &event)
113 //post event to PLATFORM implementation
114 EventRequestReceiver< EventAddressBookAddChangeListener >::PostRequest(event);
117 void IAddressBook::removeChangeListener(const EventAddressBookRemoveChangeListenerPtr &event)
119 //post event to PLATFORM implementation
120 EventRequestReceiver< EventAddressBookRemoveChangeListener >::PostRequest(event);
123 void IAddressBook::getGroup(const EventAddressBookGetGroupPtr &event)
125 //post event to PLATFORM implementation
126 EventRequestReceiver< EventAddressBookGetGroup >::PostRequest(event);
129 void IAddressBook::addGroup(const EventAddressBookAddGroupPtr &event)
131 //post event to PLATFORM implementation
132 EventRequestReceiver< EventAddressBookAddGroup >::PostRequest(event);
135 void IAddressBook::updateGroup(const EventAddressBookUpdateGroupPtr &event)
137 //post event to PLATFORM implementation
138 EventRequestReceiver< EventAddressBookUpdateGroup >::PostRequest(event);
141 void IAddressBook::removeGroup(const EventAddressBookRemoveGroupPtr &event)
143 //post event to PLATFORM implementation
144 EventRequestReceiver< EventAddressBookRemoveGroup >::PostRequest(event);
147 void IAddressBook::getGroups(const EventAddressBookGetGroupsPtr &event)
149 //post event to PLATFORM implementation
150 EventRequestReceiver< EventAddressBookGetGroups >::PostRequest(event);