1.1 --- a/epoc32/include/calentry.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/calentry.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,349 @@
1.4 -calentry.h
1.5 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __CALENTRY_H__
1.21 +#define __CALENTRY_H__
1.22 +
1.23 +#include <calcommon.h>
1.24 +
1.25 +const TReal KCalGEOMinLatitude = -90;
1.26 +const TReal KCalGEOMaxLatitude = 90;
1.27 +const TReal KCalGEOMinLongitude = -180;
1.28 +const TReal KCalGEOMaxLongitude = 180;
1.29 +
1.30 +const TUint KCalGEOMaxDecimalPlaces = 6;
1.31 +
1.32 +class CCalAlarm;
1.33 +class CCalAttachment;
1.34 +class CCalAttendee;
1.35 +class CCalCategory;
1.36 +class CCalEntryImpl;
1.37 +class CCalGeoValue;
1.38 +class CCalUser;
1.39 +class CTzRules;
1.40 +class TCalRRule;
1.41 +class CCalEntryIdImpl;
1.42 +
1.43 +/** Class representing a calendar entry. This can be an appointment, to-do
1.44 +item, reminder, event or anniversary.
1.45 +
1.46 +CCalEntry contains information about a calendar entry, including
1.47 +a repeat definition, synchronisation information, and group scheduling data.
1.48 +
1.49 +A repeating calendar entry has more than one occurrence. Instances are
1.50 +represented by the CCalInstance class.
1.51 +
1.52 +Synchronisation information includes a record of the date/time the entry was
1.53 +last modified. This can be found by calling the LastModifiedDateL() function.
1.54 +
1.55 +@publishedAll
1.56 +@released
1.57 +*/
1.58 +NONSHARABLE_CLASS(CCalEntry) : public CBase
1.59 + {
1.60 +public:
1.61 + /** Defines the type of the calendar entry.
1.62 + @publishedAll
1.63 + @released
1.64 + */
1.65 + enum TType
1.66 + {
1.67 + /** An appointment, which has a start time and end time. */
1.68 + EAppt,
1.69 + /** A to-do, which can have a start time and end time (the end time is the due date), or can be undated. */
1.70 + ETodo,
1.71 + /** An event, which has a start time and end time. */
1.72 + EEvent,
1.73 + /** A reminder, which has a start time only. */
1.74 + EReminder,
1.75 + /** An anniversary, which has a start time and end time. */
1.76 + EAnniv
1.77 + };
1.78 +
1.79 + /** Defines the possible status values of the entry.
1.80 + There are values here to support both iCalendar (RFC 2445) and vCalendar v1.0 STATUS properties.
1.81 + Enumerated values for vCalendar v1.0 contain the prefix 'EVCal'.
1.82 + @publishedAll
1.83 + @released
1.84 + */
1.85 + enum TStatus
1.86 + {
1.87 + /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event is tentative. */
1.88 + ETentative,
1.89 + /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The event has been confirmed. */
1.90 + EConfirmed,
1.91 + /** Used to support iCalendar (RFC 2445). The event has been cancelled. */
1.92 + ECancelled,
1.93 + /** Used to support iCalendar (RFC 2445). The to-do entry needs action. */
1.94 + ETodoNeedsAction,
1.95 + /** Used to support iCalendar (RFC 2445) and vCalendar 1.0. The to-do entry has been completed. */
1.96 + ETodoCompleted,
1.97 + /** Used to support iCalendar (RFC 2445). The to-do entry is in progress. */
1.98 + ETodoInProcess,
1.99 + /** No status is set. */
1.100 + ENullStatus,
1.101 +
1.102 + /** Used to support vCalendar 1.0. The entry has been accepted. */
1.103 + EVCalAccepted,
1.104 + /** Used to support vCalendar 1.0. The entry needs action. */
1.105 + EVCalNeedsAction,
1.106 + /** Used to support vCalendar 1.0. The entry has been sent. */
1.107 + EVCalSent,
1.108 + /** Used to support vCalendar 1.0. The entry has been declined. */
1.109 + EVCalDeclined,
1.110 + /** Used to support vCalendar 1.0. The entry has been delegated. */
1.111 + EVCalDelegated,
1.112 + };
1.113 +
1.114 + /** Replication status.
1.115 + @publishedAll
1.116 + @released
1.117 + */
1.118 + enum TReplicationStatus
1.119 + {
1.120 + /** No restriction on access. */
1.121 + EOpen,
1.122 + /** Data is private (no access). */
1.123 + EPrivate,
1.124 + /** Data is confidential (restricted access). */
1.125 + ERestricted
1.126 + };
1.127 +
1.128 + /** The method property of a Group Scheduling entry.
1.129 + @publishedAll
1.130 + @released
1.131 + */
1.132 + enum TMethod
1.133 + {
1.134 + /** The RFC2445-defined method value 'None'. */
1.135 + EMethodNone,
1.136 + /** The RFC2445-defined method value 'Publish'. */
1.137 + EMethodPublish,
1.138 + /** The RFC2445-defined method value 'Request'. */
1.139 + EMethodRequest,
1.140 + /** The RFC2445-defined method value 'Reply'. */
1.141 + EMethodReply,
1.142 + /** The RFC2445-defined method value 'Add'. */
1.143 + EMethodAdd,
1.144 + /** The RFC2445-defined method value 'Cancel'. */
1.145 + EMethodCancel,
1.146 + /** The RFC2445-defined method value 'Refresh'. */
1.147 + EMethodRefresh,
1.148 + /** The RFC2445-defined method value 'Counter'. */
1.149 + EMethodCounter,
1.150 + /** The RFC2445-defined method value 'DeclineCounter'. */
1.151 + EMethodDeclineCounter
1.152 + };
1.153 +
1.154 + /** Specify which entry details are to be copied in CCalEntry::CopyFromL functions.
1.155 + @publishedAll
1.156 + @released
1.157 + */
1.158 + enum TCopyType
1.159 + {
1.160 + /** Copy the ID of the entry */
1.161 + ECopyAll,
1.162 + /** Dont copy ID of the entry */
1.163 + EDontCopyId
1.164 + };
1.165 +
1.166 + /** The busy status of an entry and corresponds to the TRANSP property in the iCalendar (RFC 2445) and vCalendar specifications.
1.167 + In the vCalendar specification, the TRANSP property can be any positive integer value. 0 is opaque and blocks time, 1
1.168 + is transparent and doesn't block time. Any higher values have an implementation-specific meaning.
1.169 + In the iCalendar specification (RFC 2445), the TRANSP property can be either OPAQUE (blocks time) or TRANSPARENT (doesn't block time).
1.170 + @publishedPartner
1.171 + @prototype
1.172 + */
1.173 + enum TTransp
1.174 + {
1.175 + /** The entry blocks time. */
1.176 + ETranspBusy,
1.177 + /** The entry doesn't block time. */
1.178 + ETranspFree,
1.179 + /** The entry is tentative and blocks time. */
1.180 + ETranspTentative,
1.181 + /** The entry is an out-of-office calendar event and blocks time. */
1.182 + ETranspOutOfOffice,
1.183 + };
1.184 +
1.185 + // Construction / Destruction
1.186 + IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
1.187 + IMPORT_C static CCalEntry* NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum,
1.188 + const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
1.189 +
1.190 + IMPORT_C ~CCalEntry();
1.191 +
1.192 + // Date and Time
1.193 + IMPORT_C TCalTime StartTimeL() const;
1.194 + IMPORT_C TCalTime EndTimeL() const;
1.195 + IMPORT_C void SetStartAndEndTimeL(const TCalTime& aStartTime, const TCalTime& aEndTime);
1.196 +
1.197 + IMPORT_C void SetLastModifiedDateL();
1.198 + IMPORT_C void SetLastModifiedDateL(const TCalTime& aModifiedTime);
1.199 + IMPORT_C TCalTime LastModifiedDateL() const;
1.200 +
1.201 + IMPORT_C void SetDTStampL(const TCalTime& aTime);
1.202 + IMPORT_C TCalTime DTStampL() const;
1.203 +
1.204 + IMPORT_C TCalTime CompletedTimeL() const;
1.205 + IMPORT_C void SetCompletedL(TBool aCompleted, const TCalTime& aTime);
1.206 +
1.207 + // Repeat rules / RDate / ExDate Methods
1.208 + IMPORT_C void SetRRuleL(const TCalRRule& aRule);
1.209 + IMPORT_C TBool GetRRuleL(TCalRRule& aRule) const;
1.210 +
1.211 + IMPORT_C void SetRDatesL(const RArray<TCalTime>& aRDateList);
1.212 + IMPORT_C void GetRDatesL(RArray<TCalTime>& aRDateList) const;
1.213 +
1.214 + IMPORT_C void SetExceptionDatesL(const RArray<TCalTime>& aExDateList);
1.215 + IMPORT_C void GetExceptionDatesL(RArray<TCalTime>& aExDateList) const;
1.216 +
1.217 + IMPORT_C void ClearRepeatingPropertiesL();
1.218 +
1.219 + // Entry alarm
1.220 + IMPORT_C void SetAlarmL(CCalAlarm* aAlarm);
1.221 + IMPORT_C CCalAlarm* AlarmL() const;
1.222 +
1.223 + // Comparison
1.224 + IMPORT_C TBool CompareL(const CCalEntry& aEntry) const;
1.225 +
1.226 + // Copy
1.227 + IMPORT_C void CopyFromL(const CCalEntry& aOther);
1.228 + IMPORT_C void CopyFromL(const CCalEntry& aOther, TCopyType aCopyType);
1.229 +
1.230 + // Text Fields
1.231 + IMPORT_C void SetSummaryL(const TDesC& aSummary);
1.232 + IMPORT_C const TDesC& SummaryL() const;
1.233 + IMPORT_C void SetDescriptionL(const TDesC& aDescription);
1.234 + IMPORT_C const TDesC& DescriptionL() const;
1.235 + IMPORT_C void SetLocationL(const TDesC& aLocation);
1.236 + IMPORT_C const TDesC& LocationL() const;
1.237 +
1.238 + // Category list
1.239 + IMPORT_C void AddCategoryL(CCalCategory* aCategory);
1.240 + IMPORT_C void DeleteCategoryL(TInt aIndex);
1.241 + IMPORT_C const RPointerArray<CCalCategory>& CategoryListL();
1.242 +
1.243 + // Attendee Methods
1.244 + IMPORT_C void AddAttendeeL(CCalAttendee* aAttendee);
1.245 + IMPORT_C void DeleteAttendeeL(TInt aIndex);
1.246 + IMPORT_C RPointerArray<CCalAttendee>& AttendeesL() const;
1.247 + IMPORT_C void SetOrganizerL(CCalUser* aUser);
1.248 + IMPORT_C CCalUser* OrganizerL() const;
1.249 + IMPORT_C void SetPhoneOwnerL(const CCalUser* aOwner);
1.250 + IMPORT_C CCalUser* PhoneOwnerL() const;
1.251 +
1.252 + // Attachments
1.253 + IMPORT_C void AddAttachmentL(CCalAttachment& aAttachment);
1.254 + IMPORT_C void DeleteAttachmentL(const CCalAttachment& aAttachment);
1.255 + IMPORT_C CCalAttachment* AttachmentL(TInt aIndex) const;
1.256 + IMPORT_C TInt AttachmentCountL() const;
1.257 + // Other Attributes
1.258 + IMPORT_C TType EntryTypeL() const;
1.259 + IMPORT_C void SetStatusL(TStatus aStatus);
1.260 + IMPORT_C TStatus StatusL() const;
1.261 +
1.262 + IMPORT_C void SetReplicationStatusL(TReplicationStatus aReplicationStatus);
1.263 + IMPORT_C TReplicationStatus ReplicationStatusL() const;
1.264 +
1.265 + IMPORT_C void SetPriorityL(TUint aPriority);
1.266 + IMPORT_C TUint PriorityL() const;
1.267 +
1.268 + IMPORT_C void SetMethodL(TMethod aMethod);
1.269 + IMPORT_C TMethod MethodL() const;
1.270 + IMPORT_C void SetSequenceNumberL(TInt aSeq);
1.271 + IMPORT_C TInt SequenceNumberL() const;
1.272 + IMPORT_C const TDesC8& UidL() const;
1.273 + IMPORT_C TCalTime RecurrenceIdL() const;
1.274 + IMPORT_C CalCommon::TRecurrenceRange RecurrenceRangeL() const;
1.275 +
1.276 + IMPORT_C CTzRules* TzRulesL() const;
1.277 + IMPORT_C void SetTzRulesL(const CTzRules& aTzRule);
1.278 + IMPORT_C void SetTzRulesL();
1.279 +
1.280 + IMPORT_C void SetLocalUidL(TCalLocalUid aLocalId);
1.281 + IMPORT_C TCalLocalUid LocalUidL() const;
1.282 +
1.283 + IMPORT_C TTransp TimeTransparencyL() const;
1.284 + IMPORT_C void SetTimeTransparencyL(TTransp aBusyStatus);
1.285 +
1.286 + IMPORT_C CCalGeoValue* GeoValueL() const;
1.287 + IMPORT_C void SetGeoValueL(const CCalGeoValue& aGeoValue);
1.288 + IMPORT_C void ClearGeoValueL();
1.289 +
1.290 + // Internal APIs (Used by Java)
1.291 + IMPORT_C TCalTime NextInstanceForLocalUIDL(const TCalTime& aTime) const;
1.292 + IMPORT_C TCalTime PreviousInstanceForLocalUIDL(const TCalTime& aTime) const;
1.293 +
1.294 + IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
1.295 +
1.296 +
1.297 +public:
1.298 + // Internal APIs
1.299 + static CCalEntry* NewL(CCalEntryImpl* aImpl);
1.300 + CCalEntryImpl* Impl() const;
1.301 +
1.302 +private:
1.303 + void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum, const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange);
1.304 + void ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum);
1.305 + void ConstructL(CCalEntryImpl* aImpl);
1.306 +
1.307 +private: // member data
1.308 + CCalEntryImpl* iImpl;
1.309 + };
1.310 +
1.311 +
1.312 +/** Class representing a uniquely identifiable calendar entry in a calendar file.
1.313 +
1.314 +@publishedAll
1.315 +@released
1.316 +*/
1.317 +NONSHARABLE_CLASS(CCalEntryId) : public CBase
1.318 + {
1.319 +public:
1.320 + IMPORT_C static CCalEntryId* NewL(TDesC8* aFlatData);
1.321 + IMPORT_C ~CCalEntryId();
1.322 + IMPORT_C TPtrC8 IdL();
1.323 + IMPORT_C TPtrC StoreFileNameL();
1.324 + IMPORT_C TCalTime RecurrenceIdL();
1.325 + IMPORT_C TCalTime InstanceTimeL() const;
1.326 + IMPORT_C TCalLocalUid LocalUidL() const;
1.327 +private:
1.328 + CCalEntryId();
1.329 +private:
1.330 + CCalEntryIdImpl* iImpl;
1.331 + };
1.332 +
1.333 +
1.334 +/** Class representing the geographical location of a calendar entry.
1.335 +This corresponds to the GEO property as defined in vCalendar / iCalendar (RFC 2445). It contains a latitude and a longitude.
1.336 +@publishedPartner
1.337 +@prototype
1.338 +*/
1.339 +NONSHARABLE_CLASS(CCalGeoValue) : public CBase
1.340 + {
1.341 +public:
1.342 + IMPORT_C static CCalGeoValue* NewL();
1.343 + IMPORT_C ~CCalGeoValue();
1.344 + IMPORT_C void SetLatLongL(const TReal& aLatitude, const TReal& aLongitude);
1.345 + IMPORT_C TBool GetLatLong(TReal& aLatitude, TReal& aLongitude) const;
1.346 +private:
1.347 + CCalGeoValue();
1.348 +private:
1.349 + TReal iLatitude;
1.350 + TReal iLongitude;
1.351 + };
1.352 +
1.353 +#endif // __CALENTRY_H__