idlefw/tsrc/wsplugin/stub/testeventhandler_stub.h
branchRCL_3
changeset 28 053c6c7c14f3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idlefw/tsrc/wsplugin/stub/testeventhandler_stub.h	Thu Aug 19 10:13:44 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* 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
+