meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtimefield.h
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtimefield.h	Mon Mar 15 12:39:10 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtimefield.h	Wed Mar 31 21:08:33 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -19,20 +19,20 @@
 #ifndef CESMRTIMEFIELD_H
 #define CESMRTIMEFIELD_H
 
-#include "cesmriconfield.h"
+// INCLUDES
+#include "cesmrfield.h"
 
 //Forward declarations
-class CEikLabel;
-class CTimeContainer;
+class CMRImage;
+class CMRTimeContainer;
 class MESMRFieldValidator;
-class CEikTimeEditor;
 
 /**
  * Time field for ESMR editor. Time field has start and end time
  * separated by a '-'. Focus traverses from left to right and right
  * to left.
  */
-NONSHARABLE_CLASS( CESMRTimeField ): public CESMRIconField
+NONSHARABLE_CLASS( CESMRTimeField ): public CESMRField
     {
 public:
     /**
@@ -51,12 +51,16 @@
 public: // From CCoeControl
     void SetContainerWindowL( const CCoeControl& aControl );
     TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl( TInt aIndex ) const;
+    void SizeChanged();
 
 public: // From ESMRField
-    void InitializeL();
     TBool OkToLoseFocusL( TESMREntryFieldId aNext );
     void SetOutlineFocusL( TBool aFocus );
-
+    void SetValidatorL( MESMRFieldValidator* aValidator );
+    TBool ExecuteGenericCommandL( TInt aCommand );
+    
 private:
     /**
      * Constructor.
@@ -72,147 +76,13 @@
 
 private:
     /**
-     * Own. Container for the time fields.
-     */
-    CTimeContainer* iContainer;
-    };
-
-
-//Forward declarations
-class MAknsControlContext;
-class CAknsFrameBackgroundControlContext;
-
-/**
- * Container control for the time fields and the separator.
- */
-NONSHARABLE_CLASS( CTimeContainer ): public CCoeControl
-    {
-
-public:
-    /**
-     * Creates new CTimeContainer object. Ownership
-     * is transferred to caller.
-     * @param aValidator validator object
-     * @param aParent parent control
-     * @param aFieldId CESMRField id of the control/container
-     * @return Pointer to created object,
-     */
-    static CTimeContainer* NewL(
-            MESMRFieldValidator* aValidator,
-            CCoeControl* aParent,
-            TESMREntryFieldId aFieldId );
-
-    /**
-     * Destructor.
-     */
-    ~CTimeContainer();
-
-public: // From CCoeControl
-    void SetContainerWindowL( const CCoeControl& aControl );
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl( TInt aInd ) const;
-    void SizeChanged();
-    TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
-    void FocusChanged(TDrawNow aDrawNow);
-    void ActivateL();
-    void PositionChanged();
-
-public: // interface
-    /**
-     * Sets font and font color for editors.
-     *
-     * @param aFont new font
-     * @param aLayout pointer to layoutmanager
-     */
-    void SetFontL( const CFont* aFont, CESMRLayoutManager* aLayout );
-
-    /**
-     * Returns currently focused editor.
-     *
-     * @return currently focused editor
-     */
-    CEikTimeEditor* FocusedEditor();
-
-    /**
-     * Returns ETrue if its ok to change focus.
-     *
-     * @param current field id
-     * @param next field id
-     * @return ETrue if its ok to change focus
+     * Ref: Container for the time fields. 
+     *  Created by this class but deleted by base class.  
      */
-    TBool OkToLoseFocusL( TESMREntryFieldId aFrom, TESMREntryFieldId aTo );
-
-private: // Implementation
-    /**
-     * Constructor.
-     *
-     * @param aValidator validator object
-     */
-    CTimeContainer( MESMRFieldValidator* aValidator, TESMREntryFieldId aFieldId );
-
-    /**
-     * Second phase constructor.
-     *
-     * @param aParent parent control
-     */
-    void ConstructL( CCoeControl* aParent );
-
-    /**
-     * Changes focus to left if its possible.
-     *
-     * @param aEvent key event
-     * @param aType event code
-     */
-    TKeyResponse ChangeFocusLeftL(const TKeyEvent& aEvent, TEventCode aType);
-
-    /**
-     * Changes focus to right if its possible.
-     *
-     * @param aEvent key event
-     * @param aType event code
-     */
-    TKeyResponse ChangeFocusRightL(const TKeyEvent& aEvent, TEventCode aType);
-
-    void CheckIfValidatingNeededL(
-            TBool aStartFocusedBefore,
-            TInt aStartFieldIndex,
-            TBool aEndFocusedBefore,
-            TInt aEndFieldIndex );
-
-    void TriggerStartTimeChangedL();
-    void TriggerEndTimeChangedL();
-
-private: // data 
-    /**
-     * Own. Start time editor.
-     */
-    CEikTimeEditor* iStartTime;
-
-    /**
-     * Own. End time editor.
-     */
-    CEikTimeEditor* iEndTime;
-
-    /**
-     * Own. Separator label between start and end fields.
-     */
-    CEikLabel* iSeparator;
-
-    /**
-     * Not owned. Validator class for time and sanity checks.
-     */
+    CMRTimeContainer* iContainer;
     
-    MESMRFieldValidator* iValidator;
-    // Own: Field Id
-    TESMREntryFieldId iFieldId;
-    // Background control context
-    MAknsControlContext* iBackground;
-    // Actual background for the start time editor
-    CAknsFrameBackgroundControlContext* iStartTimeBgContext;
-    // Actual background for the end time editor
-    CAknsFrameBackgroundControlContext* iEndTimeBgContext;
-    // Not owned. Layout manager.
-    CESMRLayoutManager* iLayout;
+    /// Own: Field icon
+    CMRImage* iFieldIcon;
     };
 
 #endif  // CESMRTIMEFIELD_H