epoc32/include/app/calentry.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/calentry.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __CALENTRY_H__
williamr@2
    17
#define __CALENTRY_H__
williamr@2
    18
williamr@2
    19
#include <calcommon.h>
williamr@2
    20
williamr@2
    21
const TReal KCalGEOMinLatitude = -90;
williamr@2
    22
const TReal KCalGEOMaxLatitude  = 90;
williamr@2
    23
const TReal KCalGEOMinLongitude = -180;
williamr@2
    24
const TReal KCalGEOMaxLongitude  = 180;
williamr@2
    25
williamr@2
    26
const TUint KCalGEOMaxDecimalPlaces = 6;
williamr@2
    27
williamr@2
    28
class CCalAlarm;
williamr@2
    29
class CCalAttachment;
williamr@2
    30
class CCalAttendee;
williamr@2
    31
class CCalCategory;
williamr@2
    32
class CCalEntryImpl;
williamr@2
    33
class CCalGeoValue;
williamr@2
    34
class CCalUser;
williamr@2
    35
class CTzRules;
williamr@2
    36
class TCalRRule;
williamr@2
    37
class CCalEntryIdImpl;
williamr@2
    38
williamr@2
    39
/** Class representing a calendar entry. This can be an appointment, to-do
williamr@2
    40
item, reminder, event or anniversary.
williamr@2
    41
williamr@2
    42
CCalEntry contains information about a calendar entry, including
williamr@2
    43
a repeat definition, synchronisation information, and group scheduling data.
williamr@2
    44
williamr@2
    45
A repeating calendar entry has more than one occurrence. Instances are
williamr@2
    46
represented by the CCalInstance class.
williamr@2
    47
williamr@2
    48
Synchronisation information includes a record of the date/time the entry was
williamr@2
    49
last modified. This can be found by calling the LastModifiedDateL() function.
williamr@2
    50
williamr@2
    51
@publishedAll
williamr@2
    52
@released
williamr@2
    53
*/
williamr@2
    54
