idlefw/tsrc/wsplugin/stub/testeventhandler_stub.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 19 Aug 2010 10:13:44 +0300
branchRCL_3
changeset 28 053c6c7c14f3
permissions -rw-r--r--
Revision: 201026 Kit: 201033

/*
* 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"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

// testeventhandler.h

#ifndef _TESTEVENTHANDLER_STUB_H
#define _TESTEVENTHANDLER_STUB_H

#include "eventhandler.h"
#include <e32event.h>

namespace T_AiWsPlugin {

using AiWsPlugin::MUiState;

/**
 * Common test event handler base for AiWsPlugin unit tests. 
 */
class CTestEventHandler : 
        public AiWsPlugin::CEventHandler
    {
public:
    ~CTestEventHandler();

public:  // Testing functions
    MUiState* UiState() const          { return iUiState; }
    TBool Focus() const                { return iFocus;   }
    const TRawEvent& LastEvent() const { return iLastEvent; }
    void ResetLastEvent();
    void RespondToEvent( const TRawEvent& aEvent );

private:
// from base class CEventHandler
    void SetUiStateQuery( MUiState& aUiState );
    void FocusChanged( TBool aState );
    TBool OfferRawEvent(const TRawEvent& aRawEvent);

protected:
    CTestEventHandler();

private: // data
    AiWsPlugin::MUiState* iUiState;
    TBool iFocus;
    TRawEvent iLastEvent;
    TRawEvent iRespondToEvent;
    };

} // namespace T_AiWsPlugin


#endif // _TESTEVENTHANDLER_STUB_H