lafagnosticuifoundation/animation/tef/TestEventHandler.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 
       
    22 #include "TestEventHandler.h"
       
    23 #include "TestWindows.h"
       
    24 
       
    25 #include <w32std.h>
       
    26 
       
    27 CTestEventHandler::CTestEventHandler(RWsSession& aWs) : CActive(100),
       
    28 iWs(aWs)
       
    29 	{
       
    30 	}
       
    31 	
       
    32 CTestEventHandler::~CTestEventHandler()
       
    33 	{
       
    34 	Cancel();
       
    35 	}
       
    36 
       
    37 void CTestEventHandler::Start()
       
    38 	{
       
    39 	CActiveScheduler::Add(this);
       
    40 	iWs.EventReady(&iStatus);
       
    41 	SetActive();
       
    42 	}
       
    43 
       
    44 void CTestEventHandler::RunL()
       
    45 	{
       
    46 	TWsEvent event;
       
    47 	iWs.GetEvent(event);
       
    48 	
       
    49 	if (event.Handle())
       
    50 		{
       
    51 		reinterpret_cast<CTestWindowTreeNode *>(event.Handle())->EventL(event);
       
    52 		}
       
    53 
       
    54 	iWs.EventReady(&iStatus);
       
    55 	SetActive();
       
    56 	}
       
    57 
       
    58 void CTestEventHandler::DoCancel()
       
    59 	{
       
    60 	iWs.EventReadyCancel();
       
    61 	}
       
    62 
       
    63 TInt CTestEventHandler::RunError(TInt aError)
       
    64 	{
       
    65 	return(aError);
       
    66 	}
       
    67