NONSHARABLE_CLASS(CCalEntry) : public CBase
williamr@2
    55
	{
williamr@2
    56
public:
williamr@2
    57
	/** Defines the type of the calendar entry.
williamr@2
    58
	@publishedAll
williamr@2
    59
	@released
williamr@2
    60
	*/
williamr@2
    61
	enum TType
williamr@2
    62
		{
williamr@2
    63
		/** An appointment, which has a start time and end time. */
williamr@2
    64
		EAppt,
williamr@2
    65
		/** A to-do, which can have a start time and end time (the end time is the due date), or can be undated. */
williamr@2
    66
		ETodo,
williamr@2
    67
		/** An event, which has a start time and end time. */
williamr@2
    68
		EEvent,
williamr@2
    69
		/** A reminder, which has a start time only. */
williamr@2
    70
		EReminder,
williamr@2
    71
		/** An anniversary, which has a start time and end time. */
williamr@2
    72
		EAnniv
williamr@2
    73
		};
williamr@2
    74
williamr@2
    75
	/** Defines the possible status values of the entry.
williamr@2
    76
	There are values here to support both iCalendar (RFC 2445) and vCalendar v1.0 STATUS properties.
williamr@2
    77
	Enumerated values for vCalendar v1.0 contain the prefix 'EVCal'.
williamr@2
    78
	@publishedAll
williamr@2
    79
	@released
williamr@2
    80
	*/
williamr@2
    81
	enum TStatus
williamr@2
    82
		{
williamr@2
    83
		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event is tentative. */
williamr@2
    84
		ETentative,
williamr@2
    85
		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event has been confirmed. */
williamr@2
    86
		EConfirmed,
williamr@2
    87
		/** Used to support iCalendar (RFC 2445). The event has been cancelled. */
williamr@2
    88
		ECancelled,
williamr@2
    89
		/** Used to support iCalendar (RFC 2445). The to-do entry needs action. */
williamr@2
    90
		ETodoNeedsAction,
williamr@2
    91
		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The to-do entry has been completed. */
williamr@2
    92
		ETodoCompleted,
williamr@2
    93
		/** Used to support iCalendar (RFC 2445). The to-do entry is in progress. */
williamr@2
    94
		ETodoInProcess,
williamr@2
    95
		/** No status is set. */
williamr@2
    96
		ENullStatus,
williamr@2
    97
		
williamr@2
    98
		/** Used to support vCalendar 1.0. The entry has been accepted. */
williamr@2
    99
		EVCalAccepted,
williamr@2
   100
		/** Used to support vCalendar 1.0. The entry needs action. */
williamr@2
   101
		EVCalNeedsAction, 
williamr@2
   102
		/** Used to support vCalendar 1.0. The entry has been sent. */
williamr@2
   103
		EVCalSent, 
williamr@2
   104
		/** Used to support vCalendar 1.0. The entry has been declined. */
williamr@2
   105
		EVCalDeclined,
williamr@2
   106
		/** Used to support vCalendar 1.0. The entry has been delegated. */
williamr@2
   107
		EVCalDelegated,
williamr@2
   108
		};
williamr@2
   109
williamr@2
   110
	/** Replication status.
williamr@2
   111
	@publishedAll
williamr@2
   112
	@released
williamr@2
   113
	*/
williamr@2
   114
	enum TReplicationStatus
williamr@2
   115
		{
williamr@2
   116
		/** No restriction on access. */
williamr@2
   117
		EOpen,
williamr@2
   118
		/** Data is private (no access). */
williamr@2
   119
		EPrivate,
williamr@2
   120
		/** Data is confidential (restricted access). */
williamr@2
   121
		ERestricted
williamr@2
   122
		};
williamr@2
   123
williamr@2
   124
	/** The method property of a Group Scheduling entry.
williamr@2
   125
	@publishedAll
williamr@2
   126
	@released
williamr@2
   127
	*/
williamr@2
   128
	enum TMethod
williamr@2
   129
		{
williamr@2
   130
		/** The RFC2445-defined method value 'None'. */
williamr@2
   131
		EMethodNone,
williamr@2
   132
		/** The RFC2445-defined method value 'Publish'. */
williamr@2
   133
		EMethodPublish,
williamr@2
   134
		/** The RFC2445-defined method value 'Request'. */
williamr@2
   135
		EMethodRequest,
williamr@2
   136
		/** The RFC2445-defined method value 'Reply'. */
williamr@2
   137
		EMethodReply,
williamr@2
   138
		/** The RFC2445-defined method value 'Add'. */
williamr@2
   139
		EMethodAdd,
williamr@2
   140
		/** The RFC2445-defined method value 'Cancel'. */
williamr@2
   141
		EMethodCancel,
williamr@2
   142
		/** The RFC2445-defined method value 'Refresh'. */
williamr@2
   143
		EMethodRefresh,
williamr@2
   144
		/** The RFC2445-defined method value 'Counter'. */
williamr@2
   145
		EMethodCounter,
williamr@2
   146
		/** The RFC2445-defined method value 'DeclineCounter'. */
williamr@2
   147
		EMethodDeclineCounter
williamr@2
   148
		};
williamr@2
   149
williamr@2
   150
	/** Specify which entry details are to be copied in CCalEntry::CopyFromL functions.
williamr@2
   151
	@publishedAll
williamr@2
   152
	@released
williamr@2
   153
	*/
williamr@2
   154
	enum TCopyType
williamr@2
   155
		{
williamr@2
   156
		/** Copy the ID of the entry */
williamr@2
   157
		ECopyAll,
williamr@2
   158
		/** Dont copy ID of the entry */
williamr@2
   159
		EDontCopyId
williamr@2
   160
		};
williamr@2
   161
williamr@2
   162
	/** The busy status of an entry and corresponds to the TRANSP property in the iCalendar (RFC 2445) and vCalendar specifications.
williamr@2
   163
	In the vCalendar specification, the TRANSP property can be any positive integer value. 0 is opaque and blocks time, 1 
williamr@2
   164
	is transparent and doesn't block time. Any higher values have an implementation-specific meaning.
williamr@2
   165
	In the iCalendar specification (RFC 2445), the TRANSP property can be either OPAQUE (blocks time) or TRANSPARENT (doesn't block time).
williamr@2
   166
	@publishedPartner
williamr@2
   167
	@prototype
williamr@2
   168
	*/
williamr@2
   169
	enum TTransp
williamr@2
   170
		{
williamr@2
   171
		/** The entry blocks time. */
williamr@2
   172
		ETranspBusy,
williamr@2
   173
		/** The entry doesn't block time. */
williamr@2
   174
		ETranspFree,
williamr@2
   175
		/** The entry is tentative and blocks time. */
williamr@2
   176
		ETranspTentative,
williamr@2
   177
		/** The entry is an out-of-office calendar event and blocks time. */
williamr@2
   178
		ETranspOutOfOffice,
williamr@2
   179
		};
williamr@2
   180
williamr@2
   181
	// Construction / Destruction
williamr@2
   182
	IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
williamr@2
   183
	IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum,
williamr@2
   184
					const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
williamr@2
   185
williamr@2
   186
	IMPORT_C ~CCalEntry();
williamr@2
   187
williamr@2
   188
	// Date and Time
williamr@2
   189
	IMPORT_C TCalTime StartTimeL() const;
williamr@2
   190
	IMPORT_C TCalTime EndTimeL() const;
williamr@2
   191
	IMPORT_C void SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime);
