meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmralarmfield.h
changeset 0 8466d47a6819
child 12 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 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 Alarm field implementation
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRALARMFIELD_H
       
    20 #define CESMRALARMFIELD_H
       
    21 
       
    22 #include "cesmriconfield.h"
       
    23 
       
    24 class CEikLabel;
       
    25 class CESMRAlarm;
       
    26 class MESMRFieldValidator;
       
    27 
       
    28 /**
       
    29  * Alarm field defines the time before the meeting when
       
    30  * alarm should be showed. User can traverse between the
       
    31  * different alarm values by pressing left/right keys or
       
    32  * open a dialog by pressing ok button.
       
    33  *
       
    34  * @see cesmralarm.h
       
    35  */
       
    36 NONSHARABLE_CLASS( CESMRAlarmField ) : public CESMRIconField
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * Two phase constructor.
       
    41      */
       
    42     static CESMRAlarmField* NewL( MESMRFieldValidator* aValidator );
       
    43 
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     ~CESMRAlarmField();
       
    48 
       
    49 public: // From CESMRField
       
    50     void InitializeL();
       
    51     void InternalizeL( MESMRCalEntry& aEntry );
       
    52     void ExternalizeL( MESMRCalEntry& aEntry );
       
    53     void SetOutlineFocusL( TBool aFocus );
       
    54     TBool OkToLoseFocusL( TESMREntryFieldId aId );
       
    55     void ExecuteGenericCommandL( TInt aCommand );
       
    56 
       
    57 public: // From CCoeControl
       
    58     TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
       
    59 
       
    60 private:
       
    61     /**
       
    62      * Constructor
       
    63      */
       
    64     CESMRAlarmField( MESMRFieldValidator* aValidator );
       
    65 
       
    66     /**
       
    67      * Second phase constructor
       
    68      */
       
    69     void ConstructL();
       
    70 
       
    71     /**
       
    72      * Updates new alarm time
       
    73      *
       
    74      * @param aIndex new alarm time index
       
    75      */
       
    76     void UpdateAlarmLabelL( TInt aIndex );
       
    77 
       
    78     /**
       
    79      * Updates alarm to first valid value, when
       
    80      * alarm has been set to past by user
       
    81      */
       
    82     void UpdateAlarmToFirstValidValueL();
       
    83 
       
    84     /**
       
    85      * Handles alarm time settings query
       
    86      */
       
    87     void DoAlarmTimeQueryL();
       
    88 
       
    89     /**
       
    90      * Triggers validator to validate alarm
       
    91      */
       
    92     TBool TriggerValidatorL();
       
    93 
       
    94     /**
       
    95       * Handles MSK command execution
       
    96       */
       
    97     void ExecuteMSKCommandL();
       
    98 
       
    99 private:
       
   100     /**
       
   101      *  Not own: Label for current alarm value
       
   102      */
       
   103     CEikLabel* iAlarm;
       
   104 
       
   105     /**
       
   106      * Own: List of CESMRAlarm objects
       
   107      */
       
   108     RPointerArray< CESMRAlarm > iArray;
       
   109 
       
   110     /**
       
   111      * Index pointing to iArray.
       
   112      */
       
   113     TInt iOptIndex;
       
   114 
       
   115     /**
       
   116      * Not owned. Validator class for time and sanity checks.
       
   117      */
       
   118     MESMRFieldValidator* iValidator;
       
   119 
       
   120     /**
       
   121      * Own: Relative alarm validity
       
   122      */
       
   123     TBool iRelativeAlarmValid;
       
   124     };
       
   125 
       
   126 #endif  //CESMRALARMFIELD_H
       
   127