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 __CALENTRY_H__
17 #define __CALENTRY_H__
19 #include <calcommon.h>
21 const TReal KCalGEOMinLatitude = -90;
22 const TReal KCalGEOMaxLatitude = 90;
23 const TReal KCalGEOMinLongitude = -180;
24 const TReal KCalGEOMaxLongitude = 180;
26 const TUint KCalGEOMaxDecimalPlaces = 6;
37 class CCalEntryIdImpl;
39 /** Class representing a calendar entry. This can be an appointment, to-do
40 item, reminder, event or anniversary.
42 CCalEntry contains information about a calendar entry, including
43 a repeat definition, synchronisation information, and group scheduling data.
45 A repeating calendar entry has more than one occurrence. Instances are
46 represented by the CCalInstance class.
48 Synchronisation information includes a record of the date/time the entry was
49 last modified. This can be found by calling the LastModifiedDateL() function.
54 NONSHARABLE_CLASS(CCalEntry) : public CBase
57 /** Defines the type of the calendar entry.
63 /** An appointment, which has a start time and end time. */
65 /** A to-do, which can have a start time and end time (the end time is the due date), or can be undated. */
67 /** An event, which has a start time and end time. */
69 /** A reminder, which has a start time only. */
71 /** An anniversary, which has a start time and end time. */
75 /** Defines the possible status values of the entry.
76 There are values here to support both iCalendar (RFC 2445) and vCalendar v1.0 STATUS properties.
77 Enumerated values for vCalendar v1.0 contain the prefix 'EVCal'.
83 /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event is tentative. */
85 /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event has been confirmed. */
87 /** Used to support iCalendar (RFC 2445). The event has been cancelled. */
89 /** Used to support iCalendar (RFC 2445). The to-do entry needs action. */
91 /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The to-do entry has been completed. */
93 /** Used to support iCalendar (RFC 2445). The to-do entry is in progress. */
95 /** No status is set. */
98 /** Used to support vCalendar 1.0. The entry has been accepted. */
100 /** Used to support vCalendar 1.0. The entry needs action. */
102 /** Used to support vCalendar 1.0. The entry has been sent. */
104 /** Used to support vCalendar 1.0. The entry has been declined. */
106 /** Used to support vCalendar 1.0. The entry has been delegated. */
110 /** Replication status.
114 enum TReplicationStatus
116 /** No restriction on access. */
118 /** Data is private (no access). */
120 /** Data is confidential (restricted access). */
124 /** The method property of a Group Scheduling entry.
130 /** The RFC2445-defined method value 'None'. */
132 /** The RFC2445-defined method value 'Publish'. */
134 /** The RFC2445-defined method value 'Request'. */
136 /** The RFC2445-defined method value 'Reply'. */
138 /** The RFC2445-defined method value 'Add'. */
140 /** The RFC2445-defined method value 'Cancel'. */
142 /** The RFC2445-defined method value 'Refresh'. */
144 /** The RFC2445-defined method value 'Counter'. */
146 /** The RFC2445-defined method value 'DeclineCounter'. */
147 EMethodDeclineCounter
150 /** Specify which entry details are to be copied in CCalEntry::CopyFromL functions.
156 /** Copy the ID of the entry */
158 /** Dont copy ID of the entry */
162 /** The busy status of an entry and corresponds to the TRANSP property in the iCalendar (RFC 2445) and vCalendar specifications.
163 In the vCalendar specification, the TRANSP property can be any positive integer value. 0 is opaque and blocks time, 1
164 is transparent and doesn't block time. Any higher values have an implementation-specific meaning.
165 In the iCalendar specification (RFC 2445), the TRANSP property can be either OPAQUE (blocks time) or TRANSPARENT (doesn't block time).
171 /** The entry blocks time. */
173 /** The entry doesn't block time. */
175 /** The entry is tentative and blocks time. */
177 /** The entry is an out-of-office calendar event and blocks time. */
181 // Construction / Destruction
182 IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
183 IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum,
184 const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
186 IMPORT_C ~CCalEntry();
189 IMPORT_C TCalTime StartTimeL() const;
190 IMPORT_C TCalTime EndTimeL() const;
191 IMPORT_C void SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime);
193 IMPORT_C void SetLastModifiedDateL();
194 IMPORT_C void SetLastModifiedDateL(const TCalTime& aModifiedTime);
195 IMPORT_C TCalTime LastModifiedDateL() const;
197 IMPORT_C void SetDTStampL(const TCalTime& aTime);
198 IMPORT_C TCalTime DTStampL() const;
200 IMPORT_C TCalTime CompletedTimeL() const;
201 IMPORT_C void SetCompletedL(TBool aCompleted, const TCalTime& aTime);
203 // Repeat rules / RDate / ExDate Methods
204 IMPORT_C void SetRRuleL(const TCalRRule& aRule);
205 IMPORT_C TBool GetRRuleL(TCalRRule& aRule) const;
207 IMPORT_C void SetRDatesL(const RArray<TCalTime>& aRDateList);
208 IMPORT_C void GetRDatesL(RArray<TCalTime>& aRDateList) const;
210 IMPORT_C void SetExceptionDatesL(const RArray<TCalTime>& aExDateList);
211 IMPORT_C void GetExceptionDatesL(RArray<TCalTime>& aExDateList) const;
213 IMPORT_C void ClearRepeatingPropertiesL();
216 IMPORT_C void SetAlarmL(CCalAlarm* aAlarm);
217 IMPORT_C CCalAlarm* AlarmL() const;
220 IMPORT_C TBool CompareL(const CCalEntry& aEntry) const;
223 IMPORT_C void CopyFromL(const CCalEntry& aOther);
224 IMPORT_C void CopyFromL(const CCalEntry& aOther, TCopyType aCopyType);
227 IMPORT_C void SetSummaryL(const TDesC& aSummary);
228 IMPORT_C const TDesC& SummaryL() const;
229 IMPORT_C void SetDescriptionL(const TDesC& aDescription);
230 IMPORT_C const TDesC& DescriptionL() const;
231 IMPORT_C void SetLocationL(const TDesC& aLocation);
232 IMPORT_C const TDesC& LocationL() const;
235 IMPORT_C void AddCategoryL(CCalCategory* aCategory);
236 IMPORT_C void DeleteCategoryL(TInt aIndex);
237 IMPORT_C const RPointerArray<CCalCategory>& CategoryListL();
240 IMPORT_C void AddAttendeeL(CCalAttendee* aAttendee);
241 IMPORT_C void DeleteAttendeeL(TInt aIndex);
242 IMPORT_C RPointerArray<CCalAttendee>& AttendeesL() const;
243 IMPORT_C void SetOrganizerL(CCalUser* aUser);
244 IMPORT_C CCalUser* OrganizerL() const;
245 IMPORT_C void SetPhoneOwnerL(const CCalUser* aOwner);
246 IMPORT_C CCalUser* PhoneOwnerL() const;
249 IMPORT_C void AddAttachmentL(CCalAttachment& aAttachment);
250 IMPORT_C void DeleteAttachmentL(const CCalAttachment& aAttachment);
251 IMPORT_C CCalAttachment* AttachmentL(TInt aIndex) const;
252 IMPORT_C TInt AttachmentCountL() const;
254 IMPORT_C TType EntryTypeL() const;
255 IMPORT_C void SetStatusL(TStatus aStatus);
256 IMPORT_C TStatus StatusL() const;
258 IMPORT_C void SetReplicationStatusL(TReplicationStatus aReplicationStatus);
259 IMPORT_C TReplicationStatus ReplicationStatusL() const;
261 IMPORT_C void SetPriorityL(TUint aPriority);
262 IMPORT_C TUint PriorityL() const;
264 IMPORT_C void SetMethodL(TMethod aMethod);
265 IMPORT_C TMethod MethodL() const;
266 IMPORT_C void SetSequenceNumberL(TInt aSeq);
267 IMPORT_C TInt SequenceNumberL() const;
268 IMPORT_C const TDesC8& UidL() const;
269 IMPORT_C TCalTime RecurrenceIdL() const;
270 IMPORT_C CalCommon::TRecurrenceRange RecurrenceRangeL() const;
272 IMPORT_C CTzRules* TzRulesL() const;
273 IMPORT_C void SetTzRulesL(const CTzRules& aTzRule);
274 IMPORT_C void SetTzRulesL();
276 IMPORT_C void SetLocalUidL(TCalLocalUid aLocalId);
277 IMPORT_C TCalLocalUid LocalUidL() const;
279 IMPORT_C TTransp TimeTransparencyL() const;
280 IMPORT_C void SetTimeTransparencyL(TTransp aBusyStatus);
282 IMPORT_C CCalGeoValue* GeoValueL() const;
283 IMPORT_C void SetGeoValueL(const CCalGeoValue& aGeoValue);
284 IMPORT_C void ClearGeoValueL();
286 // Internal APIs (Used by Java)
287 IMPORT_C TCalTime NextInstanceForLocalUIDL(const TCalTime& aTime) const;
288 IMPORT_C TCalTime PreviousInstanceForLocalUIDL(const TCalTime& aTime) const;
290 IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
295 static CCalEntry* NewL(CCalEntryImpl* aImpl);
296 CCalEntryImpl* Impl() const;
299 void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum, const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
300 void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
301 void ConstructL(CCalEntryImpl* aImpl);
303 private: // member data
304 CCalEntryImpl* iImpl;
308 /** Class representing a uniquely identifiable calendar entry in a calendar file.
313 NONSHARABLE_CLASS(CCalEntryId) : public CBase
316 IMPORT_C static CCalEntryId* NewL(TDesC8* aFlatData);
317 IMPORT_C ~CCalEntryId();
318 IMPORT_C TPtrC8 IdL();
319 IMPORT_C TPtrC StoreFileNameL();
320 IMPORT_C TCalTime RecurrenceIdL();
321 IMPORT_C TCalTime InstanceTimeL() const;
322 IMPORT_C TCalLocalUid LocalUidL() const;
326 CCalEntryIdImpl* iImpl;
330 /** Class representing the geographical location of a calendar entry.
331 This corresponds to the GEO property as defined in vCalendar / iCalendar (RFC 2445). It contains a latitude and a longitude.
335 NONSHARABLE_CLASS(CCalGeoValue) : public CBase
338 IMPORT_C static CCalGeoValue* NewL();
339 IMPORT_C ~CCalGeoValue();
340 IMPORT_C void SetLatLongL(const TReal& aLatitude, const TReal& aLongitude);
341 IMPORT_C TBool GetLatLong(TReal& aLatitude, TReal& aLongitude) const;
349 #endif // __CALENTRY_H__