sl@0: // Copyright (c) 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 TFLOWINDOWSCONTROLLER_H sl@0: #define TFLOWINDOWSCONTROLLER_H sl@0: sl@0: sl@0: #include "twindow.h" sl@0: sl@0: sl@0: class CSurfaceUtility; sl@0: sl@0: sl@0: /** sl@0: * Creates and manages the windows and moves them around. sl@0: * It uses function pointers to create the windows. sl@0: * sl@0: */ sl@0: class CTFlowWindowsController : public CBase sl@0: { sl@0: public: sl@0: virtual ~CTFlowWindowsController(); sl@0: static CTFlowWindowsController* NewL (TBool aPreload, RArray& aFileNames, sl@0: TSize& aWindowSize, RArray& aNewLs, sl@0: RArray& aInitialPositions, TBool aBouncing, sl@0: TBool aMoveHorizontal = ETrue); sl@0: sl@0: inline TInt NumberOfWindows() const; sl@0: inline void SetFlowRate(TInt aFlowRate); sl@0: sl@0: void Rotate(CFbsBitGc::TGraphicsOrientation aOrientation); sl@0: void SetWindowsVisibility(TBool aVisible); sl@0: sl@0: virtual void MoveL(); sl@0: sl@0: protected: sl@0: CTFlowWindowsController(TInt aNumWindows, TBool aPreload, TSize& aWindowSize, TBool aBouncing, TBool aMoveHorizontal); sl@0: void ConstructL(RArray& aFileNames, RArray& aNewLs, RArray& aInitialPositions); sl@0: void SubmitUpdateL(); sl@0: sl@0: protected: sl@0: RWsSession iWs; sl@0: RWindowGroup iWinGroup; sl@0: CWsScreenDevice* iScreenDev; sl@0: CSurfaceUtility* iUtility; sl@0: sl@0: RArray iFlowWindows; sl@0: RArray iFileNames; sl@0: sl@0: RRegion iWindowsRegion; sl@0: sl@0: TSize iWindowSize; sl@0: TRect iScreenRect; sl@0: TBool iPreload; sl@0: TInt iNumWindows; sl@0: TInt iDeltaX; sl@0: TInt iDeltaY; sl@0: TBool iBouncing; sl@0: }; sl@0: sl@0: sl@0: inline TInt CTFlowWindowsController::NumberOfWindows() const sl@0: { sl@0: return iNumWindows; sl@0: } sl@0: sl@0: /** sl@0: Sets the rate at which the images are scrolled. sl@0: sl@0: @param aSpeed The number of pixels to move the image each cycle. sl@0: */ sl@0: inline void CTFlowWindowsController::SetFlowRate(TInt aFlowRate) sl@0: { sl@0: if (iDeltaX > 0) sl@0: { sl@0: iDeltaX = aFlowRate; sl@0: } sl@0: else sl@0: { sl@0: iDeltaY = aFlowRate; sl@0: } sl@0: } sl@0: sl@0: sl@0: sl@0: #endif /*TFLOWINDOWSCONTROLLER_H*/