41e01376946fca263aa565b6835f4a825cb9f7fa
[framework/osp/social.git] / inc / FSclIAddressbookChangeEventListener.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17 * @file                FSclIAddressbookChangeEventListener.h
18 * @brief               This is the header file for the %IAddressbookChangeEventListener interface.
19 *
20 * This header file contains the declarations of the %IAddressbookChangeEventListener interface.
21 */
22
23 #ifndef _FSCL_IADDRESSBOOK_CHANGE_EVENT_LISTENER_H_
24 #define _FSCL_IADDRESSBOOK_CHANGE_EVENT_LISTENER_H_
25
26 #include <FBaseRtIEventListener.h>
27
28 namespace Tizen { namespace Base { namespace Collection {
29 class IList;
30 }}}
31
32 namespace Tizen { namespace Social
33 {
34
35 /**
36  * @interface   IAddressbookChangeEventListener
37  * @brief       This interface provides a listener that receives the events associated with contact and category changes.
38  *
39  * @since       2.1
40  *
41  * The %IAddressbookChangeEventListener interface provides a listener that receives the events associated with contact and category changes.
42  *
43  */
44
45 class _OSP_EXPORT_ IAddressbookChangeEventListener
46         : virtual public Tizen::Base::Runtime::IEventListener
47 {
48 public:
49         /**
50          * This polymorphic destructor should be overridden if required. @n
51          * This way, the destructors of the derived classes 
52          * are called when the destructor of this interface is called.
53          *
54          * @since       2.1
55          */
56         virtual ~IAddressbookChangeEventListener(void) {}
57
58         /**
59          * Called to notify when changes have been made to contacts. @n
60          * A list of ContactChangeInfo instances is passed.
61          *
62          * @since       2.1
63          *
64          * @param[in]   contactChangeInfoList   The list of contact change information (@ref ContactChangeInfo list)
65          * @remarks This listener method is called when the following changes have occurred: @n
66
67          *      - Contacts are added, updated, or removed
68          *      - Contacts are added/removed to/from categories
69          *
70          * The following example demonstrates how to use the %OnContactsChanged() method.
71          * @code
72          * void
73          * MyApplication::OnContactsChangedN(const IList& contactChangeInfoList)
74          * {
75          *    IEnumerator* pEnum = contactChangeInfoList.GetEnumeratorN();
76          *    while (pEnum->MoveNext() == E_SUCCESS)
77          *    {
78          *      ContactChangeInfo* pInfo = (ContactChangeInfo*) pEnum->GetCurrent();
79          *
80          *      AppLog("Contact changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetContctId(), pInfo->GetVersion());
81          *    }
82          *    delete pEnum;
83          * }
84          * @endcode
85          *
86          */
87         virtual void OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList) = 0;
88
89         /**
90          * Called to notify when changes have been made to categories. @n
91          * A list of CategoryChangeInfo instances are passed.
92          *
93          * @since       2.1
94          *
95          * @param[in]   categoryChangeInfoList  The list of category change information (@ref CategoryChangeInfo list)
96          * @remarks This listener method is called when the following changes have occurred: @n
97          *      - Categories are added, updated, or removed
98          *
99          * The following example demonstrates how to use the %OnCategoriesChanged() method.
100          * @code
101          * void
102          * MyApplication::OnCategoriesChangedN(const IList& categoryChangeInfoList)
103          * {
104          *    IEnumerator* pEnum = categoryChangeInfoList.GetEnumeratorN();
105          *    while (pEnum->MoveNext() == E_SUCCESS)
106          *    {
107          *      CategoryChangeInfo* pInfo = (CategoryChangeInfo*) pEnum->GetCurrent();
108          *
109          *      AppLog("Category changed: type(%d), id(%d), version(%d)", pInfo->GetChangeType(), pInfo->GetCategoryId(), pInfo->GetVersion());
110          *    }
111          *    delete pEnum;
112          * }
113          * @endcode
114          *
115          */
116         virtual void OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList) = 0;
117
118 protected:
119         //
120         // This method is for internal use only. Using this method can cause behavioral, security-related,
121         // and consistency-related issues in the application.
122         // This method is reserved and may change its name at any time without prior notice.
123         //
124         // @since       2.1
125         //
126         virtual void IAddressbookChangeEventListener_Reserved1(void){ }
127
128         //
129         // This method is for internal use only. Using this method can cause behavioral, security-related,
130         // and consistency-related issues in the application.
131         // This method is reserved and may change its name at any time without prior notice.
132         //
133         // @since       2.1
134         //
135         virtual void IAddressbookChangeEventListener_Reserved2(void){ }
136
137         //
138         // This method is for internal use only. Using this method can cause behavioral, security-related,
139         // and consistency-related issues in the application.
140         // This method is reserved and may change its name at any time without prior notice.
141         //
142         // @since       2.1
143         //
144         virtual void IAddressbookChangeEventListener_Reserved3(void){ }
145 };      // IAddressbookChangeEventListener
146
147 }}      // Tizen::Social
148
149 #endif // _FSCL_IADDRESSBOOK_CHANGE_EVENT_LISTENER_H_