graphicstest/uibench/s60/src/windows/tflowwindowscontroller.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 TFLOWINDOWSCONTROLLER_H
       
    23 #define TFLOWINDOWSCONTROLLER_H
       
    24 
       
    25 
       
    26 #include "twindow.h"
       
    27 
       
    28 
       
    29 class CSurfaceUtility;
       
    30 
       
    31 
       
    32 /**
       
    33  * Creates and manages the windows and moves them around.
       
    34  * It uses function pointers to create the windows.
       
    35  * 
       
    36  */
       
    37 class CTFlowWindowsController : public CBase
       
    38     {
       
    39 public:    
       
    40     virtual ~CTFlowWindowsController();
       
    41     static CTFlowWindowsController* NewL (TBool aPreload, RArray<TPtrC>& aFileNames, 
       
    42 										  TSize& aWindowSize, RArray<pTWindowCreatorFunction>& aNewLs,
       
    43 										  RArray<TPoint>& aInitialPositions, TBool aBouncing,
       
    44 										  TBool aMoveHorizontal = ETrue);
       
    45 
       
    46     inline TInt NumberOfWindows() const;
       
    47     inline void SetFlowRate(TInt aFlowRate);
       
    48     
       
    49 	void Rotate(CFbsBitGc::TGraphicsOrientation aOrientation);
       
    50 	void SetWindowsVisibility(TBool aVisible);
       
    51 	
       
    52 	virtual void MoveL();
       
    53 	
       
    54 protected:
       
    55     CTFlowWindowsController(TInt aNumWindows, TBool aPreload, TSize& aWindowSize, TBool aBouncing, TBool aMoveHorizontal);
       
    56     void ConstructL(RArray<TPtrC>& aFileNames, RArray<pTWindowCreatorFunction>& aNewLs, RArray<TPoint>& aInitialPositions);
       
    57 	void SubmitUpdateL();
       
    58 	
       
    59 protected:
       
    60 	RWsSession              iWs;
       
    61 	RWindowGroup            iWinGroup;
       
    62 	CWsScreenDevice*        iScreenDev;
       
    63 	CSurfaceUtility*        iUtility;
       
    64 
       
    65 	RArray<CTWindow*>       iFlowWindows;
       
    66 	RArray<TPtrC>           iFileNames;
       
    67 	
       
    68 	RRegion                 iWindowsRegion;
       
    69 	    
       
    70 	TSize                   iWindowSize;
       
    71 	TRect                   iScreenRect;
       
    72 	TBool                   iPreload;
       
    73 	TInt                    iNumWindows;
       
    74 	TInt                    iDeltaX;
       
    75 	TInt                    iDeltaY;
       
    76 	TBool                   iBouncing;
       
    77     };
       
    78 
       
    79 
       
    80 inline TInt CTFlowWindowsController::NumberOfWindows() const
       
    81     {
       
    82     return iNumWindows;
       
    83     }
       
    84 
       
    85 /**
       
    86     Sets the rate at which the images are scrolled.
       
    87     
       
    88     @param aSpeed The number of pixels to move the image each cycle.
       
    89     */
       
    90 inline void CTFlowWindowsController::SetFlowRate(TInt aFlowRate)
       
    91     {
       
    92     if (iDeltaX > 0)
       
    93         {
       
    94         iDeltaX = aFlowRate;
       
    95         }
       
    96     else 
       
    97         {
       
    98         iDeltaY = aFlowRate;
       
    99         }
       
   100     }
       
   101 
       
   102 
       
   103 
       
   104 #endif /*TFLOWINDOWSCONTROLLER_H*/