williamr@2
   192
williamr@2
   193
	IMPORT_C void SetLastModifiedDateL();
williamr@2
   194
	IMPORT_C void SetLastModifiedDateL(const TCalTime& aModifiedTime);
williamr@2
   195
	IMPORT_C TCalTime LastModifiedDateL() const;
williamr@2
   196
williamr@2
   197
	IMPORT_C void SetDTStampL(const TCalTime& aTime);
williamr@2
   198
	IMPORT_C TCalTime DTStampL() const;
williamr@2
   199
williamr@2
   200
	IMPORT_C TCalTime CompletedTimeL() const;
williamr@2
   201
	IMPORT_C void SetCompletedL(TBool aCompleted, const TCalTime& aTime);
williamr@2
   202
williamr@2
   203
	// Repeat rules / RDate / ExDate Methods
williamr@2
   204
	IMPORT_C void SetRRuleL(const TCalRRule& aRule);
williamr@2
   205
	IMPORT_C TBool GetRRuleL(TCalRRule& aRule) const;
williamr@2
   206
williamr@2
   207
	IMPORT_C void SetRDatesL(const RArray<TCalTime>& aRDateList);
williamr@2
   208
	IMPORT_C void GetRDatesL(RArray<TCalTime>& aRDateList) const;
williamr@2
   209
williamr@2
   210
	IMPORT_C void SetExceptionDatesL(const RArray<TCalTime>& aExDateList);
williamr@2
   211
	IMPORT_C void GetExceptionDatesL(RArray<TCalTime>& aExDateList) const;
williamr@2
   212
williamr@2
   213
	IMPORT_C void ClearRepeatingPropertiesL();
williamr@2
   214
	
williamr@2
   215
	// Entry alarm
williamr@2
   216
	IMPORT_C void SetAlarmL(CCalAlarm* aAlarm);
williamr@2
   217
	IMPORT_C CCalAlarm* AlarmL() const;
williamr@2
   218
williamr@2
   219
	// Comparison
williamr@2
   220
	IMPORT_C TBool CompareL(const CCalEntry& aEntry) const;
williamr@2
   221
williamr@2
   222
 	// Copy
williamr@2
   223
 	IMPORT_C void CopyFromL(const CCalEntry& aOther);
williamr@2
   224
	IMPORT_C void CopyFromL(const CCalEntry& aOther, TCopyType aCopyType);
williamr@2
   225
williamr@2
   226
	// Text Fields
