os/graphics/windowing/windowserver/test/tauto/TKEY.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 1996-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 #ifndef __TKEY_H__
    23 #define __TKEY_H__
    24 
    25 #include <e32std.h>
    26 #include <w32std.h>
    27 #include "../tlib/testbase.h"
    28 #include "AUTO.H"
    29 #include <hal.h>
    30 #include "TGraphicsHarness.h"
    31 
    32 _LIT(KSemaphoreName,"KeyProcSem");
    33 
    34 
    35 class CVisibleGroup: public CBase
    36 	{
    37 public:
    38 	CVisibleGroup(TInt aScreenNo);
    39 	~CVisibleGroup();
    40 	void ConstructL();
    41 	void SetMode(TInt aMode);
    42 private:
    43 	RWsSession iWs;
    44 	RWindowGroup iGroup;
    45 	CWsScreenDevice* iScr;
    46 	TInt iScreenNo;
    47 	TInt iMode;
    48 	};
    49 
    50 
    51 class ClientToKill : public CTClient
    52 	{
    53 public:
    54 	ClientToKill();
    55 	~ClientToKill();
    56 	void ConstructL();
    57 private:
    58 	TestWindow *iTestWin;
    59 	};
    60 
    61 
    62 
    63 class CTKey : public CTWsGraphicsBase
    64 	{
    65 public:
    66 	enum {EFuncCtrlShift=EModifierFunc|EModifierCtrl|EModifierShift};
    67 public:
    68 	CTKey(CTestStep* aStep);
    69 	~CTKey();
    70 	void ConstructL();
    71 
    72 	void KeyOfDeathL();
    73 	void KeyOfOrientation();
    74 	void CycleDisplaySize();
    75 	void ContrastKeysL();
    76 	void BackLightKeysL();
    77 	void BrightnessKeysL();
    78 	void ScreenSizeModeKeysL();
    79 protected:
    80 	virtual void RunTestCaseL(TInt aCurTestCase);
    81 private:
    82 	void SendKey(TInt aScanCode);
    83 	void SendUpDown(TInt aScanCode);
    84 	void SendCtrlAltShift(TInt aScanCode);
    85 	void SendCtrlAltShift(TRawEvent::TType aType);
    86 	void SetHotKey(THotKey aType, TUint aKeyCode);
    87 	void LogWindowGroupIds();
    88 	void TestContrastL(TBool aChange);
    89 	void TestDefaultContrastL(TBool aChange);
    90 	void TestBackLightL(TBool aChange);
    91 	void TestDefaultBackLightL(TBool aChange);
    92 	void TestBrightnessL(TBool aChange);
    93 	void TestDefaultBrightnessL(TBool aChange);
    94 	void TestScreenSizeModeL(TInt aKeys,TBool aChange);
    95 	void TestDefaultScreenSizeModeL(TInt aKeys,TBool aChange);
    96 
    97 private:
    98 	RSemaphore iSem;
    99 	TSize iWinSize;
   100 	CVisibleGroup* iVisibleGroup;
   101 	};
   102 
   103 class CTKeyStep : public CTGraphicsStep
   104 	{
   105 public:
   106 	CTKeyStep();
   107 protected:
   108 	//from CTGraphicsStep
   109 	virtual CTGraphicsBase* CreateTestL();
   110 	};
   111 
   112 _LIT(KTKeyStep,"TKey");
   113 
   114 
   115 #endif