pimappservices/calendar/inc/calentry.h
changeset 0 f979ecb2b13e
child 29 12af337248b1
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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".
       
     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 /** Minimum latitude in degrees.
       
    22 @see CCalGeoValue::SetLatLongL
       
    23 @publishedAll
       
    24 @released
       
    25 */
       
    26 const TReal KCalGEOMinLatitude = -90;
       
    27 
       
    28 /** Maximum latitude in degrees.
       
    29 @see CCalGeoValue::SetLatLongL
       
    30 @publishedAll
       
    31 @released
       
    32 */
       
    33 const TReal KCalGEOMaxLatitude  = 90;
       
    34 
       
    35 /** Minimum longitude in degrees.
       
    36 @see CCalGeoValue::SetLatLongL
       
    37 @publishedAll
       
    38 @released
       
    39 */
       
    40 const TReal KCalGEOMinLongitude = -180;
       
    41 
       
    42 /** Maximum longitude in degrees.
       
    43 @see CCalGeoValue::SetLatLongL
       
    44 @publishedAll
       
    45 @released
       
    46 */
       
    47 const TReal KCalGEOMaxLongitude  = 180;
       
    48 
       
    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
       
    53 @publishedAll
       
    54 @released
       
    55 */
       
    56 const TUint KCalGEOMaxDecimalPlaces = 6;
       
    57 
       
    58 class CCalAlarm;
       
    59 class CCalAttachment;
       
    60 class CCalAttendee;
       
    61 class CCalCategory;
       
    62 class CCalEntryImpl;
       
    63 class CCalGeoValue;
       
    64 class CCalUser;
       
    65 class CTzRules;
       
    66 class TCalRRule;
       
    67 class CCalEntryIdImpl;
       
    68 
       
    69 /** Class representing a calendar entry. This can be an appointment, to-do
       
    70 item, reminder, event or anniversary.
       
    71 
       
    72 CCalEntry contains information about a calendar entry, including
       
    73 a repeat definition, synchronisation information, and group scheduling data.
       
    74 
       
    75 A repeating calendar entry has more than one occurrence. Instances are
       
    76 represented by the CCalInstance class.
       
    77 
       
    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.
       
    80 
       
    81 @publishedAll
       
    82 @released
       
    83 */
       
    84 NONSHARABLE_CLASS(CCalEntry) : public CBase
       
    85 	{
       
    86 public:
       
    87 	/** Defines the type of the calendar entry.
       
    88 	@publishedAll
       
    89 	@released
       
    90 	*/
       
    91 	enum TType
       
    92 		{
       
    93 		/** An appointment, which has a start time and end time. */
       
    94 		EAppt,
       
    95 		/** A to-do, which can have a start time and end time (the end time is the due date), or can be undated. */
       
    96 		ETodo,
       
    97 		/** An event, which has a start time and end time. */
       
    98 		EEvent,
       
    99 		/** A reminder, which has a start time only. */
       
   100 		EReminder,
       
   101 		/** An anniversary, which has a start time and end time. */
       
   102 		EAnniv
       
   103 		};
       
   104 
       
   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'.
       
   108 	@publishedAll
       
   109 	@released
       
   110 	*/
       
   111 	enum TStatus
       
   112 		{
       
   113 		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event is tentative. */
       
   114 		ETentative,
       
   115 		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event has been confirmed. */
       
   116 		EConfirmed,
       
   117 		/** Used to support iCalendar (RFC 2445). The event has been cancelled. */
       
   118 		ECancelled,
       
   119 		/** Used to support iCalendar (RFC 2445). The to-do entry needs action. */
       
   120 		ETodoNeedsAction,
       
   121 		/** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The to-do entry has been completed. */
       
   122 		ETodoCompleted,
       
   123 		/** Used to support iCalendar (RFC 2445). The to-do entry is in progress. */
       
   124 		ETodoInProcess,
       
   125 		/** No status is set. */
       
   126 		ENullStatus,
       
   127 		
       
   128 		/** Used to support vCalendar 1.0. The entry has been accepted. */
       
   129 		EVCalAccepted,
       
   130 		/** Used to support vCalendar 1.0. The entry needs action. */
       
   131 		EVCalNeedsAction, 
       
   132 		/** Used to support vCalendar 1.0. The entry has been sent. */
       
   133 		EVCalSent, 
       
   134 		/** Used to support vCalendar 1.0. The entry has been declined. */
       
   135 		EVCalDeclined,
       
   136 		/** Used to support vCalendar 1.0. The entry has been delegated. */
       
   137 		EVCalDelegated,
       
   138 		};
       
   139 
       
   140 	/** Replication status.
       
   141 	@publishedAll
       
   142 	@released
       
   143 	*/
       
   144 	enum TReplicationStatus
       
   145 		{
       
   146 		/** No restriction on access. */
       
   147 		EOpen,
       
   148 		/** Data is private (no access). */
       
   149 		EPrivate,
       
   150 		/** Data is confidential (restricted access). */
       
   151 		ERestricted
       
   152 		};
       
   153 
       
   154 	/** The method property of a Group Scheduling entry.
       
   155 	@publishedAll
       
   156 	@released
       
   157 	*/
       
   158 	enum TMethod
       
   159 		{
       
   160 		/** The RFC2445-defined method value 'None'. */
       
   161 		EMethodNone,
       
   162 		/** The RFC2445-defined method value 'Publish'. */
       
   163 		EMethodPublish,
       
   164 		/** The RFC2445-defined method value 'Request'. */
       
   165 		EMethodRequest,
       
   166 		/** The RFC2445-defined method value 'Reply'. */
       
   167 		EMethodReply,
       
   168 		/** The RFC2445-defined method value 'Add'. */
       
   169 		EMethodAdd,
       
   170 		/** The RFC2445-defined method value 'Cancel'. */
       
   171 		EMethodCancel,
       
   172 		/** The RFC2445-defined method value 'Refresh'. */
       
   173 		EMethodRefresh,
       
   174 		/** The RFC2445-defined method value 'Counter'. */
       
   175 		EMethodCounter,
       
   176 		/** The RFC2445-defined method value 'DeclineCounter'. */
       
   177 		EMethodDeclineCounter
       
   178 		};
       
   179 
       
   180 	/** Specify which entry details are to be copied in CCalEntry::CopyFromL functions.
       
   181 	@publishedAll
       
   182 	@released
       
   183 	*/
       
   184 	enum TCopyType
       
   185 		{
       
   186 		/** Copy the ID of the entry */
       
   187 		ECopyAll,
       
   188 		/** Dont copy ID of the entry */
       
   189 		EDontCopyId
       
   190 		};
       
   191 
       
   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).
       
   196 	@publishedPartner
       
   197 	@released
       
   198 	*/
       
   199 	enum TTransp
       
   200 		{
       
   201 		/** The entry blocks time. */
       
   202 		ETranspBusy,
       
   203 		/** The entry doesn't block time. */
       
   204 		ETranspFree,
       
   205 		/** The entry is tentative and blocks time. */
       
   206 		ETranspTentative,
       
   207 		/** The entry is an out-of-office calendar event and blocks time. */
       
   208 		ETranspOutOfOffice,
       
   209 		};
       
   210 
       
   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);
       
   215 
       
   216 	IMPORT_C ~CCalEntry();
       
   217 
       
   218 	// Date and Time
       
   219 	IMPORT_C TCalTime StartTimeL() const;
       
   220 	IMPORT_C TCalTime EndTimeL() const;
       
   221 	IMPORT_C void SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime);
       
   222 
       
   223 	IMPORT_C void SetLastModifiedDateL();
       
   224 	IMPORT_C void SetLastModifiedDateL(const TCalTime& aModifiedTime);
       
   225 	IMPORT_C TCalTime LastModifiedDateL() const;
       
   226 
       
   227 	IMPORT_C void SetDTStampL(const TCalTime& aTime);
       
   228 	IMPORT_C TCalTime DTStampL() const;
       
   229 
       
   230 	IMPORT_C TCalTime CompletedTimeL() const;
       
   231 	IMPORT_C void SetCompletedL(TBool aCompleted, const TCalTime& aTime);
       
   232 
       
   233 	// Repeat rules / RDate / ExDate Methods
       
   234 	IMPORT_C void SetRRuleL(const TCalRRule& aRule);
       
   235 	IMPORT_C TBool GetRRuleL(TCalRRule& aRule) const;
       
   236 
       
   237 	IMPORT_C void SetRDatesL(const RArray<TCalTime>& aRDateList);
       
   238 	IMPORT_C void GetRDatesL(RArray<TCalTime>& aRDateList) const;
       
   239 
       
   240 	IMPORT_C void SetExceptionDatesL(const RArray<TCalTime>& aExDateList);
       
   241 	IMPORT_C void GetExceptionDatesL(RArray<TCalTime>& aExDateList) const;
       
   242 
       
   243 	IMPORT_C void ClearRepeatingPropertiesL();
       
   244 	
       
   245 	// Entry alarm
       
   246 	IMPORT_C void SetAlarmL(CCalAlarm* aAlarm);
       
   247 	IMPORT_C CCalAlarm* AlarmL() const;
       
   248 
       
   249 	// Comparison
       
   250 	IMPORT_C TBool CompareL(const CCalEntry& aEntry) const;
       
   251 
       
   252  	// Copy
       
   253  	IMPORT_C void CopyFromL(const CCalEntry& aOther);
       
   254 	IMPORT_C void CopyFromL(const CCalEntry& aOther, TCopyType aCopyType);
       
   255 
       
   256 	// Text Fields
       
   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;
       
   263 
       
   264 	// Category list
       
   265 	IMPORT_C void AddCategoryL(CCalCategory* aCategory);
       
   266 	IMPORT_C void DeleteCategoryL(TInt aIndex);
       
   267 	IMPORT_C const RPointerArray<CCalCategory>& CategoryListL();
       
   268 
       
   269 	//	Attendee Methods
       
   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;
       
   277 
       
   278 	// Attachments
       
   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;
       
   283 	// Other Attributes
       
   284 	IMPORT_C TType EntryTypeL() const;
       
   285 	IMPORT_C void SetStatusL(TStatus aStatus);
       
   286 	IMPORT_C TStatus StatusL() const;
       
   287 
       
   288 	IMPORT_C void SetReplicationStatusL(TReplicationStatus aReplicationStatus);
       
   289 	IMPORT_C TReplicationStatus ReplicationStatusL() const;
       
   290 
       
   291 	IMPORT_C void SetPriorityL(TUint aPriority);
       
   292 	IMPORT_C TUint PriorityL() const;
       
   293 
       
   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;
       
   301 
       
   302 	IMPORT_C CTzRules* TzRulesL() const;
       
   303 	IMPORT_C void SetTzRulesL(const CTzRules& aTzRule);
       
   304 	IMPORT_C void SetTzRulesL();
       
   305 
       
   306 	IMPORT_C void SetLocalUidL(TCalLocalUid aLocalId);
       
   307 	IMPORT_C TCalLocalUid LocalUidL() const;
       
   308 
       
   309 	IMPORT_C TTransp TimeTransparencyL() const;
       
   310 	IMPORT_C void SetTimeTransparencyL(TTransp aBusyStatus);
       
   311 
       
   312 	IMPORT_C CCalGeoValue* GeoValueL() const;
       
   313 	IMPORT_C void SetGeoValueL(const CCalGeoValue& aGeoValue);
       
   314 	IMPORT_C void ClearGeoValueL();
       
   315 
       
   316 	IMPORT_C TCalTime NextInstanceForLocalUIDL(const TCalTime& aTime) const;
       
   317 	IMPORT_C TCalTime PreviousInstanceForLocalUIDL(const TCalTime& aTime) const;
       
   318 
       
   319 	IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
       
   320     
       
   321 public:
       
   322 	// Internal APIs
       
   323 	static CCalEntry* NewL(CCalEntryImpl* aImpl);
       
   324 	CCalEntryImpl* Impl() const;
       
   325 	TUint8 ShortFileIdL();
       
   326 
       
   327 private:
       
   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);
       
   331 
       
   332 private: // member data
       
   333 	CCalEntryImpl* iImpl;
       
   334 	};
       
   335 
       
   336 
       
   337 /** Class representing a uniquely identifiable calendar entry in a calendar file.
       
   338 
       
   339 @publishedAll
       
   340 @released
       
   341 */
       
   342 NONSHARABLE_CLASS(CCalEntryId) : public CBase
       
   343 	{
       
   344 public:
       
   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;
       
   352 private:
       
   353 	CCalEntryId();
       
   354 private:
       
   355 	CCalEntryIdImpl* iImpl;
       
   356 	};
       
   357 
       
   358 
       
   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.
       
   361 @publishedAll
       
   362 @released
       
   363 */
       
   364 NONSHARABLE_CLASS(CCalGeoValue) : public CBase
       
   365 	{
       
   366 public:
       
   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;
       
   371 private:
       
   372 	CCalGeoValue();
       
   373 private:
       
   374 	TReal iLatitude;
       
   375 	TReal iLongitude;
       
   376 	};
       
   377 
       
   378 #endif // __CALENTRY_H__
       
   379