graphicstest/uibench/s60/src/windows/twindow.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 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 TWINDOW_H
       
    23 #define TWINDOW_H
       
    24 
       
    25 
       
    26 #include <w32std.h>
       
    27 
       
    28 
       
    29 class CSurfaceUtility;
       
    30 class CEglEnvironment;
       
    31 class CEGLRendering;
       
    32 
       
    33 /**
       
    34  * Baseclass for all test windows. Is responsible for creation of destruction of the actual
       
    35  * WServ window. Also computes dirty regions for the window.
       
    36  * 
       
    37  */
       
    38 class CTWindow : public CBase
       
    39 {
       
    40 public:
       
    41 	virtual ~CTWindow();
       
    42 	virtual void LoadL(CSurfaceUtility* aUtility, TPtrC aFileName);
       
    43 	virtual void RenderL();
       
    44 
       
    45 	void Move(TInt aX, TInt aY);
       
    46 	TPoint CurrentPosition();
       
    47 	void SetPosition(TInt aX, TInt aY);
       
    48 	const RRegion& DirtyRegion() const;
       
    49 	void SetVisible(TBool aIsVisible);
       
    50 	TInt SetBackgroundSurface(const TSurfaceId& aSurface);
       
    51 	TSize Size();
       
    52 	
       
    53 	static TSize GetDisplaySizeInPixels();
       
    54 	static CFbsBitmap* CreateBitmapFromFileL(const TDesC& aFileName);
       
    55 	
       
    56 protected:
       
    57     CTWindow(const TPoint& aStartingPoint, const TSize& aWindowSize);
       
    58 	void ConstructL(RWsSession &aWs, const RWindowTreeNode &aParent);
       
    59 
       
    60 protected:
       
    61     RWindow iWindow;
       
    62     TBool iLoaded;
       
    63     
       
    64 private:	
       
    65 	RRegion iDirtyRegion;
       
    66 	TSize iSize;
       
    67 	TPoint iPosition;
       
    68 	TSize iScreenSize;	
       
    69 };
       
    70 
       
    71 // function pointer is used by the controller to create windows
       
    72 typedef CTWindow* (*pTWindowCreatorFunction)(RWsSession &aWs,
       
    73 			const RWindowTreeNode &aParent, 
       
    74 			const TPoint& aStartingPoint,
       
    75 			const TSize& aWindowSize);
       
    76 
       
    77 #endif /*TWINDOW_H*/