2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file IAddressBook.cpp
18 * @author Lukasz Marek (l.marek@samsung.com)
22 #include "IAddressBook.h"
23 #include <Commons/ThreadPool.h>
25 namespace WrtDeviceApis {
29 IAddressBookObject::IAddressBookObject(BookType type) :
30 //initialize all receivers to work on CONTACT_THREAD thread
31 Commons::EventRequestReceiver<EventAddContact>(
32 Commons::ThreadEnum::CONTACT_THREAD),
33 Commons::EventRequestReceiver<EventUpdateContact>(
34 Commons::ThreadEnum::CONTACT_THREAD),
35 Commons::EventRequestReceiver<EventFindContacts>(
36 Commons::ThreadEnum::CONTACT_THREAD),
37 Commons::EventRequestReceiver<EventDeleteContact>(
38 Commons::ThreadEnum::CONTACT_THREAD),
39 Commons::EventRequestReceiver<EventGetAddressBookItemCount>(
40 Commons::ThreadEnum::CONTACT_THREAD),
41 Commons::EventRequestReceiver<EventAddGroup>(
42 Commons::ThreadEnum::CONTACT_THREAD),
43 Commons::EventRequestReceiver<EventDeleteGroup>(
44 Commons::ThreadEnum::CONTACT_THREAD),
45 Commons::EventRequestReceiver<EventFindGroup>(
46 Commons::ThreadEnum::CONTACT_THREAD),
47 Commons::EventRequestReceiver<EventExportVCard>(
48 Commons::ThreadEnum::CONTACT_THREAD),
55 IAddressBookObject::~IAddressBookObject()
61 IAddressBookObject::BookType IAddressBookObject::getType() const
63 //return address book type: sim or device
67 void IAddressBookObject::addContact(const EventAddContactPtr &event)
69 Commons::EventRequestReceiver< EventAddContact >::PostRequest(event);
72 void IAddressBookObject::updateContact(const EventUpdateContactPtr &event)
74 Commons::EventRequestReceiver< EventUpdateContact >::PostRequest(event);
77 void IAddressBookObject::deleteContact(const EventDeleteContactPtr &event)
79 Commons::EventRequestReceiver< EventDeleteContact >::PostRequest(event);
82 void IAddressBookObject::findContacts(const EventFindContactsPtr &event)
84 Commons::EventRequestReceiver< EventFindContacts >::PostRequest(event);
87 void IAddressBookObject::getNumberOfContact(
88 const EventGetAddressBookItemCountPtr &event)
90 Commons::EventRequestReceiver< EventGetAddressBookItemCount >::PostRequest(
94 void IAddressBookObject::addGroup(const EventAddGroupPtr &event)
96 Commons::EventRequestReceiver< EventAddGroup >::PostRequest(event);
99 void IAddressBookObject::deleteGroup(const EventDeleteGroupPtr &event)
101 Commons::EventRequestReceiver< EventDeleteGroup >::PostRequest(event);
104 void IAddressBookObject::findGroup(const EventFindGroupPtr &event)
106 Commons::EventRequestReceiver< EventFindGroup >::PostRequest(event);
109 void IAddressBookObject::exportToVCard(const EventExportVCardPtr &event)
111 Commons::EventRequestReceiver< EventExportVCard >::PostRequest(event);