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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CALCOMMON_H__
17 #define __CALCOMMON_H__
21 /** This system-wide #define is for version 2 of the Calendar component.
22 V1 is the CalInterimAPI. V2 is the refactored Calendar component which includes
23 support for Attachments, GEO, TRANSP, instance iterator, extended text searching.
27 #define SYMBIAN_CALENDAR_V2
29 /** Calendar local entry ID.
30 This entry ID is assigned by the calendar server when an entry is created.
31 It will remain unchanged for the lifetime of that entry.
35 typedef TUint32 TCalLocalUid;
41 typedef TInt64 TCalFileId;
43 /** Calendar Collection ID.
44 It identifies the same file as TCalFileId does
48 typedef TUint8 TCalCollectionId;
50 /** Calendar NULL file ID.
51 The file ID will be set to KNullFileId if the file is not opened.
55 const TCalFileId KNullFileId = 0;
57 /** Utility class containing common calendar-related enums.
69 /** Entry filter used in the entry view and instance view, filter flags are defined by TCalViewFilterFlags
73 typedef TUint TCalViewFilter;
75 /** Entry filter flags used in the entry view and instance view.
79 enum TCalViewFilterFlags
81 /** Include appointments. */
83 /** Include reminders. */
84 EIncludeReminder=0x02,
85 /** Include all-day events. */
87 /** Include anniversaries. */
89 /** Include completed todos. */
90 EIncludeCompletedTodos=0x10,
91 /** Include incompleted todos. */
92 EIncludeIncompletedTodos=0x20,
93 /** Remove non-alarmed entries. This flag cannot be used by itself. */
94 EIncludeAlarmedOnly=0x40,
95 /** Include next only instance of a repeat entry. */
96 EIncludeRptsNextInstanceOnly=0x80,
98 /** By default all instances which overlap the time range are found. Use the EInstanceStartTimeWithinRange
99 flag to only include instances whose start time is inside the search time range.
101 Note that setting both the EInstanceStartTimeWithinRange and EInstanceEndTimeWithinRange flags will
102 only include instances which are completely within the search time range. */
103 EInstanceStartTimeWithinRange=0x100,
105 /** By default all instances which overlap the time range are found. Use the EInstanceEndTimeWithinRange
106 flag to only include instances whose end time is inside the search time range.
108 Note that setting both the EInstanceStartTimeWithinRange and EInstanceEndTimeWithinRange flags will
109 only include instances which are completely within the search time range.
111 EInstanceEndTimeWithinRange=0x200,
113 /** By default all instances which adjoin the search range are found. Use the EExcludeInstanceAdjoiningRange
114 flag to exclude instances that are outside, but adjoin the search range.
116 Instances that are outside, but adjoin the search start or end time are excluded.
117 Instances that both start and end on the search start time are included.
118 Instances that both start and end on the search end time are excluded.
120 EExcludeInstanceAdjoiningRange=0x400,
122 /** Include all entries (appointments, day events, reminders, anniversaries and todos). */
123 EIncludeAll=EIncludeAppts|EIncludeReminder|EIncludeEvents|EIncludeAnnivs|
124 EIncludeCompletedTodos|EIncludeIncompletedTodos,
127 /** The range of instances referred to in a recurrence ID or instance view.
131 enum TRecurrenceRange
133 /** Only this instance is referenced.
134 If the user set EThisOnly when a repeating child entry is created and stored to the file, only the parent instance
135 referred to by the child's recurrence ID will be replaced. */
137 /** This and all other instances are referenced. */
139 /** This and all future instances are referenced. */
141 /** This and all previous instances are referenced. */
146 /** Search filter for use in the CCalInstanceView::FindInstanceL() function.
147 Note that a folded text search is used if exact text search is not specified.
148 The summary text field is always searched. It is possible to specify additional text fields to be
153 enum TCalSearchBehaviour
155 /** Search for folded text. */
156 EFoldedTextSearch=0x0,
158 /** Search for the exact text. */
159 EExactTextSearch=0x1,
161 /** Search location during a text search.
165 ESearchEntryLocation=0x2,
167 /** Search description during a text search.
171 ESearchEntryDescription=0x4,
173 /** Search attendee addresses during a text search.
177 ESearchAttendeeAddress=0x8,
179 /** Search attendee sent by addresses during a text search.
183 ESearchAttendeeSentByAddress=0x10,
185 /** Search attendee common names during a text search.
189 ESearchAttendeeCommonName=0x20,
191 /** Search organizer's address during a text search.
195 ESearchOrganizerAddress=0x40,
197 /** Search organizer's sent by address during a text search.
201 ESearchOrganizerSentByAddress=0x80,
203 /** Search organizer's common name during a text search.
207 ESearchOrganizerCommonName=0x100,
209 /** Include all possible text fields during a text search. */
210 ESearchAllTextFields=ESearchEntryLocation|ESearchEntryDescription|
211 ESearchAttendeeAddress|ESearchAttendeeSentByAddress|ESearchAttendeeCommonName|
212 ESearchOrganizerAddress|ESearchOrganizerSentByAddress|ESearchOrganizerCommonName,
215 /** Class to implement a time range in the Instance view and Entry view.
222 IMPORT_C TCalTimeRange(TCalTime aStartTime, TCalTime aEndTime);
224 IMPORT_C TCalTime StartTime() const;
225 IMPORT_C TCalTime EndTime() const;
232 /** Enumeration returned when opening a file to indicate whether the file is the current version,
233 needs converting, or is unsupported.
237 enum TCalFileVersionSupport
239 /** The file is the current version and can be loaded immediately. */
240 EFileIsCurrentVersion,
241 /** The file is an older version and will be converted when it is used. */
242 EFileNeedsConverting,
243 /** The file is an old version that is not supported. */
244 EUnsupportedFileVersion
247 /** Class to implement a priority range. This is used to set a priority range when using
248 CCalFindInstanceSettings.
252 class TCalPriorityRange
255 IMPORT_C TCalPriorityRange();
256 IMPORT_C TCalPriorityRange(TUint aHighestPriority, TUint aLowestPriority);
258 IMPORT_C TUint LowestPriority() const;
259 IMPORT_C TUint HighestPriority() const;
262 TUint iHighestPriority;
263 TUint iLowestPriority;
266 /** Enumeration to define the sort-able attributes that can be sorted on in the
271 enum TCalSortAttribute
275 ESortAttrLastModified,
280 /** Enumeration to define the sort directions that can be used in sort criteria,
284 enum TCalSortDirection
286 /** Sort by ascending order */
288 /** Sort by descending order */
293 #endif // __CALCOMMON_H__