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)
25 #ifndef _API_CONTACT_EVENT_ADDRESS_BOOK_CHANGE_LISTENER_H_
26 #define _API_CONTACT_EVENT_ADDRESS_BOOK_CHANGE_LISTENER_H_
29 #include <dpl/shared_ptr.h>
30 #include <Commons/IEvent.h>
31 #include <Commons/ListenerEvent.h>
32 #include <Commons/ListenerEventEmitter.h>
39 class EventInfoAddressBookChange;
40 typedef DPL::SharedPtr<EventInfoAddressBookChange> EventInfoAddressBookChangePtr;
42 class EventAddressBookChangeListener : public WrtDeviceApis::Commons::ListenerEvent<EventAddressBookChangeListener>
45 EventInfoAddressBookChangePtr m_eventInfo;
48 EventAddressBookChangeListener(EventInfoAddressBookChangePtr &eventInfo) : m_eventInfo(eventInfo)
52 EventInfoAddressBookChangePtr getEventInfo() const { return m_eventInfo; }
54 typedef DPL::SharedPtr<EventAddressBookChangeListener> EventAddressBookChangeListenerPtr;
56 typedef WrtDeviceApis::Commons::ListenerEventEmitter<EventAddressBookChangeListener> EventAddressBookChangeListenerEmitter;
57 typedef DPL::SharedPtr<EventAddressBookChangeListenerEmitter> EventAddressBookChangeListenerEmitterPtr;
59 class EventInfoAddressBookChange
64 EventInfoAddressBookChange()
68 virtual ~EventInfoAddressBookChange()
81 virtual CallbackType getCallbackType() const = 0;
84 class EventInfoAddressBookChangeAdded : public EventInfoAddressBookChange
88 ContactArrayPtr m_contacts;
93 EventInfoAddressBookChangeAdded() : m_contactsIsSet(false)
97 virtual ~EventInfoAddressBookChangeAdded()
101 virtual CallbackType getCallbackType() const
103 return OnContactsAdded;
106 ContactArrayPtr getContacts() const
111 void setContacts(ContactArrayPtr contacts)
113 m_contactsIsSet = true;
114 m_contacts = contacts;
117 bool getContactsIsSet() const
119 return m_contactsIsSet;
122 typedef DPL::SharedPtr<EventInfoAddressBookChangeAdded> EventInfoAddressBookChangeAddedPtr;
124 class EventInfoAddressBookChangeUpdated : public EventInfoAddressBookChange
128 ContactArrayPtr m_contacts;
130 bool m_contactsIsSet;
133 EventInfoAddressBookChangeUpdated() : m_contactsIsSet(false)
137 virtual ~EventInfoAddressBookChangeUpdated()
141 virtual CallbackType getCallbackType() const
143 return OnContactsUpdated;
146 ContactArrayPtr getContacts() const
151 void setContacts(ContactArrayPtr contacts)
153 m_contactsIsSet = true;
154 m_contacts = contacts;
157 bool getContactsIsSet() const
159 return m_contactsIsSet;
162 typedef DPL::SharedPtr<EventInfoAddressBookChangeUpdated> EventInfoAddressBookChangeUpdatedPtr;
164 class EventInfoAddressBookChangeRemoved : public EventInfoAddressBookChange
168 StringArrayPtr m_contactIds;
170 bool m_contactIdsIsSet;
173 EventInfoAddressBookChangeRemoved() : m_contactIdsIsSet(false)
177 virtual ~EventInfoAddressBookChangeRemoved()
181 virtual CallbackType getCallbackType() const
183 return OnContactsRemoved;
186 StringArrayPtr getContactIds() const
191 void setContactIds(StringArrayPtr contactIds)
193 m_contactIdsIsSet = true;
194 m_contactIds = contactIds;
197 bool getContactIdsIsSet() const
199 return m_contactIdsIsSet;
202 typedef DPL::SharedPtr<EventInfoAddressBookChangeRemoved> EventInfoAddressBookChangeRemovedPtr;
204 class EventInfoAddressBookChangeReset : public EventInfoAddressBookChange
210 EventInfoAddressBookChangeReset()
214 virtual ~EventInfoAddressBookChangeReset()
218 virtual CallbackType getCallbackType() const
220 return OnAddressBookReset;
223 typedef DPL::SharedPtr<EventInfoAddressBookChangeReset> EventInfoAddressBookChangeResetPtr;
225 class EventInfoAddressBookChangeError : public EventInfoAddressBookChange
231 EventInfoAddressBookChangeError()
235 virtual ~EventInfoAddressBookChangeError()
239 virtual CallbackType getCallbackType() const
244 typedef DPL::SharedPtr<EventInfoAddressBookChangeError> EventInfoAddressBookChangeErrorPtr;
250 #endif // _API_CONTACT_EVENT_ADDRESS_BOOK_CHANGE_LISTENER_H_