williamr@2
   227
	IMPORT_C void SetSummaryL(const TDesC& aSummary);
williamr@2
   228
	IMPORT_C const TDesC& SummaryL() const;
williamr@2
   229
	IMPORT_C void SetDescriptionL(const TDesC& aDescription);
williamr@2
   230
	IMPORT_C const TDesC& DescriptionL() const;
williamr@2
   231
	IMPORT_C void SetLocationL(const TDesC& aLocation);
williamr@2
   232
	IMPORT_C const TDesC& LocationL() const;
williamr@2
   233
williamr@2
   234
	// Category list
williamr@2
   235
	IMPORT_C void AddCategoryL(CCalCategory* aCategory);
williamr@2
   236
	IMPORT_C void DeleteCategoryL(TInt aIndex);
williamr@2
   237
	IMPORT_C const RPointerArray<CCalCategory>& CategoryListL();
williamr@2
   238
williamr@2
   239
	//	Attendee Methods
williamr@2
   240
	IMPORT_C void AddAttendeeL(CCalAttendee* aAttendee);
williamr@2
   241
	IMPORT_C void DeleteAttendeeL(TInt aIndex);
williamr@2
   242
	IMPORT_C RPointerArray<CCalAttendee>& AttendeesL() const;
williamr@2
   243
	IMPORT_C void SetOrganizerL(CCalUser* aUser);
williamr@2
   244
	IMPORT_C CCalUser* OrganizerL() const;
williamr@2
   245
	IMPORT_C void SetPhoneOwnerL(const CCalUser* aOwner);
williamr@2
   246
	IMPORT_C CCalUser* PhoneOwnerL() const;
williamr@2
   247
williamr@2
   248
	// Attachments
williamr@2
   249
	IMPORT_C void AddAttachmentL(CCalAttachment& aAttachment);
williamr@2
   250
	IMPORT_C void DeleteAttachmentL(const CCalAttachment& aAttachment);
williamr@2
   251
	IMPORT_C CCalAttachment* AttachmentL(TInt aIndex) const;
williamr@2
   252
	IMPORT_C TInt AttachmentCountL() const;
williamr@2
   253
	// Other Attributes
williamr@2
   254
	IMPORT_C TType EntryTypeL() const;
williamr@2
   255
	IMPORT_C void SetStatusL(TStatus aStatus);
williamr@2
   256
	IMPORT_C TStatus StatusL() const;
williamr@2
   257
williamr@2
   258
	IMPORT_C void SetReplicationStatusL(TReplicationStatus aReplicationStatus);
williamr@2
   259
	IMPORT_C TReplicationStatus ReplicationStatusL() const;
williamr@2
   260
williamr@2
   261
	IMPORT_C void SetPriorityL(TUint aPriority);
williamr@2
   262
	IMPORT_C TUint PriorityL() const;
williamr@2
   263
williamr@2
   264
	IMPORT_C void SetMethodL(TMethod aMethod);
williamr@2
   265
	IMPORT_C TMethod MethodL() const;
williamr@2
   266
	IMPORT_C void SetSequenceNumberL(TInt aSeq);
williamr@2
   267
	IMPORT_C TInt SequenceNumberL() const;
williamr@2
   268
	IMPORT_C const TDesC8& UidL() const;
williamr@2
   269
	IMPORT_C TCalTime RecurrenceIdL() const;
williamr@2
   270
	IMPORT_C CalCommon::TRecurrenceRange RecurrenceRangeL() const;
williamr@2
   271
williamr@2
   272
	IMPORT_C CTzRules* TzRulesL() const;
williamr@2
   273
	IMPORT_C void SetTzRulesL(const CTzRules& aTzRule);
williamr@2
   274
	IMPORT_C void SetTzRulesL();
williamr@2
   275
williamr@2
   276
	IMPORT_C void SetLocalUidL(TCalLocalUid aLocalId);
williamr@2
   277
	IMPORT_C TCalLocalUid LocalUidL() const;
williamr@2
   278
