epoc32/include/calentry.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 __CALENTRY_H__
    17 #define __CALENTRY_H__
    18 
    19 #include <calcommon.h>
    20 
    21 const TReal KCalGEOMinLatitude = -90;
    22 const TReal KCalGEOMaxLatitude  = 90;
    23 const TReal KCalGEOMinLongitude = -180;
    24 const TReal KCalGEOMaxLongitude  = 180;
    25 
    26 const TUint KCalGEOMaxDecimalPlaces = 6;
    27 
    28 class CCalAlarm;
    29 class CCalAttachment;
    30 class CCalAttendee;
    31 class CCalCategory;
    32 class CCalEntryImpl;
    33 class CCalGeoValue;
    34 class CCalUser;
    35 class CTzRules;
    36 class TCalRRule;
    37 class CCalEntryIdImpl;
    38 
    39 /** Class representing a calendar entry. This can be an appointment, to-do
    40 item, reminder, event or anniversary.
    41 
    42 CCalEntry contains information about a calendar entry, including
    43 a repeat definition, synchronisation information, and group scheduling data.
    44 
    45 A repeating calendar entry has more than one occurrence. Instances are
    46 represented by the CCalInstance class.
    47 
    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.
    50 
    51 @publishedAll
    52 @released
    53 */
    54 NONSHARABLE_CLASS(CCalEntry) : public CBase
    55 	{
    56 public:
    57 	/** Defines the type of the calendar entry.
    58 	@publishedAll
    59 	@released
    60 	*/
    61 	enum TType
    62 		{
    63 		/** An appointment, which has a start time and end time. */
    64 		EAppt,
    65 		/** A to-do, which can have a start time and end time (the end time is the due date), or can be undated. */
    66 		ETodo,
    67 		/** An event, which has a start time and end time. */
    68 		EEvent,
    69 		/** A reminder, which has a start time only. */
    70 		EReminder,
    71 		/** An anniversary, which has a start time and end time. */
    72 		EAnniv
    73 		};
    74 
    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'.
    78 	@publishedAll
    79 	@released
    80 	*/
    81 	enum TStatus
    82 		{
    83 		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event is tentative. */
    84 		ETentative,
    85 		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event has been confirmed. */
    86 		EConfirmed,
    87 		/** Used to support iCalendar (RFC 2445). The event has been cancelled. */
    88 		ECancelled,
    89 		/** Used to support iCalendar (RFC 2445). The to-do entry needs action. */
    90 		ETodoNeedsAction,
    91 		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The to-do entry has been completed. */
    92 		ETodoCompleted,
    93 		/** Used to support iCalendar (RFC 2445). The to-do entry is in progress. */
    94 		ETodoInProcess,
    95 		/** No status is set. */
    96 		ENullStatus,
    97 		
    98 		/** Used to support vCalendar 1.0. The entry has been accepted. */
    99 		EVCalAccepted,
   100 		/** Used to support vCalendar 1.0. The entry needs action. */
   101 		EVCalNeedsAction, 
   102 		/** Used to support vCalendar 1.0. The entry has been sent. */
   103 		EVCalSent, 
   104 		/** Used to support vCalendar 1.0. The entry has been declined. */
   105 		EVCalDeclined,
   106 		/** Used to support vCalendar 1.0. The entry has been delegated. */
   107 		EVCalDelegated,
   108 		};
   109 
   110 	/** Replication status.
   111 	@publishedAll
   112 	@released
   113 	*/
   114 	enum TReplicationStatus
   115 		{
   116 		/** No restriction on access. */
   117 		EOpen,
   118 		/** Data is private (no access). */
   119 		EPrivate,
   120 		/** Data is confidential (restricted access). */
   121 		ERestricted
   122 		};
   123 
   124 	/** The method property of a Group Scheduling entry.
   125 	@publishedAll
   126 	@released
   127 	*/
   128 	enum TMethod
   129 		{
   130 		/** The RFC2445-defined method value 'None'. */
   131 		EMethodNone,
   132 		/** The RFC2445-defined method value 'Publish'. */
   133 		EMethodPublish,
   134 		/** The RFC2445-defined method value 'Request'. */
   135 		EMethodRequest,
   136 		/** The RFC2445-defined method value 'Reply'. */
   137 		EMethodReply,
   138 		/** The RFC2445-defined method value 'Add'. */
   139 		EMethodAdd,
   140 		/** The RFC2445-defined method value 'Cancel'. */
   141 		EMethodCancel,
   142 		/** The RFC2445-defined method value 'Refresh'. */
   143 		EMethodRefresh,
   144 		/** The RFC2445-defined method value 'Counter'. */
   145 		EMethodCounter,
   146 		/** The RFC2445-defined method value 'DeclineCounter'. */
   147 		EMethodDeclineCounter
   148 		};
   149 
   150 	/** Specify which entry details are to be copied in CCalEntry::CopyFromL functions.
   151 	@publishedAll
   152 	@released
   153 	*/
   154 	enum TCopyType
   155 		{
   156 		/** Copy the ID of the entry */
   157 		ECopyAll,
   158 		/** Dont copy ID of the entry */
   159 		EDontCopyId
   160 		};
   161 
   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).
   166 	@publishedPartner
   167 	@prototype
   168 	*/
   169 	enum TTransp
   170 		{
   171 		/** The entry blocks time. */
   172 		ETranspBusy,
   173 		/** The entry doesn't block time. */
   174 		ETranspFree,
   175 		/** The entry is tentative and blocks time. */
   176 		ETranspTentative,
   177 		/** The entry is an out-of-office calendar event and blocks time. */
   178 		ETranspOutOfOffice,
   179 		};
   180 
   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);
   185 
   186 	IMPORT_C ~CCalEntry();
   187 
   188 	// Date and Time
   189 	IMPORT_C TCalTime StartTimeL() const;
   190 	IMPORT_C TCalTime EndTimeL() const;
   191 	IMPORT_C void SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime);
   192 
   193 	IMPORT_C void SetLastModifiedDateL();
   194 	IMPORT_C void SetLastModifiedDateL(const TCalTime& aModifiedTime);
   195 	IMPORT_C TCalTime LastModifiedDateL() const;
   196 
   197 	IMPORT_C void SetDTStampL(const TCalTime& aTime);
   198 	IMPORT_C TCalTime DTStampL() const;
   199 
   200 	IMPORT_C TCalTime CompletedTimeL() const;
   201 	IMPORT_C void SetCompletedL(TBool aCompleted, const TCalTime& aTime);
   202 
   203 	// Repeat rules / RDate / ExDate Methods
   204 	IMPORT_C void SetRRuleL(const TCalRRule& aRule);
   205 	IMPORT_C TBool GetRRuleL(TCalRRule& aRule) const;
   206 
   207 	IMPORT_C void SetRDatesL(const RArray<TCalTime>& aRDateList);
   208 	IMPORT_C void GetRDatesL(RArray<TCalTime>& aRDateList) const;
   209 
   210 	IMPORT_C void SetExceptionDatesL(const RArray<TCalTime>& aExDateList);
   211 	IMPORT_C void GetExceptionDatesL(RArray<TCalTime>& aExDateList) const;
   212 
   213 	IMPORT_C void ClearRepeatingPropertiesL();
   214 	
   215 	// Entry alarm
   216 	IMPORT_C void SetAlarmL(CCalAlarm* aAlarm);
   217 	IMPORT_C CCalAlarm* AlarmL() const;
   218 
   219 	// Comparison
   220 	IMPORT_C TBool CompareL(const CCalEntry& aEntry) const;
   221 
   222  	// Copy
   223  	IMPORT_C void CopyFromL(const CCalEntry& aOther);
   224 	IMPORT_C void CopyFromL(const CCalEntry& aOther, TCopyType aCopyType);
   225 
   226 	// Text Fields
   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;
   233 
   234 	// Category list
   235 	IMPORT_C void AddCategoryL(CCalCategory* aCategory);
   236 	IMPORT_C void DeleteCategoryL(TInt aIndex);
   237 	IMPORT_C const RPointerArray<CCalCategory>& CategoryListL();
   238 
   239 	//	Attendee Methods
   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;
   247 
   248 	// Attachments
   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;
   253 	// Other Attributes
   254 	IMPORT_C TType EntryTypeL() const;
   255 	IMPORT_C void SetStatusL(TStatus aStatus);
   256 	IMPORT_C TStatus StatusL() const;
   257 
   258 	IMPORT_C void SetReplicationStatusL(TReplicationStatus aReplicationStatus);
   259 	IMPORT_C TReplicationStatus ReplicationStatusL() const;
   260 
   261 	IMPORT_C void SetPriorityL(TUint aPriority);
   262 	IMPORT_C TUint PriorityL() const;
   263 
   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;
   271 
   272 	IMPORT_C CTzRules* TzRulesL() const;
   273 	IMPORT_C void SetTzRulesL(const CTzRules& aTzRule);
   274 	IMPORT_C void SetTzRulesL();
   275 
   276 	IMPORT_C void SetLocalUidL(TCalLocalUid aLocalId);
   277 	IMPORT_C TCalLocalUid LocalUidL() const;
   278 
   279 	IMPORT_C TTransp TimeTransparencyL() const;
   280 	IMPORT_C void SetTimeTransparencyL(TTransp aBusyStatus);
   281 
   282 	IMPORT_C CCalGeoValue* GeoValueL() const;
   283 	IMPORT_C void SetGeoValueL(const CCalGeoValue& aGeoValue);
   284 	IMPORT_C void ClearGeoValueL();
   285 
   286 	// Internal APIs (Used by Java)
   287 	IMPORT_C TCalTime NextInstanceForLocalUIDL(const TCalTime& aTime) const;
   288 	IMPORT_C TCalTime PreviousInstanceForLocalUIDL(const TCalTime& aTime) const;
   289 	
   290 	IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
   291 
   292 	
   293 public:
   294 	// Internal APIs
   295 	static CCalEntry* NewL(CCalEntryImpl* aImpl);
   296 	CCalEntryImpl* Impl() const;
   297 	
   298 private:
   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);
   302 
   303 private: // member data
   304 	CCalEntryImpl* iImpl;
   305 	};
   306 
   307 
   308 /** Class representing a uniquely identifiable calendar entry in a calendar file.
   309 
   310 @publishedAll
   311 @released
   312 */
   313 NONSHARABLE_CLASS(CCalEntryId) : public CBase
   314 	{
   315 public:
   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;
   323 private:
   324 	CCalEntryId();
   325 private:
   326 	CCalEntryIdImpl* iImpl;
   327 	};
   328 
   329 
   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.
   332 @publishedPartner
   333 @prototype
   334 */
   335 NONSHARABLE_CLASS(CCalGeoValue) : public CBase
   336 	{
   337 public:
   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;
   342 private:
   343 	CCalGeoValue();
   344 private:
   345 	TReal iLatitude;
   346 	TReal iLongitude;
   347 	};
   348 
   349 #endif // __CALENTRY_H__