mulwidgets/alfcontainerwidget/src/alfcontainercontrol.cpp
branchRCL_3
changeset 26 0e9bb658ef58
parent 0 e83bab7cf002
equal deleted inserted replaced
25:4ea6f81c838a 26:0e9bb658ef58
       
     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:  Container widget control class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Local Includes
       
    20 #include "../inc/alfcontainercontrol.h"
       
    21 
       
    22 // AlfClient Includes
       
    23 #include <alf/alfevent.h>
       
    24 
       
    25 // Widget Model
       
    26 #include <alf/alfwidgetevents.h>
       
    27 
       
    28 using namespace Alf;
       
    29 
       
    30 AlfContainerControl::AlfContainerControl(CAlfEnv& aEnv)
       
    31 	: CAlfWidgetControl(aEnv)
       
    32 	{
       
    33 	}
       
    34 
       
    35 AlfContainerControl::~AlfContainerControl()
       
    36 	{
       
    37 	}
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // From base class IAlfWidgetControl
       
    41 // Handles events sent to widget control.
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 AlfEventStatus AlfContainerControl::handleEvent( const TAlfEvent& aEvent )
       
    45 	{
       
    46 	AlfEventStatus ret = CAlfWidgetControl::handleEvent(aEvent);
       
    47 
       
    48     if(ret == EEventNotHandled && aEvent.IsKeyEvent())
       
    49 		{
       
    50 		if(aEvent.KeyEvent().iScanCode == EStdKeyRightArrow ||
       
    51 		   aEvent.KeyEvent().iScanCode == EStdKeyDownArrow )
       
    52 			{
       
    53 			if(aEvent.Code() == EEventKey)
       
    54 				{
       
    55 				TAlfEvent focusNext(EEventFocusNextWidget);
       
    56 				return CAlfWidgetControl::processEvent(focusNext);							
       
    57 				}
       
    58 			}
       
    59 	    else if(aEvent.KeyEvent().iScanCode == EStdKeyLeftArrow ||
       
    60 		        aEvent.KeyEvent().iScanCode == EStdKeyUpArrow)
       
    61 			{
       
    62 			if(aEvent.Code() == EEventKey)
       
    63 				{
       
    64 				TAlfEvent focusPrevious(EEventFocusPreviousWidget);
       
    65 				return CAlfWidgetControl::processEvent(focusPrevious);
       
    66 				}
       
    67 			}
       
    68 		}
       
    69 	
       
    70 	return ret;
       
    71 	}