1 calchangecallback.h |
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CALCHANGECALLBACK_H__ |
|
17 #define __CALCHANGECALLBACK_H__ |
|
18 |
|
19 #include <calcommon.h> |
|
20 |
|
21 class TCalChangeEntry; |
|
22 |
|
23 class MCalChangeCallBack |
|
24 /** A call back class for observing changes in the model view. |
|
25 |
|
26 A client will not be notified of a change if it is the source of |
|
27 the change. |
|
28 |
|
29 @publishedAll |
|
30 @deprecated |
|
31 */ |
|
32 { |
|
33 public: |
|
34 /** Instance view change type |
|
35 @publishedAll |
|
36 @deprecated |
|
37 */ |
|
38 enum TChangeType |
|
39 { |
|
40 /** Entries are added */ |
|
41 EChangeAdd, |
|
42 /** Entries are deleted */ |
|
43 EChangeDelete, |
|
44 /** Entries are modified */ |
|
45 EChangeModify, |
|
46 /** Undefined entries */ |
|
47 EChangeUndefined, |
|
48 /** Entries cause overflow error */ |
|
49 EChangeOverflowError |
|
50 }; |
|
51 |
|
52 /** Instance view entry type |
|
53 @publishedAll |
|
54 @deprecated |
|
55 */ |
|
56 enum TChangeEntryType |
|
57 { |
|
58 /** Entry type is todo */ |
|
59 EChangeEntryTodo, |
|
60 /** Entry type is event */ |
|
61 EChangeEntryEvent, |
|
62 /** All entry types */ |
|
63 EChangeEntryAll |
|
64 }; |
|
65 /** A call back function for change notification |
|
66 @param aChangeEntryType Filters notifications to only notify about entries of this type (event/todo/all). |
|
67 |
|
68 */ |
|
69 virtual void CalChangeNotification(TChangeEntryType aChangeEntryType) = 0; |
|
70 }; |
|
71 |
|
72 /** A call back class for observing changes in the model view. |
|
73 |
|
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. |
|
77 |
|
78 A client will not be notified of a change if it is the source of |
|
79 the change. |
|
80 |
|
81 @publishedAll |
|
82 @released |
|
83 */ |
|
84 class MCalChangeCallBack2 |
|
85 { |
|
86 public: |
|
87 /** Instance view change type |
|
88 @publishedAll |
|
89 @released |
|
90 */ |
|
91 enum TChangeType |
|
92 { |
|
93 /** Entries are added */ |
|
94 EChangeAdd, |
|
95 /** Entries are deleted */ |
|
96 EChangeDelete, |
|
97 /** Entries are modified */ |
|
98 EChangeModify, |
|
99 /** Undefined entries */ |
|
100 EChangeUndefined |
|
101 }; |
|
102 |
|
103 /** Instance view entry type |
|
104 @publishedAll |
|
105 @released |
|
106 */ |
|
107 enum TChangeEntryType |
|
108 { |
|
109 /** Entry type is todo */ |
|
110 EChangeEntryTodo, |
|
111 /** Entry type is event */ |
|
112 EChangeEntryEvent, |
|
113 /** All entry types */ |
|
114 EChangeEntryAll |
|
115 }; |
|
116 /** A call back function for change notification |
|
117 @param aChangeItems List of changes since the last notification. |
|
118 |
|
119 */ |
|
120 virtual void CalChangeNotification(RArray<TCalChangeEntry>& aChangeItems) = 0; |
|
121 }; |
|
122 |
|
123 /** Struct for storing change notification data. |
|
124 This contains the calendar local ID, the type of change and the entry type. |
|
125 |
|
126 The iChangeType will only be set to EChangeEntryTodo or EChangeEntryEvent |
|
127 values. EChangeEntryAll is provided for callback registration only. |
|
128 |
|
129 If iChangeType is EChangeUndefined or EChangeOverflowError, iEntryId and |
|
130 iEntryType are undefined and should not be used by clients. |
|
131 |
|
132 @publishedAll |
|
133 @released |
|
134 */ |
|
135 struct TCalChangeEntry |
|
136 { |
|
137 /** Local UID of the entry */ |
|
138 TCalLocalUid iEntryId; |
|
139 /** Type of change to the entry */ |
|
140 MCalChangeCallBack2::TChangeType iChangeType; |
|
141 /** Type of entry */ |
|
142 MCalChangeCallBack2::TChangeEntryType iEntryType; |
|
143 }; |
|
144 |
|
145 /** Class to encapsulate call back registration parameters. |
|
146 |
|
147 The type of entries, the date range and whether undated todos are included |
|
148 can be specified. |
|
149 |
|
150 @publishedAll |
|
151 @released |
|
152 */ |
|
153 class CCalChangeNotificationFilter |
|
154 { |
|
155 public: |
|
156 IMPORT_C static CCalChangeNotificationFilter* NewL(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange); |
|
157 IMPORT_C ~CCalChangeNotificationFilter(); |
|
158 |
|
159 MCalChangeCallBack2::TChangeEntryType ChangeEntryType() const; |
|
160 TCalTime StartTime() const; |
|
161 TCalTime EndTime() const; |
|
162 TBool IncludeUndatedTodos() const; |
|
163 |
|
164 private: |
|
165 CCalChangeNotificationFilter(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange); |
|
166 |
|
167 MCalChangeCallBack2::TChangeEntryType iChangeEntryType; |
|
168 CalCommon::TCalTimeRange iTimeRange; |
|
169 TBool iIncludeUndatedTodos; |
|
170 }; |
|
171 |
|
172 #endif // __CALCHANGECALLBACK_H__ |