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.
18 * @file EventAddressBookChangeListener.h
19 * @author Kisub Song (kisubs.song@samsung.com)
24 #ifndef _API_CONTACT_EVENT_ADDRESS_BOOK_CHANGE_LISTENER_H_
25 #define _API_CONTACT_EVENT_ADDRESS_BOOK_CHANGE_LISTENER_H_
28 #include <dpl/shared_ptr.h>
29 #include <Commons/IEvent.h>
30 #include <Commons/ListenerEvent.h>
31 #include <Commons/ListenerEventEmitter.h>
38 class EventInfoAddressBookChange;
39 typedef DPL::SharedPtr<EventInfoAddressBookChange> EventInfoAddressBookChangePtr;
41 class EventAddressBookChangeListener : public WrtDeviceApis::Commons::ListenerEvent<EventAddressBookChangeListener>
44 EventInfoAddressBookChangePtr m_eventInfo;
47 EventAddressBookChangeListener(EventInfoAddressBookChangePtr &eventInfo) : m_eventInfo(eventInfo)
51 EventInfoAddressBookChangePtr getEventInfo() const { return m_eventInfo; }
53 typedef DPL::SharedPtr<EventAddressBookChangeListener> EventAddressBookChangeListenerPtr;
55 typedef WrtDeviceApis::Commons::ListenerEventEmitter<EventAddressBookChangeListener> EventAddressBookChangeListenerEmitter;
56 typedef DPL::SharedPtr<EventAddressBookChangeListenerEmitter> EventAddressBookChangeListenerEmitterPtr;
58 class EventInfoAddressBookChange
63 EventInfoAddressBookChange()
67 virtual ~EventInfoAddressBookChange()
80 virtual CallbackType getCallbackType() const = 0;
83 class EventInfoAddressBookChangeAdded : public EventInfoAddressBookChange
87 ContactArrayPtr m_contacts;
92 EventInfoAddressBookChangeAdded() : m_contactsIsSet(false)
96 virtual ~EventInfoAddressBookChangeAdded()
100 virtual CallbackType getCallbackType() const
102 return OnContactsAdded;
105 ContactArrayPtr getContacts() const
110 void setContacts(ContactArrayPtr contacts)
112 m_contactsIsSet = true;
113 m_contacts = contacts;
116 bool getContactsIsSet() const
118 return m_contactsIsSet;
121 typedef DPL::SharedPtr<EventInfoAddressBookChangeAdded> EventInfoAddressBookChangeAddedPtr;
123 class EventInfoAddressBookChangeUpdated : public EventInfoAddressBookChange
127 ContactArrayPtr m_contacts;
129 bool m_contactsIsSet;
132 EventInfoAddressBookChangeUpdated() : m_contactsIsSet(false)
136 virtual ~EventInfoAddressBookChangeUpdated()
140 virtual CallbackType getCallbackType() const
142 return OnContactsUpdated;
145 ContactArrayPtr getContacts() const
150 void setContacts(ContactArrayPtr contacts)
152 m_contactsIsSet = true;
153 m_contacts = contacts;
156 bool getContactsIsSet() const
158 return m_contactsIsSet;
161 typedef DPL::SharedPtr<EventInfoAddressBookChangeUpdated> EventInfoAddressBookChangeUpdatedPtr;
163 class EventInfoAddressBookChangeRemoved : public EventInfoAddressBookChange
167 StringArrayPtr m_contactIds;
169 bool m_contactIdsIsSet;
172 EventInfoAddressBookChangeRemoved() : m_contactIdsIsSet(false)
176 virtual ~EventInfoAddressBookChangeRemoved()
180 virtual CallbackType getCallbackType() const
182 return OnContactsRemoved;
185 StringArrayPtr getContactIds() const
190 void setContactIds(StringArrayPtr contactIds)
192 m_contactIdsIsSet = true;
193 m_contactIds = contactIds;
196 bool getContactIdsIsSet() const
198 return m_contactIdsIsSet;
201 typedef DPL::SharedPtr<EventInfoAddressBookChangeRemoved> EventInfoAddressBookChangeRemovedPtr;
203 class EventInfoAddressBookChangeReset : public EventInfoAddressBookChange
209 EventInfoAddressBookChangeReset()
213 virtual ~EventInfoAddressBookChangeReset()
217 virtual CallbackType getCallbackType() const
219 return OnAddressBookReset;
222 typedef DPL::SharedPtr<EventInfoAddressBookChangeReset> EventInfoAddressBookChangeResetPtr;
224 class EventInfoAddressBookChangeError : public EventInfoAddressBookChange
230 EventInfoAddressBookChangeError()
234 virtual ~EventInfoAddressBookChangeError()
238 virtual CallbackType getCallbackType() const
243 typedef DPL::SharedPtr<EventInfoAddressBookChangeError> EventInfoAddressBookChangeErrorPtr;
249 #endif // _API_CONTACT_EVENT_ADDRESS_BOOK_CHANGE_LISTENER_H_