emailservices/emailcommon/inc/mmrrecurrencerule.h
changeset 18 578830873419
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     1 /*
       
     2 * Copyright (c)  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:  MR organizer definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_MRRECURRENCERULE_H
       
    20 #define M_MRRECURRENCERULE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 //#include <mrinfodef.h>
       
    24 
       
    25 /**
       
    26  * MRRecurrenceRule defines meeting request recurrence rule.
       
    27  */
       
    28 class MRRecurrenceRule
       
    29     {
       
    30 public:
       
    31     enum TMRRecurrenceType
       
    32         {
       
    33         /** The type has not yet been defined */
       
    34         EMRRecurrenceInvalid,
       
    35         /** Rule which repeats based on a number of days. */
       
    36         EMRRecurrenceDaily,        
       
    37         /** Rule which repeats based on a number of weeks */
       
    38         EMRRecurrenceWeekly,
       
    39         /** Rule which repeats based on a number of months */
       
    40         EMRRecurrenceMonthly,
       
    41 	EMRRecurrenceMonthlyByDay,
       
    42         /** Rule which repeats based on a number of years */
       
    43         EMRRecurrenceYearly,
       
    44 	EMRRecurrenceYearlyByDay
       
    45         };
       
    46     
       
    47     /** Definition for recurrent day */
       
    48     enum TMRRecurrentDay
       
    49         {
       
    50         EMRRecurrenceMonday,
       
    51         EMRRecurrenceTuesday,
       
    52         EMRRecurrenceWednesday,
       
    53         EMRRecurrenceThursday,
       
    54         EMRRecurrenceFriday,
       
    55         EMRRecurrenceSaturday,
       
    56         EMRRecurrenceSunday
       
    57         };
       
    58     
       
    59     /** Definition for recurrent week */
       
    60     enum TMRRecurrenceWeek
       
    61         {
       
    62         EMRRecurrenceLastWeekOfMonth   = -1,
       
    63         EMRRecurrenceFirstWeekOfMonth  =  1,
       
    64         EMRRecurrenceSecondWeekOfMonth =  2,
       
    65         EMRRecurrenceThirdWeekOfMonth  =  3,
       
    66         EMRRecurrenceFourthWeekOfMonth =  4,
       
    67         };
       
    68     
       
    69     /** Definition for recurrence months */
       
    70     enum TMRRecurrenceMonth
       
    71         {
       
    72         EMRRecurrenceJanuary = 1,
       
    73         EMRRecurrenceFebryary,
       
    74         EMRRecurrenceMarch,
       
    75         EMRRecurrenceApril,
       
    76         EMRRecurrenceMay,
       
    77         EMRRecurrenceJune,
       
    78         EMRRecurrenceJuly,
       
    79         EMRRecurrenceAugust,
       
    80         EMRRecurrenceSeptember,
       
    81         EMRRecurrenceOctober,
       
    82         EMRRecurrenceNovember,
       
    83         EMRRecurrenceDecember
       
    84         };
       
    85     
       
    86     /**
       
    87      * Definition to represent a weekday within a month.
       
    88      *
       
    89      * Valid values of iWeekInMonth are defined in enumeration 
       
    90      * TMRRecurrenceWeek. Valid values for iDayOfWeek are defined in 
       
    91      * enumeration TMRRecurrentDay.
       
    92      *
       
    93      * Example 1: The 3rd Wednesday would have iDay = EMRRecurrenceWednesday
       
    94      * and iWeekInMonth = EMRRecurrenceThirdWeekOfMonth. 
       
    95      *
       
    96      * Example 2: The last Sunday would have iDay = EMRRecurrenceSunday and 
       
    97      * iWeekInMonth = EMRRecurrenceLastWeekOfMonth.
       
    98      */
       
    99     struct TRecurrentDaysofMonth
       
   100         {
       
   101         TMRRecurrenceWeek iWeekOfMonth;
       
   102         TMRRecurrentDay   iDayOfWeek;
       
   103         };
       
   104     
       
   105 public: // Destruction
       
   106 
       
   107     /**
       
   108      * Virtual destructor.
       
   109      */
       
   110     virtual ~MRRecurrenceRule()  { }
       
   111 
       
   112 public: // Interface
       
   113 
       
   114     /**
       
   115      * Sets recurrence type. Calling this method will clear the 
       
   116      * previously set recurrence rules.
       
   117      * @param aType Recurrence rule type.
       
   118      * @exception System wide error code.
       
   119      */
       
   120     virtual void SetRecurrenceTypeL( TMRRecurrenceType aType ) = 0;
       
   121 
       
   122     /** 
       
   123      * Fetches recurrence type.
       
   124      * @return recurrence type.
       
   125      */
       
   126     virtual TMRRecurrenceType Type() const = 0;
       
   127 
       
   128     /**
       
   129      * Sets the recurrence start time.
       
   130      * @param aStartTime Recurrence start time as utc.
       
   131      * @return System wide error code.
       
   132      */
       
   133     virtual void SetRecurrenceStartTimeL( TTime aStartTime ) = 0;
       
   134 
       
   135     /**
       
   136      * Fetches the recurrence start time.
       
   137      * Time information is returned in utc.
       
   138      * @return recurrence start time as utc.
       
   139      */
       
   140     virtual TTime RecurrenceStartTime() const = 0;
       
   141 
       
   142     /**
       
   143      * Sets the recurrence until time.
       
   144      * @param aStartTime Recurrence until time in utc.
       
   145      * @return System wide error code.
       
   146      */
       
   147     virtual void SetRecurrenceUntilL( TTime aStartTime ) = 0;
       
   148 
       
   149     /**
       
   150      * Fetches the date on which this repeat rule finishes.
       
   151      * Time information is returned in utc.
       
   152      * @return The end time in utc.
       
   153      */
       
   154     virtual TTime RecurrentUntil() const = 0;
       
   155     
       
   156     /**
       
   157      * Sets recurrent rule interval.
       
   158      * @param aInterval Recurrent rule interval.
       
   159      * @exception Normal system wide error code.
       
   160      */
       
   161     virtual void SetRecurrentInterval( TInt aInterval ) = 0;
       
   162     
       
   163     /**
       
   164      * Fetches the recurrent interval.
       
   165      * Interval is a number of days for a daily repeat, a number of weeks for 
       
   166      * a weekly repeat, etc.
       
   167      * @return recurrent interval.
       
   168      */
       
   169     virtual TInt RecurrentInterval() const = 0;
       
   170     
       
   171     /**
       
   172      * Sets recurrent count.
       
   173      * @param aCount
       
   174      * @exception Normal system wide error code.
       
   175      */  
       
   176     virtual void SetRecurrentCountL( TInt aCount ) = 0;
       
   177     
       
   178     /**
       
   179      * Fetches the number of recurrences.
       
   180      * @return Number of recurreces.
       
   181      */
       
   182     virtual TUint RecurrentCount() const = 0;
       
   183     
       
   184     /**
       
   185      * Sets the all weekdays on which this rule is repeated.
       
   186      * Calling this method has no effect if recurrence rule type is not
       
   187      * weekly.
       
   188      * @param aDays Recurrence rule weekly days.
       
   189      * @exception Normal system wide error code.
       
   190      */
       
   191     virtual void SetRecurrentWeekDaysL( RArray<TMRRecurrentDay>& aDays ) = 0;
       
   192     
       
   193     /**
       
   194      * Fetches all weekdays on which this rule is repeated.
       
   195      * The returned array is empty if this is not a weekly recurrence.
       
   196      * @return Recurrent weekly days.
       
   197      */
       
   198     virtual const RArray<TMRRecurrentDay>& RecurrentWeekDays() const = 0;
       
   199     
       
   200     /**
       
   201      * Sets the days in the month on which this rule is repeated.
       
   202      * Calling this method has no effect if recurrence rule type is not
       
   203      * monthly or yearly.
       
   204      * @param aDays Days in the month on which this rule is repeated.
       
   205      * @exception Normal system wide error code.
       
   206      */
       
   207     virtual void SetRecurrentMonthDaysL( RArray<TInt>& aDays ) = 0;
       
   208     
       
   209     /**
       
   210      * Fetches all days in the month on which this rule is repeated.
       
   211      * The returned array is empty if this is not a monthly or yearly recurrence.
       
   212      * @return Days in the month on which this rule is repeated.
       
   213      */
       
   214     virtual const RArray<TInt>& RecurrentMonthDays() const = 0;
       
   215 
       
   216 	virtual void SetRecurrentDaysofMonthL( RArray<TRecurrentDaysofMonth>& aDays ) = 0;
       
   217 		
       
   218 	virtual const RArray<TRecurrentDaysofMonth>& RecurrentDaysofMonth() const = 0;
       
   219 
       
   220     /**
       
   221      * Sets the months of the year for this repeat rule.
       
   222      * Calling this method has no effect if recurrence rule type is not
       
   223      * yearly.
       
   224      * @param aMonths Months of the year for this repeat rule.
       
   225      * @exception Normal system wide error code.
       
   226      */
       
   227     virtual void SetRecurrentMonthsL( RArray<TMRRecurrenceMonth>& aMonths ) = 0;
       
   228     
       
   229     /**
       
   230      * Fetches the months of the year for this repeat rule. 
       
   231      * This function will do nothing if this is not a yearly repeat rule.
       
   232      * @return Months of the year for this repeat rule. 
       
   233      */
       
   234     virtual const RArray<TMRRecurrenceMonth>& RecurrentMonths() const = 0;
       
   235     };
       
   236 
       
   237 
       
   238 #endif // M_MRRECURRENCERULE_H
       
   239