idlefw/tsrc/wsplugin/stub/testeventhandler_stub.h
branchRCL_3
changeset 28 053c6c7c14f3
equal deleted inserted replaced
27:2c7f27287390 28:053c6c7c14f3
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 // testeventhandler.h
       
    19 
       
    20 #ifndef _TESTEVENTHANDLER_STUB_H
       
    21 #define _TESTEVENTHANDLER_STUB_H
       
    22 
       
    23 #include "eventhandler.h"
       
    24 #include <e32event.h>
       
    25 
       
    26 namespace T_AiWsPlugin {
       
    27 
       
    28 using AiWsPlugin::MUiState;
       
    29 
       
    30 /**
       
    31  * Common test event handler base for AiWsPlugin unit tests. 
       
    32  */
       
    33 class CTestEventHandler : 
       
    34         public AiWsPlugin::CEventHandler
       
    35     {
       
    36 public:
       
    37     ~CTestEventHandler();
       
    38 
       
    39 public:  // Testing functions
       
    40     MUiState* UiState() const          { return iUiState; }
       
    41     TBool Focus() const                { return iFocus;   }
       
    42     const TRawEvent& LastEvent() const { return iLastEvent; }
       
    43     void ResetLastEvent();
       
    44     void RespondToEvent( const TRawEvent& aEvent );
       
    45 
       
    46 private:
       
    47 // from base class CEventHandler
       
    48     void SetUiStateQuery( MUiState& aUiState );
       
    49     void FocusChanged( TBool aState );
       
    50     TBool OfferRawEvent(const TRawEvent& aRawEvent);
       
    51 
       
    52 protected:
       
    53     CTestEventHandler();
       
    54 
       
    55 private: // data
       
    56     AiWsPlugin::MUiState* iUiState;
       
    57     TBool iFocus;
       
    58     TRawEvent iLastEvent;
       
    59     TRawEvent iRespondToEvent;
       
    60     };
       
    61 
       
    62 } // namespace T_AiWsPlugin
       
    63 
       
    64 
       
    65 #endif // _TESTEVENTHANDLER_STUB_H
       
    66