sl@0: // Copyright (c) 2007-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 sl@0: */ sl@0: sl@0: #ifndef __T_PSEUDOAPPWINDOW_H__ sl@0: #define __T_PSEUDOAPPWINDOW_H__ sl@0: sl@0: #include //RWsSession, CWsScreenDevice etc sl@0: sl@0: #include "t_pseudoapptestresults.h" sl@0: sl@0: enum TWindowChange sl@0: { sl@0: ENoChange = 0, sl@0: EIncremental, sl@0: ECyclic sl@0: }; sl@0: sl@0: enum TWindowChangeType sl@0: { sl@0: ENoChanges, sl@0: EWindowSize, sl@0: EWindowPosition, sl@0: EWindowPositionAndSize, sl@0: EWindowPositionAndSizeWithOpacity sl@0: }; sl@0: sl@0: typedef enum TPixelFormat sl@0: { sl@0: EFormatRgb, sl@0: EFormatYuv sl@0: }TPixelFormat; sl@0: sl@0: typedef enum TParamChange sl@0: { sl@0: ENoParamChange, sl@0: EFirstFrame, sl@0: EBitmapScale, sl@0: ESizeChange, sl@0: EPositionChange, sl@0: EExtentChange, sl@0: EOpacityChange sl@0: } TParamChange; sl@0: sl@0: class TDrawParameters sl@0: { sl@0: public: sl@0: TDrawParameters(); sl@0: ~TDrawParameters(); sl@0: TBool operator==(const TDrawParameters& x) const; sl@0: sl@0: public: sl@0: TBool iRedraw; sl@0: TInt iBitmapScale; sl@0: TInt iBitmapAlpha; sl@0: TSize iWindowSize; sl@0: TPoint iWindowPos; sl@0: }; sl@0: sl@0: class CTestWindow : public CBase sl@0: { sl@0: public: sl@0: inline RWindow* Window() {return &iWindow;}; sl@0: IMPORT_C virtual void Rotate(TSize aScreenSize); sl@0: IMPORT_C virtual void DrawL(); sl@0: ~CTestWindow(); sl@0: sl@0: void SetPosition(); sl@0: void SetSize(); sl@0: void SetExtent(); sl@0: sl@0: protected: sl@0: IMPORT_C CTestWindow(TInt aScreenNo, TDisplayMode aMode); sl@0: sl@0: private: sl@0: void ConstructL(TInt aScreenNo, TDisplayMode aMode); sl@0: sl@0: protected: sl@0: RWsSession iSession; sl@0: CWsScreenDevice* iScreen; sl@0: CWindowGc* iWindowGc; sl@0: RWindow iWindow; sl@0: RWindowGroup iGroup; sl@0: TDisplayMode iMode; sl@0: CArrayFixFlat* iLoadsaParameters; sl@0: TGceTestResults* iGceTestResults; sl@0: TInt iFrameCounter; sl@0: }; sl@0: sl@0: class CTestEmptyWindow : public CTestWindow sl@0: { sl@0: public: sl@0: IMPORT_C static CTestEmptyWindow* NewL(TInt aScreen, TDisplayMode aMode, const TSize& aScreenSize); sl@0: IMPORT_C virtual void Rotate(TSize aScreenSize); sl@0: IMPORT_C virtual void DrawL(); sl@0: ~CTestEmptyWindow(); sl@0: sl@0: protected: sl@0: IMPORT_C CTestEmptyWindow(TInt aScreenNo, TDisplayMode aMode); sl@0: sl@0: private: sl@0: void ConstructL(const TSize& aScreenSize); sl@0: sl@0: private: sl@0: TInt iWindowDrawn; sl@0: }; sl@0: sl@0: class CTestEcomWindow : public CTestWindow sl@0: { sl@0: public: sl@0: IMPORT_C static CTestEcomWindow* NewL(TInt aScreenNo, TDisplayMode aMode, const TPtrC& aMultiBitmapEcomFile, sl@0: TInt aMultiBitmapEcomFileSize, TGceTestResults* aGceTestResults, sl@0: CArrayFixFlat* aLoadsaParameters); sl@0: ~CTestEcomWindow(); sl@0: IMPORT_C virtual void Rotate(TSize aScreenSize); sl@0: IMPORT_C virtual void DrawL(); sl@0: sl@0: sl@0: protected: sl@0: IMPORT_C CTestEcomWindow(TInt aScreenNo, TDisplayMode aMode); sl@0: sl@0: private: sl@0: void ConstructL(const TPtrC& aMultiBitmapEcomFile, TInt aMultiBitmapEcomFileSize, TGceTestResults* aGceTestResults, sl@0: CArrayFixFlat* aLoadsaParameters); sl@0: TParamChange Redraw(); sl@0: sl@0: private: sl@0: TPtrC iMultiBitmapEcomFile; sl@0: TInt iMultiBitmapEcomFileSize; sl@0: TInt iBitmapCounter; sl@0: }; sl@0: sl@0: class CTestUiWindow : public CTestWindow sl@0: { sl@0: public: sl@0: IMPORT_C static CTestUiWindow* NewL(TInt aScreenNo, TDisplayMode aMode, const TPtrC& aMultiBitmapUiFile, TInt aMultiBitmapUiFileSize, sl@0: CArrayFixFlat* aRectArray, TInt aFrameDuration, TInt aMultiBitmapUiFileTransparency, sl@0: TGceTestResults* aGceTestResults, sl@0: CArrayFixFlat* aLoadsaParameters); sl@0: sl@0: IMPORT_C virtual void Rotate(const TSize& aScreenSize); sl@0: IMPORT_C virtual void DrawL(); sl@0: ~CTestUiWindow(); sl@0: sl@0: protected: sl@0: IMPORT_C CTestUiWindow(TInt aScreenNo, TDisplayMode aMode); sl@0: sl@0: private: sl@0: void ConstructL(const TPtrC& aMultiBitmapUiFile, TInt aMultiBitmapUiFileSize, CArrayFixFlat* aRectArray, sl@0: TInt aFrameDuration, TInt aMultiBitmapUiFileTransparency, TGceTestResults* aGceTestResults, sl@0: CArrayFixFlat* aLoadsaParameters); sl@0: TParamChange Redraw(); sl@0: void CalcNewWindowExtent(TSize aScreenSize, TInt aIncrement, TInt aDirection); sl@0: void SetBitmapTransparency(CFbsBitmap* aBitmap, TUint8 aAlphaValue, TInt aAlphaByteLocation); sl@0: sl@0: void ParamChangeCyclicPositionAndSize(TDrawParameters& aDrawParams, TInt aFrameCounter); sl@0: void ParamChangeCyclicPosition(TDrawParameters& aDrawParams, TInt aFrameCounter); sl@0: void CalcNewWindowLocation(TSize aScreensize, TInt aIncrement, TInt aDirection,TDrawParameters& aDrawParams); sl@0: void SetBitmapAlpha(CFbsBitmap* aBitmap); sl@0: sl@0: protected: sl@0: TBool iSimUiDrawn; sl@0: TPtrC iMultiBitmapUiFile; sl@0: TInt iMultiBitmapUiFileSize; sl@0: CArrayFixFlat* iRectArray; sl@0: TInt iMultiBitmapUiFileTransparency; sl@0: TInt iFrameDuration; sl@0: }; sl@0: sl@0: #endif //__T_PSEUDOAPPWINDOW_H__