windowing/windowserver/tauto/TMULTCON.H
changeset 110 7f25ef56562d
parent 98 bf7481649c98
child 111 29ddb8a72f0e
equal deleted inserted replaced
98:bf7481649c98 110:7f25ef56562d
     1 
       
     2 // Copyright (c) 1996-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  @file
       
    19  @test
       
    20  @internalComponent - Internal Symbian test code
       
    21 */
       
    22 
       
    23 #ifndef __TMULTCON_H__
       
    24 #define __TMULTCON_H__
       
    25 
       
    26 #include <e32std.h>
       
    27 #include <e32svr.h>
       
    28 #include <w32std.h>
       
    29 #include "../tlib/testbase.h"
       
    30 #include "AUTO.H"
       
    31 #include "TGraphicsHarness.h"
       
    32 
       
    33 class CTMultiCon;
       
    34 class CMcWindowBase;
       
    35 
       
    36 class CMcConnectionBase : public CTClient
       
    37 	{
       
    38 public:
       
    39 	CMcConnectionBase(CTMultiCon *aTest);
       
    40 	~CMcConnectionBase();
       
    41 	virtual void ConstructL();
       
    42 	void SubStateChanged();
       
    43 protected:
       
    44 	CTMultiCon *iTest;
       
    45 	CMcWindowBase *iWin;
       
    46 	CWindowGc *iGc;
       
    47 	};
       
    48 
       
    49 class CMcConnection : public CMcConnectionBase	// Sets AutoForeground off
       
    50 	{
       
    51 public:
       
    52 	CMcConnection(CTMultiCon *aTest);
       
    53 	void ConstructL();
       
    54 	};
       
    55 
       
    56 class CMcWindowGroupAf : public CTWindowGroup
       
    57 	{
       
    58 public:
       
    59 	CMcWindowGroupAf(CTClient *aClient);
       
    60 	void KeyL(const TKeyEvent &aKey, const TTime &aTime);
       
    61 	};
       
    62 
       
    63 class CMcConnectionAf : public CMcConnectionBase	// Sets AutoForeground on
       
    64 	{
       
    65 public:
       
    66 	CMcConnectionAf(CTMultiCon *aTest);
       
    67 	void ConstructL();
       
    68 	void KeyL(const TKeyEvent &aKey);
       
    69 	};
       
    70 
       
    71 class CMcConnectionDef : public CMcConnectionBase	// Leaves AutoForeground as the default value
       
    72 	{
       
    73 public:
       
    74 	CMcConnectionDef(CTMultiCon *aTest);
       
    75 	void ConstructL();
       
    76 	};
       
    77 
       
    78 class CMcWindowBase : public CTWin
       
    79 	{
       
    80 public:
       
    81 	CMcWindowBase(CTMultiCon *aTest);
       
    82 	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
       
    83 	virtual void Draw()=0;
       
    84 	virtual void PointerL(const TPointerEvent &pointer,const TTime &)=0;
       
    85 protected:
       
    86 	CTMultiCon *iTest;
       
    87 	TRgb iBack;
       
    88 	};
       
    89 
       
    90 class CMcWindow : public CMcWindowBase
       
    91 	{
       
    92 public:
       
    93 	CMcWindow(CTMultiCon *aTest);
       
    94 	virtual void Draw();
       
    95 	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
       
    96 	};
       
    97 
       
    98 class CMcWindowAf : public CMcWindowBase
       
    99 	{
       
   100 public:
       
   101 	CMcWindowAf(CTMultiCon *aTest);
       
   102 	virtual void Draw();
       
   103 	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
       
   104 	void ConstructL();
       
   105 	};
       
   106 
       
   107 class CMcWindowDef : public CMcWindowBase
       
   108 	{
       
   109 public:
       
   110 	CMcWindowDef(CTMultiCon *aTest);
       
   111 	virtual void Draw();
       
   112 	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
       
   113 	};
       
   114 
       
   115 class CTMultiCon : public CTWsGraphicsBase
       
   116 	{
       
   117 public:
       
   118 	enum {KTimeOutAfter=10000000};	//10secs
       
   119 public:
       
   120 	CTMultiCon(CTestStep* aStep);
       
   121 	~CTMultiCon();
       
   122 	void ConstructL();
       
   123 	void EndAutoForegroundTest();
       
   124 	TInt SubState() const;
       
   125 	void IncSubState();
       
   126 	static TInt TimeOut(TAny* aTest);
       
   127 	void TimeOut();
       
   128 	inline TInt ScreenNumber() const {return(iTest->ScreenNumber());}
       
   129 protected:
       
   130 //from 	CTGraphicsStep
       
   131 	virtual void RunTestCaseL(TInt aCurTestCase);
       
   132 private:
       
   133 	void SendEvents();
       
   134 private:
       
   135 	CTimeOut* iTimeOut;
       
   136 	TInt iTimeOutCount;
       
   137 	CMcConnectionAf *iConn1;
       
   138 	CMcConnection *iConn2;
       
   139 	CMcConnectionDef *iConn3;
       
   140 	TSize iScreenSize;
       
   141 	//TInt iState;
       
   142 	TInt iSubState;
       
   143 	};
       
   144 
       
   145 class CTMultiConStep : public CTGraphicsStep
       
   146 	{
       
   147 public:
       
   148 	CTMultiConStep();
       
   149 protected:	
       
   150 	//from CTGraphicsStep
       
   151 	virtual CTGraphicsBase* CreateTestL();
       
   152 	};
       
   153 
       
   154 _LIT(KTMultiConStep,"TMultiCon");
       
   155 
       
   156 
       
   157 #endif