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