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 __CALENTRY_H__
17 #define __CALENTRY_H__
19 #include <calcommon.h>
21 /** Minimum latitude in degrees.
22 @see CCalGeoValue::SetLatLongL
26 const TReal KCalGEOMinLatitude = -90;
28 /** Maximum latitude in degrees.
29 @see CCalGeoValue::SetLatLongL
33 const TReal KCalGEOMaxLatitude = 90;
35 /** Minimum longitude in degrees.
36 @see CCalGeoValue::SetLatLongL
40 const TReal KCalGEOMinLongitude = -180;
42 /** Maximum longitude in degrees.
43 @see CCalGeoValue::SetLatLongL
47 const TReal KCalGEOMaxLongitude = 180;
49 /** Maximum number of decimal places for longitude and latitude values.
50 The position specified to CCalGeoValue::SetLatLongL will be truncated
51 to KGEOMaxDecimalPoint decimal places
52 @see CCalGeoValue::SetLatLongL
56 const TUint KCalGEOMaxDecimalPlaces = 6;
67 class CCalEntryIdImpl;
69 /** Class representing a calendar entry. This can be an appointment, to-do
70 item, reminder, event or anniversary.
72 CCalEntry contains information about a calendar entry, including
73 a repeat definition, synchronisation information, and group scheduling data.
75 A repeating calendar entry has more than one occurrence. Instances are
76 represented by the CCalInstance class.
78 Synchronisation information includes a record of the date/time the entry was
79 last modified. This can be found by calling the LastModifiedDateL() function.
84 NONSHARABLE_CLASS(CCalEntry) : public CBase
87 /** Defines the type of the calendar entry.
93 /** An appointment, which has a start time and end time. */
95 /** A to-do, which can have a start time and end time (the end time is the due date), or can be undated. */
97 /** An event, which has a start time and end time. */
99 /** A reminder, which has a start time only. */
101 /** An anniversary, which has a start time and end time. */
105 /** Defines the possible status values of the entry.
106 There are values here to support both iCalendar (RFC 2445) and vCalendar v1.0 STATUS properties.
107 Enumerated values for vCalendar v1.0 contain the prefix 'EVCal'.
113 /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event is tentative. */
115 /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event has been confirmed. */
117 /** Used to support iCalendar (RFC 2445). The event has been cancelled. */
119 /** Used to support iCalendar (RFC 2445). The to-do entry needs action. */
121 /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The to-do entry has been completed. */
123 /** Used to support iCalendar (RFC 2445). The to-do entry is in progress. */
125 /** No status is set. */
128 /** Used to support vCalendar 1.0. The entry has been accepted. */
130 /** Used to support vCalendar 1.0. The entry needs action. */
132 /** Used to support vCalendar 1.0. The entry has been sent. */
134 /** Used to support vCalendar 1.0. The entry has been declined. */
136 /** Used to support vCalendar 1.0. The entry has been delegated. */
140 /** Replication status.
144 enum TReplicationStatus
146 /** No restriction on access. */
148 /** Data is private (no access). */
150 /** Data is confidential (restricted access). */
154 /** The method property of a Group Scheduling entry.
160 /** The RFC2445-defined method value 'None'. */
162 /** The RFC2445-defined method value 'Publish'. */
164 /** The RFC2445-defined method value 'Request'. */
166 /** The RFC2445-defined method value 'Reply'. */
168 /** The RFC2445-defined method value 'Add'. */
170 /** The RFC2445-defined method value 'Cancel'. */
172 /** The RFC2445-defined method value 'Refresh'. */
174 /** The RFC2445-defined method value 'Counter'. */
176 /** The RFC2445-defined method value 'DeclineCounter'. */
177 EMethodDeclineCounter
180 /** Specify which entry details are to be copied in CCalEntry::CopyFromL functions.
186 /** Copy the ID of the entry */
188 /** Dont copy ID of the entry */
192 /** The busy status of an entry and corresponds to the TRANSP property in the iCalendar (RFC 2445) and vCalendar specifications.
193 In the vCalendar specification, the TRANSP property can be any positive integer value. 0 is opaque and blocks time, 1
194 is transparent and doesn't block time. Any higher values have an implementation-specific meaning.
195 In the iCalendar specification (RFC 2445), the TRANSP property can be either OPAQUE (blocks time) or TRANSPARENT (doesn't block time).
201 /** The entry blocks time. */
203 /** The entry doesn't block time. */
205 /** The entry is tentative and blocks time. */
207 /** The entry is an out-of-office calendar event and blocks time. */
211 // Construction / Destruction
212 IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
213 IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum,
214 const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
216 IMPORT_C ~CCalEntry();
219 IMPORT_C TCalTime StartTimeL() const;
220 IMPORT_C TCalTime EndTimeL() const;
221 IMPORT_C void SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime);
223 IMPORT_C void SetLastModifiedDateL();
224 IMPORT_C void SetLastModifiedDateL(const TCalTime& aModifiedTime);
225 IMPORT_C TCalTime LastModifiedDateL() const;
227 IMPORT_C void SetDTStampL(const TCalTime& aTime);
228 IMPORT_C TCalTime DTStampL() const;
230 IMPORT_C TCalTime CompletedTimeL() const;
231 IMPORT_C void SetCompletedL(TBool aCompleted, const TCalTime& aTime);
233 // Repeat rules / RDate / ExDate Methods
234 IMPORT_C void SetRRuleL(const TCalRRule& aRule);
235 IMPORT_C TBool GetRRuleL(TCalRRule& aRule) const;
237 IMPORT_C void SetRDatesL(const RArray<TCalTime>& aRDateList);
238 IMPORT_C void GetRDatesL(RArray<TCalTime>& aRDateList) const;
240 IMPORT_C void SetExceptionDatesL(const RArray<TCalTime>& aExDateList);
241 IMPORT_C void GetExceptionDatesL(RArray<TCalTime>& aExDateList) const;
243 IMPORT_C void ClearRepeatingPropertiesL();
246 IMPORT_C void SetAlarmL(CCalAlarm* aAlarm);
247 IMPORT_C CCalAlarm* AlarmL() const;
250 IMPORT_C TBool CompareL(const CCalEntry& aEntry) const;
253 IMPORT_C void CopyFromL(const CCalEntry& aOther);
254 IMPORT_C void CopyFromL(const CCalEntry& aOther, TCopyType aCopyType);
257 IMPORT_C void SetSummaryL(const TDesC& aSummary);
258 IMPORT_C const TDesC& SummaryL() const;
259 IMPORT_C void SetDescriptionL(const TDesC& aDescription);
260 IMPORT_C const TDesC& DescriptionL() const;
261 IMPORT_C void SetLocationL(const TDesC& aLocation);
262 IMPORT_C const TDesC& LocationL() const;
265 IMPORT_C void AddCategoryL(CCalCategory* aCategory);
266 IMPORT_C void DeleteCategoryL(TInt aIndex);
267 IMPORT_C const RPointerArray<CCalCategory>& CategoryListL();
270 IMPORT_C void AddAttendeeL(CCalAttendee* aAttendee);
271 IMPORT_C void DeleteAttendeeL(TInt aIndex);
272 IMPORT_C RPointerArray<CCalAttendee>& AttendeesL() const;
273 IMPORT_C void SetOrganizerL(CCalUser* aUser);
274 IMPORT_C CCalUser* OrganizerL() const;
275 IMPORT_C void SetPhoneOwnerL(const CCalUser* aOwner);
276 IMPORT_C CCalUser* PhoneOwnerL() const;
279 IMPORT_C void AddAttachmentL(CCalAttachment& aAttachment);
280 IMPORT_C void DeleteAttachmentL(const CCalAttachment& aAttachment);
281 IMPORT_C CCalAttachment* AttachmentL(TInt aIndex) const;
282 IMPORT_C TInt AttachmentCountL() const;
284 IMPORT_C TType EntryTypeL() const;
285 IMPORT_C void SetStatusL(TStatus aStatus);
286 IMPORT_C TStatus StatusL() const;
288 IMPORT_C void SetReplicationStatusL(TReplicationStatus aReplicationStatus);
289 IMPORT_C TReplicationStatus ReplicationStatusL() const;
291 IMPORT_C void SetPriorityL(TUint aPriority);
292 IMPORT_C TUint PriorityL() const;
294 IMPORT_C void SetMethodL(TMethod aMethod);
295 IMPORT_C TMethod MethodL() const;
296 IMPORT_C void SetSequenceNumberL(TInt aSeq);
297 IMPORT_C TInt SequenceNumberL() const;
298 IMPORT_C const TDesC8& UidL() const;
299 IMPORT_C TCalTime RecurrenceIdL() const;
300 IMPORT_C CalCommon::TRecurrenceRange RecurrenceRangeL() const;
302 IMPORT_C CTzRules* TzRulesL() const;
303 IMPORT_C void SetTzRulesL(const CTzRules& aTzRule);
304 IMPORT_C void SetTzRulesL();
306 IMPORT_C void SetLocalUidL(TCalLocalUid aLocalId);
307 IMPORT_C TCalLocalUid LocalUidL() const;
309 IMPORT_C TTransp TimeTransparencyL() const;
310 IMPORT_C void SetTimeTransparencyL(TTransp aBusyStatus);
312 IMPORT_C CCalGeoValue* GeoValueL() const;
313 IMPORT_C void SetGeoValueL(const CCalGeoValue& aGeoValue);
314 IMPORT_C void ClearGeoValueL();
316 IMPORT_C TCalTime NextInstanceForLocalUIDL(const TCalTime& aTime) const;
317 IMPORT_C TCalTime PreviousInstanceForLocalUIDL(const TCalTime& aTime) const;
319 IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
323 static CCalEntry* NewL(CCalEntryImpl* aImpl);
324 CCalEntryImpl* Impl() const;
325 TUint8 ShortFileIdL();
328 void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum, const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
329 void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
330 void ConstructL(CCalEntryImpl* aImpl);
332 private: // member data
333 CCalEntryImpl* iImpl;
337 /** Class representing a uniquely identifiable calendar entry in a calendar file.
342 NONSHARABLE_CLASS(CCalEntryId) : public CBase
345 IMPORT_C static CCalEntryId* NewL(TDesC8* aFlatData);
346 IMPORT_C ~CCalEntryId();
347 IMPORT_C TPtrC8 IdL();
348 IMPORT_C TPtrC StoreFileNameL();
349 IMPORT_C TCalTime RecurrenceIdL();
350 IMPORT_C TCalTime InstanceTimeL() const;
351 IMPORT_C TCalLocalUid LocalUidL() const;
355 CCalEntryIdImpl* iImpl;
359 /** Class representing the geographical location of a calendar entry.
360 This corresponds to the GEO property as defined in vCalendar / iCalendar (RFC 2445). It contains a latitude and a longitude.
364 NONSHARABLE_CLASS(CCalGeoValue) : public CBase
367 IMPORT_C static CCalGeoValue* NewL();
368 IMPORT_C ~CCalGeoValue();
369 IMPORT_C void SetLatLongL(const TReal& aLatitude, const TReal& aLongitude);
370 IMPORT_C TBool GetLatLong(TReal& aLatitude, TReal& aLongitude) const;
378 #endif // __CALENTRY_H__