meetingrequest/mrentry/inc/mesmrcalentry.h
branchRCL_3
changeset 25 3533d4323edc
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Interface definition for ESMR calendar entry
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MESMRCALENTRY_H
       
    20 #define MESMRCALENTRY_H
       
    21 
       
    22 //<cmail>
       
    23 #include "esmrdef.h"
       
    24 //</cmail>
       
    25 
       
    26 class CCalEntry;
       
    27 class CCalInstance;
       
    28 class MESMRCalDbMgr;
       
    29 /**
       
    30  * MESMRMeetingRequestEntry provides utility functions for handling MR Entry.
       
    31  *
       
    32  * @lib esmrservices.lib
       
    33  */
       
    34 class MESMRCalEntry
       
    35     {
       
    36 public: // Definitions
       
    37     /** 
       
    38      * Enumeration for cal entry type
       
    39      */
       
    40     enum TESMRCalEntryType
       
    41         {
       
    42         EESMRCalEntryNotSupported = EESMREventTypeNone,
       
    43         EESMRCalEntryMeetingRequest = EESMREventTypeMeetingRequest,
       
    44         EESMRCalEntryMeeting = EESMREventTypeAppt,
       
    45         EESMRCalEntryTodo = EESMREventTypeETodo,
       
    46         EESMRCalEntryMemo = EESMREventTypeEEvent,
       
    47         EESMRCalEntryReminder = EESMREventTypeEReminder,
       
    48         EESMRCalEntryAnniversary = EESMREventTypeEAnniv
       
    49         };
       
    50 
       
    51     /** 
       
    52      * Enumeration for recurrence modifying rule
       
    53      */
       
    54     enum TESMRRecurrenceModifyingRule
       
    55         {
       
    56         // Modify only this entry
       
    57         EESMRThisOnly,
       
    58         // Modification applies to all entries in the series
       
    59         EESMRAllInSeries
       
    60         };
       
    61 
       
    62     /** 
       
    63      * Enumeration for alarm type
       
    64      */
       
    65     enum TESMRAlarmType
       
    66         {
       
    67         /** 
       
    68          * Entry does not contain alarm 
       
    69          */
       
    70         EESMRAlarmNotFound,
       
    71         /** 
       
    72          * Alarm is absolute
       
    73          */
       
    74         EESMRAlarmAbsolute,
       
    75         /** 
       
    76          * Alarm is relative to meeting start time
       
    77          */
       
    78         EESMRAlarmRelative
       
    79         };
       
    80 
       
    81     /**
       
    82      * Enumeration for entry 
       
    83      */
       
    84     enum TMREntryCapability
       
    85         {
       
    86         // Entry supports attachments
       
    87         EMRCapabilityAttachments
       
    88         };
       
    89     
       
    90 public: // Destruction
       
    91     /**
       
    92      * Virtual destructor.
       
    93      */
       
    94     virtual ~MESMRCalEntry() { }
       
    95 
       
    96 public: // Interface
       
    97     /**
       
    98      * Fetches calendar entry type.
       
    99      * @return calendar entry type.
       
   100      */
       
   101     virtual TESMRCalEntryType Type() const = 0;
       
   102 
       
   103     /**
       
   104      * Fetches reference to this calendar entry.
       
   105      * @return Reference to this entry.
       
   106      */
       
   107     virtual MESMRCalEntry& MESMRCalEntryRef() = 0;
       
   108 
       
   109     /**
       
   110      * Fetches const reference to this calendar entry.
       
   111      * @return const reference to this calendar entry.
       
   112      */
       
   113     virtual const MESMRCalEntry& MESMRCalEntryRef() const = 0;
       
   114 
       
   115     /**
       
   116      * Fetches constant reference to CCalEntry.
       
   117      * @return const reference to CCalEntry.
       
   118      */
       
   119     virtual const CCalEntry& Entry() const = 0;
       
   120 
       
   121     /**
       
   122      * Fetches reference to CCalEntry.
       
   123      * @return reference to CCalEntry.
       
   124      */
       
   125     virtual CCalEntry& Entry() = 0;
       
   126 
       
   127     /**
       
   128      * Fetches calendar entry's instance. Ownership is transferred to caller.
       
   129      * @return Reference to calendar entry's instance.
       
   130      */
       
   131     virtual CCalInstance* InstanceL() const = 0;
       
   132 
       
   133     /**
       
   134      * Tests, if recurrence can be set.
       
   135      * @return ETrue, if recurrence can be set. EFalse otherwise.
       
   136      */
       
   137     virtual TBool CanSetRecurrenceL() const = 0;
       
   138 
       
   139     /**
       
   140      * Tests, if this is recurrent meeting request.
       
   141      * @return ETrue, if this is recurrent meeting request.
       
   142      */
       
   143    virtual TBool IsRecurrentEventL() const = 0;
       
   144 
       
   145     /**
       
   146      * Fetches entry's recurrence value.
       
   147      * @param aRecurrence On return contains entry's recurrence information
       
   148      * @param aUntil On return contains time in UTC until recurrence is valid.
       
   149      */
       
   150     virtual void GetRecurrenceL(
       
   151             TESMRRecurrenceValue& aRecurrence,
       
   152             TTime& aUntil ) const = 0;
       
   153 
       
   154     /**
       
   155      * Sets recurrence to ES MR entry. If until time is not set
       
   156      * (i.e, it is null time), then until time is implementation
       
   157      * dependent.
       
   158      * When recurrence is set to ERecurrenceNot, then aUntil parameter
       
   159      * is ignored.
       
   160      * @param aRecurrece Recurrece value.
       
   161      * @param aUntil Recurrence valid until in UTC format.
       
   162      * @error KErrNotSupported Entry cannot be recurrenced.
       
   163      */
       
   164     virtual void SetRecurrenceL(
       
   165             TESMRRecurrenceValue aRecurrence,
       
   166             TTime aUntil = Time::NullTTime() ) = 0;
       
   167 
       
   168     /**
       
   169      * Fetches recurrence modification rule.
       
   170      * @return Modification rule.
       
   171      */
       
   172     virtual TESMRRecurrenceModifyingRule RecurrenceModRule() const = 0;
       
   173 
       
   174     /**
       
   175     * Sets modifying rule role to meeting request.
       
   176     * @param aRule Recurrence modification rule.
       
   177     * @param aRule ETrue event type is changing.
       
   178     */
       
   179    virtual void SetModifyingRuleL(TESMRRecurrenceModifyingRule aRule, 
       
   180 		   const TBool aTypeChanging = EFalse ) = 0;
       
   181         /**
       
   182      * Sets the entry priority.
       
   183      * @param aPriority entry priority.
       
   184      */
       
   185     virtual void SetPriorityL(
       
   186             TUint aPriority ) = 0;
       
   187 
       
   188     /**
       
   189      * Fetches the entry priority.
       
   190      * @return entry priority.
       
   191      */
       
   192     virtual TUint GetPriorityL() const = 0;
       
   193 
       
   194     /**
       
   195      * Sets meeting to be all day event.
       
   196      * @param aStartDate Start date information
       
   197      * @param aEndDate End date information
       
   198      */
       
   199     virtual void SetAllDayEventL(
       
   200             TTime aStartDate,
       
   201             TTime aEndDate ) = 0;
       
   202 
       
   203     /**
       
   204      * Tests, if entry is all day event.
       
   205      * @return ETrue, if entry is all day event
       
   206      */
       
   207     virtual TBool IsAllDayEventL() const = 0;
       
   208 
       
   209     /**
       
   210      * Tests whether this entry has been stored to db or not.
       
   211      * @return ETrue, if entry is stored to calendar DB.
       
   212      */
       
   213     virtual TBool IsStoredL() const = 0;
       
   214 
       
   215     /**
       
   216      * Tests, whether entry is edited.
       
   217      * @return ETrue, if entry is edited.
       
   218      */
       
   219     virtual TBool IsEntryEditedL() const = 0;
       
   220     
       
   221     /**
       
   222      * Tests, if entry type has changed from the original
       
   223      * @return ETrue, if entry type has changed
       
   224      */
       
   225     virtual TBool IsEntryTypeChangedL() const = 0;
       
   226 
       
   227     /**
       
   228      * Sets the entry type changed
       
   229      * @param aTypeChanged, ETrue if type changed, otherwise EFalse
       
   230      */
       
   231     virtual void SetTypeChanged( TBool aTypeChanged ) = 0;
       
   232     
       
   233     /**
       
   234      * Checks if any instance (having same UID)
       
   235      * occurs between specified time. Time information
       
   236      * is considered to be device's local time.
       
   237      *
       
   238      * @param aStart Start time
       
   239      * @param aEnd End time
       
   240      */
       
   241     virtual TBool AnyInstancesBetweenTimePeriodL(
       
   242                 TTime& aStart,
       
   243                 TTime& aEnd ) = 0;
       
   244     
       
   245     /**
       
   246      * Fetches first instances start and end time. For non-recurrent
       
   247      * entries this returns the entry's start and end time.
       
   248      *
       
   249      * @param aStart On returns contains the first instance's start time.
       
   250      * @param aEnd On returns contains the first instance's end time.
       
   251      */
       
   252     virtual void GetFirstInstanceStartAndEndTimeL(
       
   253                 TTime& aStart,
       
   254                 TTime& aEnd ) = 0;
       
   255 
       
   256     /**
       
   257      * Fetches alarm information from entry.
       
   258      * @param aAlarmType On return contains alarm type.
       
   259      * @param aAlarmTime On return contains time when alarm occurs.
       
   260      */
       
   261     virtual void GetAlarmL(
       
   262             TESMRAlarmType& aAlarmType,
       
   263             TTime &aAlarmTime ) = 0;
       
   264 
       
   265     /**
       
   266      * Fetches unmodified entry instance.
       
   267      * @return CCalEntry original entry
       
   268      */
       
   269     virtual const CCalEntry& OriginalEntry() = 0;
       
   270     
       
   271     /**
       
   272      * Updates the entry after storing
       
   273      */
       
   274     virtual void UpdateEntryAfterStoringL() = 0;    
       
   275     
       
   276     /**
       
   277      * Updates the comparative entry (needed in entry type changing)
       
   278      */
       
   279     virtual void UpdateComparativeEntry( CCalEntry* aNewComparativeEntry ) = 0;    
       
   280     
       
   281     /**
       
   282      * Sets default values to entry.
       
   283      */
       
   284     virtual void SetDefaultValuesToEntryL() = 0;    
       
   285     
       
   286     /**
       
   287      * Updates entry's timestamp (DTSTAMP) information.
       
   288      */
       
   289     virtual void UpdateTimeStampL() = 0;
       
   290     
       
   291     /**
       
   292      * Clones entry and leaves the clone into CleanupStack.
       
   293      * 
       
   294      * @param aType the entry type of the clone. If EESMRCalEntryNotSupported
       
   295      * the original type is preserved. 
       
   296      */
       
   297     virtual CCalEntry* CloneEntryLC(
       
   298             TESMRCalEntryType aType = EESMRCalEntryNotSupported ) const = 0;
       
   299     
       
   300     /**
       
   301      * Fetches validated entry. Ownership is transferred to caller.
       
   302      * @return Pointer to validated entry.
       
   303      */
       
   304     virtual CCalEntry* ValidateEntryL() = 0;
       
   305     
       
   306     /**
       
   307      * For recurrent event method removes this from the series.
       
   308      * Entry needs to be recurrent event and modification rule
       
   309      * needs to be MESMRCalEntry::EESMRThisOnly.
       
   310      * Ownership of the returned calendar entry is transferred to caller.
       
   311      *
       
   312      * @return Parent entry
       
   313      */
       
   314     virtual CCalEntry* RemoveInstanceFromSeriesL() = 0;
       
   315     
       
   316     /**
       
   317      * Get calendar dbmgr
       
   318      * 
       
   319      * @return calendar dbmgr
       
   320      */
       
   321     virtual MESMRCalDbMgr& GetDBMgr() = 0; 
       
   322     
       
   323     /**
       
   324      * Tests whether entry supports capability or not.
       
   325      * @param aCapability Capability to be checked
       
   326      * @return ETrue if capability is supported.
       
   327      */
       
   328     virtual TBool SupportsCapabilityL( 
       
   329             TMREntryCapability aCapability ) const = 0;
       
   330     
       
   331     /**
       
   332      * Tests whether entry contains remote attachments or not.
       
   333      * @return ETrue if entry contains remote attachments
       
   334      */
       
   335     virtual TBool ContainsRemoteAttachmentsL() = 0;
       
   336     };
       
   337 
       
   338 #endif // MESMRCALENTRY_H
       
   339 
       
   340 // EOF