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 * @author Lukasz Marek (l.marek@samsung.com)
22 #ifndef WRTDEVICEAPIS_CONTACT_EVENT_FIND_CONTACT_H_
23 #define WRTDEVICEAPIS_CONTACT_EVENT_FIND_CONTACT_H_
26 #include <dpl/shared_ptr.h>
27 #include <Commons/IEvent.h>
28 #include <Contact/ContactFilter.h>
29 #include <Contact/Contact.h>
30 #include <Contact/IContactEventPrivateData.h>
32 namespace WrtDeviceApis {
36 /* Event sent while searching contacts */
37 class EventFindContacts : public Commons::IEvent<EventFindContacts>
40 std::vector<ContactPtr> m_contacts;
41 ContactFilterPtr m_filter;
44 //this variable allows to use only one type per contact objects (check Contact object and contained subobjects)
45 //e.g. if contact has the same email as PREF and WORK, we can get 2 record with 1 type in each record, or singe record with 2 types within it.
46 bool m_useSingleTypes;
48 //this variable is not revelant to perform operation,
49 //but allows to store additional data to finish further operations in callback function.
50 IContactEventPrivateDataPtr m_privateData;
52 void setContactEventPrivateData(const IContactEventPrivateDataPtr &value)
54 m_privateData = value;
56 IContactEventPrivateDataPtr getContactEventPrivateData() const
60 void setStartIndex(int value)
64 int getStartIndex() const
68 void setEndIndex(int value)
72 int getEndIndex() const
76 void setResult(bool value)
80 bool getResult() const
84 void setUseSignleTypes(bool value)
86 m_useSingleTypes = value;
88 bool getUseSignleTypes() const
90 return m_useSingleTypes;
92 void setFilter(const ContactFilterPtr &filter)
96 ContactFilterPtr getFilter() const
100 void addContact(const ContactPtr &contact)
102 m_contacts.push_back(contact);
104 const std::vector<ContactPtr> &getContacts() const
108 void setContacts(const std::vector<ContactPtr> &value)
113 EventFindContacts() : m_result(false),
117 m_useSingleTypes(true)
120 virtual ~EventFindContacts()
123 virtual void clearOnCancel()
128 typedef DPL::SharedPtr<EventFindContacts> EventFindContactsPtr;
134 #endif // WRTDEVICEAPIS_CONTACT_EVENT_FIND_CONTACT_H_