1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CALCHANGECALLBACK_H__
17 #define __CALCHANGECALLBACK_H__
19 #include <calcommon.h>
21 class TCalChangeEntry;
23 class MCalChangeCallBack
24 /** A call back class for observing changes in the model view.
26 A client will not be notified of a change if it is the source of
34 /** Instance view change type
40 /** Entries are added */
42 /** Entries are deleted */
44 /** Entries are modified */
46 /** Undefined entries */
48 /** Entries cause overflow error */
52 /** Instance view entry type
58 /** Entry type is todo */
60 /** Entry type is event */
62 /** All entry types */
65 /** A call back function for change notification
66 @param aChangeEntryType Filters notifications to only notify about entries of this type (event/todo/all).
69 virtual void CalChangeNotification(TChangeEntryType aChangeEntryType) = 0;
72 /** A call back class for observing changes in the model view.
74 The call back returns an array containing information about at least
75 one change to the database. The information includes the type of change
76 and the identity of the item being changed.
78 A client will not be notified of a change if it is the source of
84 class MCalChangeCallBack2
87 /** Instance view change type
93 /** Entries are added */
95 /** Entries are deleted */
97 /** Entries are modified */
99 /** Undefined entries */
103 /** Instance view entry type
107 enum TChangeEntryType
109 /** Entry type is todo */
111 /** Entry type is event */
113 /** All entry types */
116 /** A call back function for change notification
117 @param aChangeItems List of changes since the last notification.
120 virtual void CalChangeNotification(RArray<TCalChangeEntry>& aChangeItems) = 0;
123 /** Struct for storing change notification data.
124 This contains the calendar local ID, the type of change and the entry type.
126 The iChangeType will only be set to EChangeEntryTodo or EChangeEntryEvent
127 values. EChangeEntryAll is provided for callback registration only.
129 If iChangeType is EChangeUndefined or EChangeOverflowError, iEntryId and
130 iEntryType are undefined and should not be used by clients.
135 struct TCalChangeEntry
137 /** Local UID of the entry */
138 TCalLocalUid iEntryId;
139 /** Type of change to the entry */
140 MCalChangeCallBack2::TChangeType iChangeType;
142 MCalChangeCallBack2::TChangeEntryType iEntryType;
145 /** Class to encapsulate call back registration parameters.
147 The type of entries, the date range and whether undated todos are included
153 class CCalChangeNotificationFilter
156 IMPORT_C static CCalChangeNotificationFilter* NewL(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange);
157 IMPORT_C ~CCalChangeNotificationFilter();
159 MCalChangeCallBack2::TChangeEntryType ChangeEntryType() const;
160 TCalTime StartTime() const;
161 TCalTime EndTime() const;
162 TBool IncludeUndatedTodos() const;
165 CCalChangeNotificationFilter(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange);
167 MCalChangeCallBack2::TChangeEntryType iChangeEntryType;
168 CalCommon::TCalTimeRange iTimeRange;
169 TBool iIncludeUndatedTodos;
172 #endif // __CALCHANGECALLBACK_H__