williamr@2
   279
	IMPORT_C TTransp TimeTransparencyL() const;
williamr@2
   280
	IMPORT_C void SetTimeTransparencyL(TTransp aBusyStatus);
williamr@2
   281
williamr@2
   282
	IMPORT_C CCalGeoValue* GeoValueL() const;
williamr@2
   283
	IMPORT_C void SetGeoValueL(const CCalGeoValue& aGeoValue);
williamr@2
   284
	IMPORT_C void ClearGeoValueL();
williamr@2
   285
williamr@2
   286
	// Internal APIs (Used by Java)
williamr@2
   287
	IMPORT_C TCalTime NextInstanceForLocalUIDL(const TCalTime& aTime) const;
williamr@2
   288
	IMPORT_C TCalTime PreviousInstanceForLocalUIDL(const TCalTime& aTime) const;
williamr@2
   289
	
williamr@2
   290
	IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
williamr@2
   291
williamr@2
   292
	
williamr@2
   293
public:
williamr@2
   294
	// Internal APIs
williamr@2
   295
	static CCalEntry* NewL(CCalEntryImpl* aImpl);
williamr@2
   296
	CCalEntryImpl* Impl() const;
williamr@2
   297
	
williamr@2
   298
private:
williamr@2
   299
	void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum, const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
williamr@2
   300
	void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
williamr@2
   301
	void ConstructL(CCalEntryImpl* aImpl);
williamr@2
   302
williamr@2
   303
private: // member data
williamr@2
   304
	CCalEntryImpl* iImpl;
williamr@2
   305
	};
williamr@2
   306
williamr@2
   307
williamr@2
   308
/** Class representing a uniquely identifiable calendar entry in a calendar file.
williamr@2
   309
williamr@2
   310
@publishedAll
williamr@2
   311
@released
williamr@2
   312
*/
williamr@2
   313
NONSHARABLE_CLASS(CCalEntryId) : public CBase
williamr@2
   314
	{
williamr@2
   315
public:
williamr@2
   316
	IMPORT_C static CCalEntryId* NewL(TDesC8* aFlatData);
williamr@2
   317
	IMPORT_C ~CCalEntryId();
williamr@2
   318
	IMPORT_C TPtrC8 IdL();
williamr@2
   319
	IMPORT_C TPtrC StoreFileNameL();
williamr@2
   320
	IMPORT_C TCalTime RecurrenceIdL();
williamr@2
   321
	IMPORT_C TCalTime InstanceTimeL() const;
williamr@2
   322
	IMPORT_C TCalLocalUid LocalUidL() const;
williamr@2
   323
private:
williamr@2
   324
	CCalEntryId();
williamr@2
   325
private:
williamr@2
   326
	CCalEntryIdImpl* iImpl;
williamr@2
   327
	};
williamr@2
   328
williamr@2
   329
williamr@2
   330
/** Class representing the geographical location of a calendar entry.
williamr@2
   331
This corresponds to the GEO property as defined in vCalendar / iCalendar (RFC 2445). It contains a latitude and a longitude.
williamr@2
   332
@publishedPartner
williamr@2
   333
@prototype
williamr@2
   334
*/
williamr@2
   335
NONSHARABLE_CLASS(CCalGeoValue) : public CBase
williamr@2
   336
	{
williamr@2
   337
public:
williamr@2
   338
	IMPORT_C static CCalGeoValue* NewL();
williamr@2
   339
	IMPORT_C ~CCalGeoValue();
williamr@2
   340
	IMPORT_C void SetLatLongL(const TReal& aLatitude, const TReal& aLongitude);
williamr@2
   341
	IMPORT_C TBool GetLatLong(TReal& aLatitude, TReal& aLongitude) const;
williamr@2
   342
private:
williamr@2
   343
	CCalGeoValue();
williamr@2
   344
private:
williamr@2
   345
	TReal iLatitude;
williamr@2
   346
	TReal iLongitude;
williamr@2
   347
	};
williamr@2
   348
williamr@2
   349
#endif // __CALENTRY_H__