1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/windows/tflowwindowscontroller.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,104 @@
1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#ifndef TFLOWINDOWSCONTROLLER_H
1.26 +#define TFLOWINDOWSCONTROLLER_H
1.27 +
1.28 +
1.29 +#include "twindow.h"
1.30 +
1.31 +
1.32 +class CSurfaceUtility;
1.33 +
1.34 +
1.35 +/**
1.36 + * Creates and manages the windows and moves them around.
1.37 + * It uses function pointers to create the windows.
1.38 + *
1.39 + */
1.40 +class CTFlowWindowsController : public CBase
1.41 + {
1.42 +public:
1.43 + virtual ~CTFlowWindowsController();
1.44 + static CTFlowWindowsController* NewL (TBool aPreload, RArray<TPtrC>& aFileNames,
1.45 + TSize& aWindowSize, RArray<pTWindowCreatorFunction>& aNewLs,
1.46 + RArray<TPoint>& aInitialPositions, TBool aBouncing,
1.47 + TBool aMoveHorizontal = ETrue);
1.48 +
1.49 + inline TInt NumberOfWindows() const;
1.50 + inline void SetFlowRate(TInt aFlowRate);
1.51 +
1.52 + void Rotate(CFbsBitGc::TGraphicsOrientation aOrientation);
1.53 + void SetWindowsVisibility(TBool aVisible);
1.54 +
1.55 + virtual void MoveL();
1.56 +
1.57 +protected:
1.58 + CTFlowWindowsController(TInt aNumWindows, TBool aPreload, TSize& aWindowSize, TBool aBouncing, TBool aMoveHorizontal);
1.59 + void ConstructL(RArray<TPtrC>& aFileNames, RArray<pTWindowCreatorFunction>& aNewLs, RArray<TPoint>& aInitialPositions);
1.60 + void SubmitUpdateL();
1.61 +
1.62 +protected:
1.63 + RWsSession iWs;
1.64 + RWindowGroup iWinGroup;
1.65 + CWsScreenDevice* iScreenDev;
1.66 + CSurfaceUtility* iUtility;
1.67 +
1.68 + RArray<CTWindow*> iFlowWindows;
1.69 + RArray<TPtrC> iFileNames;
1.70 +
1.71 + RRegion iWindowsRegion;
1.72 +
1.73 + TSize iWindowSize;
1.74 + TRect iScreenRect;
1.75 + TBool iPreload;
1.76 + TInt iNumWindows;
1.77 + TInt iDeltaX;
1.78 + TInt iDeltaY;
1.79 + TBool iBouncing;
1.80 + };
1.81 +
1.82 +
1.83 +inline TInt CTFlowWindowsController::NumberOfWindows() const
1.84 + {
1.85 + return iNumWindows;
1.86 + }
1.87 +
1.88 +/**
1.89 + Sets the rate at which the images are scrolled.
1.90 +
1.91 + @param aSpeed The number of pixels to move the image each cycle.
1.92 + */
1.93 +inline void CTFlowWindowsController::SetFlowRate(TInt aFlowRate)
1.94 + {
1.95 + if (iDeltaX > 0)
1.96 + {
1.97 + iDeltaX = aFlowRate;
1.98 + }
1.99 + else
1.100 + {
1.101 + iDeltaY = aFlowRate;
1.102 + }
1.103 + }
1.104 +
1.105 +
1.106 +
1.107 +#endif /*TFLOWINDOWSCONTROLLER_H*/