javaextensions/pim/framework/inc.s60/cpimrepeatrule.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 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:  PIM item repeat rule implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPIMREPEATRULE_H
       
    20 #define CPIMREPEATRULE_H
       
    21 
       
    22 // INTERNAL INCLUDES
       
    23 #include "mpimrepeatruledata.h"
       
    24 #include "pimbaserepeatrule.h"
       
    25 
       
    26 // EXTERNAL INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 /**
       
    30  *  Event RepeatRule implementation. The class is a container for repeat rule
       
    31  *  data.
       
    32  */
       
    33 NONSHARABLE_CLASS(CPIMRepeatRule): public CBase,
       
    34         public pimbaserepeatrule,
       
    35         public MPIMRepeatRuleData
       
    36 {
       
    37 public: // Constructors and destructor
       
    38 
       
    39     /**
       
    40      * Two-phased constructor.
       
    41      */
       
    42     static CPIMRepeatRule* NewL();
       
    43 
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     virtual ~CPIMRepeatRule();
       
    48 
       
    49 public: // New functions
       
    50 
       
    51     /**
       
    52      * Provides dates on which this repeat rule will occur. Exception
       
    53      * dates will be noted.
       
    54      * Note that the given dates have to be in the agenda model's valid
       
    55      * date range (from 1st January 1980 to 31st December 2100).
       
    56      * The ownership of the array is transferred to the caller.
       
    57      *
       
    58      * @param aStartDate Anchor point for calculating occurrences.
       
    59      * @param aSubsetBeginning Beginning of a subset of occurrences.
       
    60      * @param aSubsetEnding Ending of a subset of occurrences.
       
    61      *
       
    62      * @return Array of dates.
       
    63      */
       
    64     CArrayFixFlat< TPIMDate>* DatesL(
       
    65         const TPIMDate& aStartDate,
       
    66         const TPIMDate& aSubsetBeginning,
       
    67         const TPIMDate& aSubsetEnding) const;
       
    68 
       
    69     jintArray dates(
       
    70         jlong aStartDate,
       
    71         jlong aSubsetBeginning,
       
    72         jlong aSubsetEnding,
       
    73         JNIEnv* aJniEnv);
       
    74 
       
    75 public: // Functions from MPIMRepeatRuleData
       
    76 
       
    77     void AddExceptDateL(TPIMDate aDate);
       
    78 
       
    79     void addExceptDate(jlong aValue);
       
    80 
       
    81     void RemoveExceptDate(TPIMDate aDate);
       
    82 
       
    83     void removeExceptDate(jlong aValue);
       
    84 
       
    85     const CArrayFix< TPIMDate>& GetExceptDatesL() const;
       
    86 
       
    87     jintArray getExceptDates(JNIEnv* aJniEnv);
       
    88 
       
    89     TInt GetIntL(TPIMField aField) const;
       
    90 
       
    91     int getRepeatInt(TPIMField aField);
       
    92 
       
    93     void SetIntL(TPIMField aField, TInt aValue);
       
    94 
       
    95     void setRepeatInt(TPIMField aField, int aValue);
       
    96 
       
    97     TPIMDate GetDateL(TPIMField aField) const;
       
    98 
       
    99     jlong getRepeatDate(TPIMField aField);
       
   100 
       
   101     void SetDateL(TPIMField aField, TPIMDate aDate);
       
   102 
       
   103     void setDate(TPIMField aField, jlong aValue);
       
   104 
       
   105     CArrayFix< TPIMField>* GetFieldsL() const;
       
   106 
       
   107     jintArray getFields(JNIEnv* aJniEnv);
       
   108 
       
   109     void ClearFieldL(TPIMField aField);
       
   110 
       
   111     void clear();
       
   112 
       
   113     void BackupRepeatL();
       
   114 
       
   115     TBool IsModified() const;
       
   116 
       
   117 private:
       
   118 
       
   119     /**
       
   120      * C++ default constructor.
       
   121      */
       
   122     CPIMRepeatRule();
       
   123 
       
   124     /**
       
   125      * By default Symbian 2nd phase constructor is private.
       
   126      */
       
   127     void ConstructL();
       
   128 
       
   129 private: // Data
       
   130 
       
   131     CArrayFixFlat< TPIMDate>* iExceptDates; // Array of exception dates,
       
   132     // Owned by RepeatRule
       
   133     // The repeat rule fields supported by Nokia
       
   134     TPIMField iRepeatRuleFrequency;
       
   135     TPIMField iRepeatRuleInterval;
       
   136     TPIMDate iRepeatRuleEndDate;
       
   137 
       
   138     // The rest of the repeat rule fields
       
   139     TPIMField iRepeatRuleDayInMonth;
       
   140     TPIMField iRepeatRuleDayInWeek;
       
   141     TPIMField iRepeatRuleDayInYear;
       
   142     TPIMField iRepeatRuleMonthInYear;
       
   143     TPIMField iRepeatRuleWeekInMonth;
       
   144     TPIMField iRepeatRuleCount;
       
   145 
       
   146     // The following fields are used for storing the original Agenda values
       
   147     CArrayFixFlat< TPIMDate>* iOriginalExceptDates; // Owned by RepeatRule
       
   148     TPIMField iOriginalRepeatRuleFrequency;
       
   149     TPIMField iOriginalRepeatRuleInterval;
       
   150     TPIMDate iOriginalRepeatRuleEndDate;
       
   151     TPIMField iOriginalRepeatRuleDayInMonth;
       
   152     TPIMField iOriginalRepeatRuleDayInWeek;
       
   153     TPIMField iOriginalRepeatRuleDayInYear;
       
   154     TPIMField iOriginalRepeatRuleMonthInYear;
       
   155     TPIMField iOriginalRepeatRuleWeekInMonth;
       
   156     TPIMField iOriginalRepeatRuleCount;
       
   157 };
       
   158 
       
   159 #endif // CPIMREPEATRULE_H
       
   160 // End of File