fep/frontendprocessor/test/inc/TAppMorse.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 // Copyright (c) 2006-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  @test
       
    19  @internalComponent - Internal Symbian test code  
       
    20 */
       
    21 
       
    22 #if (!defined __TAPPMORSE_H__)
       
    23 #define __TAPPMORSE_H__
       
    24 
       
    25 #include "appfwk_test_AppUi.h"
       
    26 #include <fepbase.h>
       
    27 #include <coecntrl.h>
       
    28 
       
    29 //! A CTestStep derived class     
       
    30 
       
    31 /**   Launch application and perform test.\n  */
       
    32 
       
    33 class CTAppMorse : public CTmsTestStep
       
    34 	{
       
    35 public:
       
    36 	CTAppMorse();
       
    37 	~CTAppMorse();
       
    38 	virtual TVerdict doTestStepL();
       
    39 	void ConstructAppL(CEikonEnv* aEikEnv);
       
    40 	};
       
    41 
       
    42 
       
    43 //	CStackFaultTestFep class definition
       
    44 
       
    45 
       
    46 //! A CCoeFep derived class 
       
    47 /** 
       
    48   Class derived from the Abstract base class for all the FEPs.\n
       
    49   This class implements all the pure virtual functions of the base class.\n
       
    50 */
       
    51 class CStackFaultTestFep : public CCoeFep
       
    52 	{
       
    53 public:
       
    54 	static CCoeFep* NewFepL( CCoeEnv& aConeEnvironment, const CCoeFepParameters& aFepParameters );
       
    55 	inline void MakeDeferredFunctionCall(MDeferredFunctionCall& aDeferredFunctionCall) {CCoeFep::MakeDeferredFunctionCall(aDeferredFunctionCall);}
       
    56 	inline void SimulateKeyEventsL(const TArray<TUint>& aArrayOfCharacters) {CCoeFep::SimulateKeyEventsL(aArrayOfCharacters);}
       
    57 	inline void SimulateKeyEventsL(const TArray<MModifiedCharacter>& aArrayOfModifiedCharacters) {CCoeFep::SimulateKeyEventsL(aArrayOfModifiedCharacters);}
       
    58 	inline void WriteAttributeDataAndBroadcastL(TUid aAttributeUid) {CCoeFep::WriteAttributeDataAndBroadcastL(aAttributeUid);}
       
    59 	inline TBool IsOn() const {return CCoeFep::IsOn();}
       
    60 private:
       
    61 	CStackFaultTestFep(CCoeEnv& aConeEnvironment);
       
    62 	void ConstructL(const CCoeFepParameters& aFepParameters);
       
    63 // None of these functions below are called for the test but must be
       
    64 // defined to complete the interfaces that a fep is required to implement
       
    65 	// from CCoeFep
       
    66 	virtual void CancelTransaction() {};
       
    67 	virtual void IsOnHasChangedState() {};
       
    68 	virtual void OfferKeyEventL(TEventResponse& aEventResponse, const TKeyEvent& /*aKeyEvent*/, TEventCode /*aEventCode*/) {aEventResponse=EEventWasNotConsumed;};
       
    69 	virtual void OfferPointerEventL(TEventResponse& aEventResponse, const TPointerEvent& /*aPointerEvent*/, const CCoeControl* /*aWindowOwningControl*/) {aEventResponse=EEventWasNotConsumed;};
       
    70 	virtual void OfferPointerBufferReadyEventL(TEventResponse& aEventResponse, const CCoeControl* /*aWindowOwningControl*/) {aEventResponse=EEventWasNotConsumed;};
       
    71 	// from MFepAttributeStorer (via CCoeFep)
       
    72 	virtual TInt NumberOfAttributes() const {return 0;};
       
    73 	virtual TUid AttributeAtIndex(TInt /*aIndex*/) const {return KNullUid;};
       
    74 	virtual void WriteAttributeDataToStreamL(TUid /*aAttributeUid*/, RWriteStream& /*aStream*/) const {};
       
    75 	virtual void ReadAttributeDataFromStreamL(TUid /*aAttributeUid*/, RReadStream& /*aStream*/) {};
       
    76 	// from MCoeForegroundObserver (via CCoeFep)
       
    77 	virtual void HandleGainingForeground() {};
       
    78 	virtual void HandleLosingForeground() {};
       
    79 	// from MCoeFocusObserver (via CCoeFep)
       
    80 	virtual void HandleChangeInFocus() {};
       
    81 	virtual void HandleDestructionOfFocusedItem() {};
       
    82 	};
       
    83 
       
    84 
       
    85 //	CTAppMorseAppView class definition
       
    86 
       
    87 
       
    88 
       
    89 //! A CCoeControl derived class  
       
    90 /**   Class derived from the control base class.\n
       
    91 	  All controls are derived from this class and the handling of events are also specified.\n
       
    92 */
       
    93 class CTAppMorseAppView : public CCoeControl
       
    94 	{
       
    95 	class CStop;
       
    96 public:
       
    97 	static CTAppMorseAppView* NewL( const TRect& aRect,CTmsTestStep* aStep );
       
    98 	void ConstructL( const TRect& aRect );
       
    99 	~CTAppMorseAppView();
       
   100 	void MakeFep();
       
   101 private:
       
   102 	CTAppMorseAppView(CTmsTestStep* aStep);
       
   103 	void Draw(const TRect& /* aRect */) const {};
       
   104 	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   105 	void DoTestL();
       
   106 protected:
       
   107 	CTestExecuteLogger&	Logger() {return iStep->Logger();}
       
   108 private:
       
   109 	CStop* iStop;
       
   110 	CCoeFep* iTestFep;
       
   111 	TUint iNextValidScanCode;
       
   112 	CTestStep* iStep;
       
   113 	};
       
   114 	
       
   115 
       
   116 //	CTAppMorseAppView::CStop class definition
       
   117 
       
   118 
       
   119 //! A CActive derived class for the the active scheduler 
       
   120 /**
       
   121   Encapsulates both the issuing of a request to an asynchronous service provider\n
       
   122   and the handling of completed requests
       
   123 */
       
   124 class CTAppMorseAppView::CStop : public CActive
       
   125 	{
       
   126 public:
       
   127 	CStop( CEikonEnv* env );
       
   128 	void DoStop();
       
   129 	TInt RunError(TInt);
       
   130 protected:
       
   131 	void DoCancel();
       
   132 	void RunL();
       
   133 private:
       
   134 	CEikonEnv* iEikEnv;
       
   135 	};
       
   136 
       
   137 
       
   138 //	CTAppMorseAppUi class definition
       
   139 //
       
   140 
       
   141 // A CTestAppUi derived Class
       
   142 /**
       
   143   User interface class for the test application.\n Implements the RunTestStepL function.\n
       
   144 */
       
   145 class CTAppMorseAppUi : public CTestAppUi
       
   146 	{
       
   147 public:
       
   148 	CTAppMorseAppUi(CTmsTestStep* aStep);
       
   149 	void ConstructL(CTmsTestStep* aStep);
       
   150 	~CTAppMorseAppUi();
       
   151 	void DoExit();
       
   152 	void ConstructL() {};
       
   153 private:
       
   154 	void HandleCommandL(TInt aCommand);
       
   155 protected: //from CTestAppUi
       
   156  	virtual void RunTestStepL(TInt aNumStep);
       
   157 private:
       
   158 	CCoeControl* iAppView;
       
   159 	};
       
   160 
       
   161 _LIT(KTAppMorse,"TAppMorse");
       
   162 #endif
       
   163 
       
   164 
       
   165 
       
   166