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