javaextensions/pim/common/inc.s60/mpimrepeatruledata.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:  Access interface to RepeatRule data representation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPIMREPEATRULEDATA_H
       
    20 #define MPIMREPEATRULEDATA_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "pimcommon.h"
       
    25 #include "pimrepeatrule.h"
       
    26 
       
    27 //  FORWARD DECLARATIONS
       
    28 class MPIMItemData;
       
    29 
       
    30 /**
       
    31  *  Interface for accessing the repeat rule data associated with an item.
       
    32  *  See \ref MPIMEventItemData class.
       
    33  */
       
    34 class MPIMRepeatRuleData
       
    35 {
       
    36 public:
       
    37     // Destructor
       
    38 
       
    39     /**
       
    40      * Destructor.
       
    41      */
       
    42     virtual ~MPIMRepeatRuleData()
       
    43     {
       
    44     }
       
    45 
       
    46 public:
       
    47     // New functions
       
    48 
       
    49     /**
       
    50      * Add an exception date. If the date has a time portion, it is ignored
       
    51      * and also cleared when the item is committed to the Agenda Model.
       
    52      * Note that even it is possible to set an exception date that
       
    53      * is outside the agenda model's valid date range
       
    54      * (from 1st January 1980 to 31st December 2100), when committing an
       
    55      * item with such a repeat rule into the agenda model those non-valid
       
    56      * exception dates are discarded.
       
    57      *
       
    58      * @param aDate Exception date.
       
    59      *
       
    60      * @par Leaving:
       
    61      * The method leaves on error. Error codes should be interpreted as
       
    62      * follows:
       
    63      * @li Any - The date could not be added.
       
    64      */
       
    65     virtual void AddExceptDateL(TPIMDate aDate) = 0;
       
    66 
       
    67     /**
       
    68      * Remove an exception date.
       
    69      *
       
    70      * @param aDate Exception date.
       
    71      *
       
    72      * @par Leaving:
       
    73      * The method leaves on error. Error codes should be interpreted as
       
    74      * follows:
       
    75      * @li Any - The date could not be removed.
       
    76      */
       
    77     virtual void RemoveExceptDate(TPIMDate aDate) = 0;
       
    78 
       
    79     /**
       
    80      * Provides all exception dates set for this repeat rule.
       
    81      * The ownership of the array stays with the repeat rule.
       
    82      *
       
    83      * @return Array of exception dates.
       
    84      *
       
    85      * @par Leaving:
       
    86      * The method leaves on error. Error codes should be interpreted as
       
    87      * follows:
       
    88      * @li Any - The array could not be created.
       
    89      */
       
    90     virtual const CArrayFix<TPIMDate>& GetExceptDatesL() const = 0;
       
    91 
       
    92     /**
       
    93      * Gets the value in an integer field.
       
    94      *
       
    95      * @param aField The field.
       
    96      *
       
    97      * @return Integer value in \a aField.
       
    98      *
       
    99      * @par Leaving:
       
   100      * The method leaves on error. Error codes should be interpreted as
       
   101      * follows:
       
   102      * @li \c KErrArgument - \a aField is not valid.
       
   103      * @li \c KErrNotFound - \a aField has no value.
       
   104      */
       
   105     virtual TInt GetIntL(TPIMField aField) const = 0;
       
   106 
       
   107     /**
       
   108      * Sets the value of an integer field.
       
   109      *
       
   110      * @param aField The field.
       
   111      * @param aValue The value to be set for \a aField.
       
   112      *
       
   113      * @par Leaving:
       
   114      * The method leaves on error. Error codes should be interpreted as
       
   115      * follows:
       
   116      * @li \c KErrArgument - \a aField is not valid.
       
   117      * @li \c KErrTooBig - \a aValue is not valid for the field.
       
   118      * @li Other - The value could not be set.
       
   119      */
       
   120     virtual void SetIntL(TPIMField aField, TInt aValue) = 0;
       
   121 
       
   122     /**
       
   123      * Gets the value of a date field.
       
   124      *
       
   125      * @param aField The field.
       
   126      *
       
   127      * @return Date value in \a aField.
       
   128      *
       
   129      * @par Leaving:
       
   130      * The method leaves on error. Error codes should be interpreted as
       
   131      * follows:
       
   132      * @li \c KErrArgument - \a aField is not valid.
       
   133      * @li \c KErrNotFound - \a aField has no value.
       
   134      */
       
   135     virtual TPIMDate GetDateL(TPIMField aField) const = 0;
       
   136 
       
   137     /**
       
   138      * Sets the value of a date field.
       
   139      * Note that the given dates have to be in the agenda model's valid
       
   140      * date range (from 1st January 1980 to 31st December 2100).
       
   141      *
       
   142      * @param aField The field.
       
   143      * @param aDate The value to be set for \a aField.
       
   144      *
       
   145      * @par Leaving:
       
   146      * The method leaves on error. Error codes should be interpreted as
       
   147      * follows:
       
   148      * @li \c KErrArgument - \a aField is not valid.
       
   149      * @li \c KErrTooBig - \a aValue is not valid for the field.
       
   150      * @li Other - The value could not be set.
       
   151      */
       
   152     virtual void SetDateL(TPIMField aField, TPIMDate aDate) = 0;
       
   153 
       
   154     /**
       
   155      * Provides an array of fields currently in use.
       
   156      * The ownership of the array is transferred to the caller.
       
   157      *
       
   158      * @return An array of fields.
       
   159      * The \b ownership of the array is transferred to the caller.
       
   160      *
       
   161      * @par Leaving:
       
   162      * The method leaves on error. Error codes should be interpreted as
       
   163      * follows:
       
   164      * @li Any - The array could not be created.
       
   165      */
       
   166     virtual CArrayFix<TPIMField>* GetFieldsL() const = 0;
       
   167 
       
   168     /**
       
   169      * Clears a field. The value in that field is discarded.
       
   170      *
       
   171      * @param aField The field.
       
   172      *
       
   173      * @par Leaving:
       
   174      * The method leaves on error. Error codes should be interpreted as
       
   175      * follows:
       
   176      * @li \c KErrArgument - \a aField is not valid.
       
   177      */
       
   178     virtual void ClearFieldL(TPIMField aField) = 0;
       
   179 
       
   180     /**
       
   181      * Clears all fields. The values in all fields are discarded.
       
   182      */
       
   183     virtual void clear() = 0;
       
   184 
       
   185     /**
       
   186      * Copies all the fields from the Agenda model's Repeat definition.
       
   187      */
       
   188     virtual void BackupRepeatL() = 0;
       
   189 
       
   190     /**
       
   191      * Checks if the Repeat rule has been changed or not.
       
   192      */
       
   193     virtual TBool IsModified() const = 0;
       
   194 
       
   195 protected:
       
   196     // Non-public operations
       
   197 
       
   198     // Allow derivation with protected default constructor.
       
   199     MPIMRepeatRuleData()
       
   200     {
       
   201     }
       
   202 
       
   203 private:
       
   204     // Prohibited operations
       
   205     // Prohibit copy constructor.
       
   206     MPIMRepeatRuleData(const MPIMRepeatRuleData&)
       
   207     {
       
   208     }
       
   209 
       
   210     // Prohibit assigment operator.
       
   211     MPIMRepeatRuleData& operator=(const MPIMRepeatRuleData&)
       
   212     {
       
   213         return *this;
       
   214     }
       
   215 
       
   216 };
       
   217 
       
   218 #endif // MPIMREPEATRULEDATA_H
       
   219 // End of File