windowing/windowserver/tcrx/tcrx.h
changeset 116 171fae344dd4
parent 103 2717213c588a
equal deleted inserted replaced
103:2717213c588a 116:171fae344dd4
     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 #ifndef __TCRX_H__
       
    23 #define __TCRX_H__
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <w32std.h>
       
    27 
       
    28 class CRedrawHandler;
       
    29 class CWindow;
       
    30 class CWsListen;
       
    31 class CWsRedir;
       
    32 class CTwoWindow;
       
    33 
       
    34 class CClient: public CActive
       
    35 	{
       
    36 public:
       
    37 	static CClient* NewL();
       
    38 	~CClient();
       
    39 	void RunL();
       
    40 	void DoCancel();
       
    41 	inline RWsSession& Ws();
       
    42 	inline RWindowGroup& Group();
       
    43 	inline CWindowGc& Gc();
       
    44 	inline CWindow* Win();
       
    45 	inline CWsScreenDevice* Screen();
       
    46 	inline CWsRedir* WsRedir();
       
    47 	inline CWsListen* WsListen();
       
    48 	void HandleCommand(TInt aCmd);
       
    49 private:
       
    50 	CClient();
       
    51 	void ConstructL();
       
    52 	void MakeRequest();
       
    53 	void DrawTwoWindow();
       
    54 	void ClearTwoWindow();
       
    55 
       
    56 	RWsSession iWs;
       
    57 	RWindowGroup iGroup;
       
    58 	CWsScreenDevice* iScreen;
       
    59 	CWindowGc* iGc;
       
    60 	TWsEvent iEvent;
       
    61 	CWindow* iWin;
       
    62 	CRedrawHandler* iRedraw;
       
    63 	CWsListen* iListen;
       
    64 	CWsRedir* iRedir;
       
    65 	RBlankWindow iBlank;
       
    66 	CTwoWindow* iTwo;
       
    67 	};
       
    68 
       
    69 class CRedrawHandler: public CActive
       
    70 	{
       
    71 public:
       
    72 	static CRedrawHandler* NewL(CClient* aClient);
       
    73 	~CRedrawHandler();
       
    74 	void RunL();
       
    75 	void DoCancel();
       
    76 private:
       
    77 	CRedrawHandler(CClient* aClient);
       
    78 	void ConstructL();
       
    79 	void MakeRequest();
       
    80 
       
    81 	CClient* iClient;
       
    82 	};
       
    83 
       
    84 class CWindow: public CBase
       
    85 	{
       
    86 public:
       
    87 	CWindow(CClient* aClient);
       
    88 	void ConstructL(CWindow* aParent, TBool aTransparentFlag);
       
    89 	~CWindow();
       
    90 	void Draw(const TRect& aRect) const;
       
    91 	void DrawMenu() const;
       
    92 	inline RWindow& Window();
       
    93 	inline CWindow* Parent();
       
    94 	inline TSize Size();
       
    95 	inline CClient* Client();
       
    96 private:
       
    97 	CClient* iClient;
       
    98 	RWindow iWin;
       
    99 	CWindow* iParent;
       
   100 	};
       
   101 
       
   102 // CClient
       
   103 inline RWsSession& CClient::Ws() 
       
   104 	{return iWs;}
       
   105 inline RWindowGroup& CClient::Group() 
       
   106 	{return iGroup;}
       
   107 inline CWindowGc& CClient::Gc() 
       
   108 	{return *iGc;}
       
   109 inline CWindow* CClient::Win() 
       
   110 	{return iWin;}
       
   111 inline CWsScreenDevice* CClient::Screen() 
       
   112 	{return iScreen;}
       
   113 inline CWsListen* CClient::WsListen()
       
   114 	{return iListen;}
       
   115 inline CWsRedir* CClient::WsRedir()
       
   116 	{return iRedir;}
       
   117 // CWindow
       
   118 inline RWindow& CWindow::Window() 
       
   119 	{return iWin;}
       
   120 inline CWindow* CWindow::Parent() 
       
   121 	{return iParent;}
       
   122 inline TSize CWindow::Size() 
       
   123 	{return iWin.Size();}
       
   124 inline CClient* CWindow::Client() 
       
   125 	{return iClient;}
       
   126 
       
   127 #endif
       
   128