sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #ifndef __TCRX_H__ sl@0: #define __TCRX_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CRedrawHandler; sl@0: class CWindow; sl@0: class CWsListen; sl@0: class CWsRedir; sl@0: class CTwoWindow; sl@0: sl@0: class CClient: public CActive sl@0: { sl@0: public: sl@0: static CClient* NewL(); sl@0: ~CClient(); sl@0: void RunL(); sl@0: void DoCancel(); sl@0: inline RWsSession& Ws(); sl@0: inline RWindowGroup& Group(); sl@0: inline CWindowGc& Gc(); sl@0: inline CWindow* Win(); sl@0: inline CWsScreenDevice* Screen(); sl@0: inline CWsRedir* WsRedir(); sl@0: inline CWsListen* WsListen(); sl@0: void HandleCommand(TInt aCmd); sl@0: private: sl@0: CClient(); sl@0: void ConstructL(); sl@0: void MakeRequest(); sl@0: void DrawTwoWindow(); sl@0: void ClearTwoWindow(); sl@0: sl@0: RWsSession iWs; sl@0: RWindowGroup iGroup; sl@0: CWsScreenDevice* iScreen; sl@0: CWindowGc* iGc; sl@0: TWsEvent iEvent; sl@0: CWindow* iWin; sl@0: CRedrawHandler* iRedraw; sl@0: CWsListen* iListen; sl@0: CWsRedir* iRedir; sl@0: RBlankWindow iBlank; sl@0: CTwoWindow* iTwo; sl@0: }; sl@0: sl@0: class CRedrawHandler: public CActive sl@0: { sl@0: public: sl@0: static CRedrawHandler* NewL(CClient* aClient); sl@0: ~CRedrawHandler(); sl@0: void RunL(); sl@0: void DoCancel(); sl@0: private: sl@0: CRedrawHandler(CClient* aClient); sl@0: void ConstructL(); sl@0: void MakeRequest(); sl@0: sl@0: CClient* iClient; sl@0: }; sl@0: sl@0: class CWindow: public CBase sl@0: { sl@0: public: sl@0: CWindow(CClient* aClient); sl@0: void ConstructL(CWindow* aParent, TBool aTransparentFlag); sl@0: ~CWindow(); sl@0: void Draw(const TRect& aRect) const; sl@0: void DrawMenu() const; sl@0: inline RWindow& Window(); sl@0: inline CWindow* Parent(); sl@0: inline TSize Size(); sl@0: inline CClient* Client(); sl@0: private: sl@0: CClient* iClient; sl@0: RWindow iWin; sl@0: CWindow* iParent; sl@0: }; sl@0: sl@0: // CClient sl@0: inline RWsSession& CClient::Ws() sl@0: {return iWs;} sl@0: inline RWindowGroup& CClient::Group() sl@0: {return iGroup;} sl@0: inline CWindowGc& CClient::Gc() sl@0: {return *iGc;} sl@0: inline CWindow* CClient::Win() sl@0: {return iWin;} sl@0: inline CWsScreenDevice* CClient::Screen() sl@0: {return iScreen;} sl@0: inline CWsListen* CClient::WsListen() sl@0: {return iListen;} sl@0: inline CWsRedir* CClient::WsRedir() sl@0: {return iRedir;} sl@0: // CWindow sl@0: inline RWindow& CWindow::Window() sl@0: {return iWin;} sl@0: inline CWindow* CWindow::Parent() sl@0: {return iParent;} sl@0: inline TSize CWindow::Size() sl@0: {return iWin.Size();} sl@0: inline CClient* CWindow::Client() sl@0: {return iClient;} sl@0: sl@0: #endif sl@0: