meetingrequest/mrservices/inc/cesmrrecurrenceinfohandler.h
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 //<cmail>
    23 //<cmail>
    24 #include "esmrdef.h"
    24 #include "esmrdef.h"
    25 //</cmail>
    25 //</cmail>
    26 #include <caltime.h>
    26 #include <caltime.h>
       
    27 #include <calcommon.h>
    27 
    28 
    28 class CCalEntry;
    29 class CCalEntry;
    29 class TCalRRule;
    30 class TCalRRule;
       
    31 class MESMRCalDbMgr;
    30 
    32 
    31 /**
    33 /**
    32  *  CESMRRecurrenceInfoHandler is responsible for handling recurrence related
    34  *  CESMRRecurrenceInfoHandler is responsible for handling recurrence related
    33  *  issues.
    35  *  issues.
    34  *
    36  *
    41     /**
    43     /**
    42      * Two-phased constructor. Creates and initializes
    44      * Two-phased constructor. Creates and initializes
    43      * CESMRRecurrenceInfoHandler object. Ownership transferred to caller.
    45      * CESMRRecurrenceInfoHandler object. Ownership transferred to caller.
    44      *
    46      *
    45      * @param aEntry Reference to calendar entry.
    47      * @param aEntry Reference to calendar entry.
       
    48      * @param aCalDb Reference to caldb manager
    46      * @return Pointer to esmr recurrence handler object.
    49      * @return Pointer to esmr recurrence handler object.
    47      */
    50      */
    48     IMPORT_C static CESMRRecurrenceInfoHandler* NewL(
    51     IMPORT_C static CESMRRecurrenceInfoHandler* NewL(
    49             CCalEntry& aEntry );
    52             CCalEntry& aEntry );
    50 
    53 
    52      * Two-phased constructor. Creates and initializes
    55      * Two-phased constructor. Creates and initializes
    53      * CESMRRecurrenceInfoHandler object. Ownership transferred to caller.
    56      * CESMRRecurrenceInfoHandler object. Ownership transferred to caller.
    54      * Created object is left to cleanup stack.
    57      * Created object is left to cleanup stack.
    55      *
    58      *
    56      * @param aEntry Reference to calendar entry.
    59      * @param aEntry Reference to calendar entry.
       
    60      * @param aCalDb Pointer to caldb manager. Ownership not transferred.
       
    61      * @return Pointer to esmr recurrence handler object.
       
    62      */
       
    63     IMPORT_C static CESMRRecurrenceInfoHandler* NewL(
       
    64             CCalEntry& aEntry,
       
    65             MESMRCalDbMgr* aCalDb );
       
    66 
       
    67     /**
       
    68      * Two-phased constructor. Creates and initializes
       
    69      * CESMRRecurrenceInfoHandler object. Ownership transferred to caller.
       
    70      *
       
    71      * @param aEntry Reference to calendar entry.
       
    72      * @param aCalDb Reference to caldb manager
    57      * @return Pointer to esmr recurrence handler object.
    73      * @return Pointer to esmr recurrence handler object.
    58      */
    74      */
    59     IMPORT_C static CESMRRecurrenceInfoHandler* NewLC(
    75     IMPORT_C static CESMRRecurrenceInfoHandler* NewLC(
    60             CCalEntry& aEntry );
    76             CCalEntry& aEntry );
    61 
    77 
       
    78     /**
       
    79      * Two-phased constructor. Creates and initializes
       
    80      * CESMRRecurrenceInfoHandler object. Ownership transferred to caller.
       
    81      * Created object is left to cleanup stack.
       
    82      *
       
    83      * @param aEntry Reference to calendar entry.
       
    84      * @param aCalDb Reference to caldb manager
       
    85      * @return Pointer to esmr recurrence handler object.
       
    86      */
       
    87     IMPORT_C static CESMRRecurrenceInfoHandler* NewLC(
       
    88             CCalEntry& aEntry,
       
    89             MESMRCalDbMgr* aCalDb );    
       
    90     
    62     /**
    91     /**
    63      * C++ Destructor.
    92      * C++ Destructor.
    64      */
    93      */
    65     IMPORT_C ~CESMRRecurrenceInfoHandler();
    94     IMPORT_C ~CESMRRecurrenceInfoHandler();
    66 
    95 
   127      * @param aEnd Reference to end time.
   156      * @param aEnd Reference to end time.
   128      */
   157      */
   129     IMPORT_C void GetFirstInstanceTimeL(
   158     IMPORT_C void GetFirstInstanceTimeL(
   130             TCalTime& aStart,
   159             TCalTime& aStart,
   131             TCalTime& aEnd );
   160             TCalTime& aEnd );
       
   161     
       
   162     /**
       
   163      * Gets the start and end times of the previous instance.
       
   164      * @param aStart Reference to start time.
       
   165      * @param aEnd Reference to end time.
       
   166      */
       
   167     IMPORT_C void GetPreviousInstanceTimeL( TCalTime& aPreviousStartTime,
       
   168                                             TCalTime& aPreviousEndTime,
       
   169                                             TTime aInstanceDateTime );
       
   170     
       
   171     /**
       
   172      * Gets the start and end times of the next instance.
       
   173      * @param aStart Reference to start time.
       
   174      * @param aEnd Reference to end time.
       
   175      */
       
   176     IMPORT_C void GetNextInstanceTimeL( TCalTime& aNextStartTime,
       
   177                                         TCalTime& aNextEndTime,
       
   178                                         TTime aInstanceDateTime );
   132 
   179 
   133 private: // Implementation
   180 private: // Implementation
   134     CESMRRecurrenceInfoHandler(
   181     CESMRRecurrenceInfoHandler(
   135             CCalEntry& aEntry );
   182             CCalEntry& aEntry,
       
   183             MESMRCalDbMgr* aCalDb );
   136     void ConstructL();
   184     void ConstructL();
   137 
   185 
   138     void CalculateRecurrenceUntilDateL(
   186     void CalculateRecurrenceUntilDateL(
   139             TESMRRecurrenceValue aRecurrenceType,
   187             TESMRRecurrenceValue aRecurrenceType,
   140             TTime& aUntil,
   188             TTime& aUntil,
   158             TCalRRule& aRule ) const;
   206             TCalRRule& aRule ) const;
   159 
   207 
   160     TBool NeedToSetRecurrenceL(
   208     TBool NeedToSetRecurrenceL(
   161             TESMRRecurrenceValue aRecurrence,
   209             TESMRRecurrenceValue aRecurrence,
   162             TTime aUntil ) const;
   210             TTime aUntil ) const;
       
   211     
       
   212     TTime GetPreviousInstanceForRepeatOtherL(
       
   213             CCalEntry& aEntry,
       
   214             const CalCommon::TCalTimeRange& timeRange );
       
   215     
       
   216     TTime GetNextInstanceForRepeatOtherL( 
       
   217             CCalEntry& aEntry,
       
   218             const CalCommon::TCalTimeRange& timeRange );
       
   219     
       
   220     TESMRRecurrenceValue RepeatIndexL( const CCalEntry& aEntry );
       
   221     
   163 
   222 
   164 
   223 
   165 private:
   224 private:
   166     /// Ref: Reference to meeting request entry
   225     /// Ref: Reference to meeting request entry
   167     CCalEntry& iEntry;
   226     CCalEntry& iEntry;
       
   227     /// Ref: Reference to caldb manager
       
   228     MESMRCalDbMgr* iCalDb;
   168     };
   229     };
   169 
   230 
   170 #endif // CESMRRECURRENCEINFOHANDLER_H
   231 #endif // CESMRRECURRENCEINFOHANDLER_H
   171 
   232 
   172 // EOF
   233 // EOF