meetingrequest/mrgui/inc/cesmrannivtimevalidator.h
changeset 0 8466d47a6819
child 16 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  ESMR time and date sanity checks and saving
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRANNIVTIMEVALIDATOR_H
       
    20 #define CESMRANNIVTIMEVALIDATOR_H
       
    21 
       
    22 //<cmail>
       
    23 #include "esmrdef.h"
       
    24 //</cmail>
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 #include "mesmrfieldvalidator.h"
       
    28 
       
    29 class MESMRCalEntry;
       
    30 class CEikTimeEditor;
       
    31 class CEikDateEditor;
       
    32 
       
    33 /**
       
    34  * Wrapper class handles sanity checks for date/time fields on Anniversary
       
    35  * Entry. For example start date can not be after end date.
       
    36  * this calss deals with the cheks for To-do option
       
    37  * InternalizeL() / ExternalizeL() is delegated to this class since those
       
    38  * need sanity checks. Fields (who use this wrapper class) shouldn't react
       
    39  * on ExternalizeL() functions since this wrapper class handles them. On
       
    40  * InternalizeL() they should attach their date/time editors in here.
       
    41  *
       
    42  * @lib esmrgui.lib
       
    43  */
       
    44 NONSHARABLE_CLASS( CESMRAnnivTimeValidator ):
       
    45         public CBase,
       
    46         public MESMRFieldValidator
       
    47     {
       
    48 public:
       
    49     /**
       
    50      * Two phase constructor.
       
    51      */
       
    52     static CESMRAnnivTimeValidator* NewL();
       
    53 
       
    54     /**
       
    55      * Destructor.
       
    56      */
       
    57     ~CESMRAnnivTimeValidator();
       
    58 
       
    59 public: // from MESMRFieldValidator
       
    60     MESMRFieldValidator::TESMRFieldValidatorError ValidateL(
       
    61             TBool aCorrectAutomatically );
       
    62     void ReadValuesFromEntryL(
       
    63             MESMRCalEntry& aEntry );
       
    64     void StoreValuesToEntryL(
       
    65             MESMRCalEntry& aEntry );
       
    66     void SetStartTimeFieldL(
       
    67             CEikTimeEditor& aStartTime );
       
    68     void SetEndTimeFieldL(
       
    69             CEikTimeEditor& aEndTime );
       
    70     void SetStartDateFieldL(
       
    71             CEikDateEditor& aStartDate );
       
    72     void SetEndDateFieldL(
       
    73             CEikDateEditor& aEndDate );
       
    74     void SetAlarmTimeFieldL(
       
    75             CEikTimeEditor& aAlarmTime );
       
    76     void SetAlarmDateFieldL(
       
    77             CEikDateEditor& aAlarmDate );
       
    78      void SetRecurrenceUntilDateFieldL(
       
    79                 CEikDateEditor& aRecurrenceUntil );
       
    80     void StartTimeChangedL();
       
    81     void EndTimeChangedL();
       
    82     void StartDateChandedL();
       
    83     void EndDateChangedL();
       
    84     void AlarmTimeChangedL();
       
    85     void AlarmDateChangedL();
       
    86     void RelativeAlarmChangedL(
       
    87             TTimeIntervalMinutes aCurrentAlarmTimeOffset,
       
    88             TBool aHandleAlarmChange,
       
    89             TBool& aRelativeAlarmValid );
       
    90     void SetAllDayEventL(
       
    91             TBool aAlldayEvent );
       
    92     void SetAlarmOnOffL(
       
    93             TBool aAlarmOn );
       
    94     void RecurrenceChangedL(
       
    95             TESMRRecurrenceValue aRecurrence );
       
    96     void RecurrenceEndDateChangedL();
       
    97     TBool IsRelativeAlarmValid(
       
    98             TTimeIntervalMinutes aAlarmTimeOffset );
       
    99 
       
   100 private: // Implementation
       
   101     CESMRAnnivTimeValidator();
       
   102     TInt PreValidateEditorContent();
       
   103     void PreValidateEditorContentL();
       
   104     void DrawEditorsDeferred();
       
   105     TDateTime StartTimeL();
       
   106     TDateTime AlarmTimeL();
       
   107     void ForceValuesL();
       
   108 
       
   109 private:
       
   110     /// Ref: Start date editor.
       
   111     CEikDateEditor* iStartDate;
       
   112     /// Ref: Alarm time editor
       
   113     CEikTimeEditor* iAlarmTime;
       
   114     /// Ref: Alarm date editor.
       
   115     CEikDateEditor* iAlarmDate;
       
   116     /// Own: Current anniversary date
       
   117     TTime iCurrentAnnivDate;
       
   118     /// Own: Current alarm time
       
   119     TTime iCurrentAlarmTime;
       
   120     /// Own: Flag for amarm on/off.
       
   121     TBool iAlarmOnOff;
       
   122     /// Ref: Entry being handled
       
   123     MESMRCalEntry* iEntry;
       
   124     };
       
   125 
       
   126 #endif  // CESMRANNIVTIMEVALIDATOR_H