sl@0
|
1 |
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@test
|
sl@0
|
19 |
@internalComponent - Internal Symbian test code
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
#ifndef TFLOWINDOWSCONTROLLER_H
|
sl@0
|
23 |
#define TFLOWINDOWSCONTROLLER_H
|
sl@0
|
24 |
|
sl@0
|
25 |
|
sl@0
|
26 |
#include "twindow.h"
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
class CSurfaceUtility;
|
sl@0
|
30 |
|
sl@0
|
31 |
|
sl@0
|
32 |
/**
|
sl@0
|
33 |
* Creates and manages the windows and moves them around.
|
sl@0
|
34 |
* It uses function pointers to create the windows.
|
sl@0
|
35 |
*
|
sl@0
|
36 |
*/
|
sl@0
|
37 |
class CTFlowWindowsController : public CBase
|
sl@0
|
38 |
{
|
sl@0
|
39 |
public:
|
sl@0
|
40 |
virtual ~CTFlowWindowsController();
|
sl@0
|
41 |
static CTFlowWindowsController* NewL (TBool aPreload, RArray<TPtrC>& aFileNames,
|
sl@0
|
42 |
TSize& aWindowSize, RArray<pTWindowCreatorFunction>& aNewLs,
|
sl@0
|
43 |
RArray<TPoint>& aInitialPositions, TBool aBouncing,
|
sl@0
|
44 |
TBool aMoveHorizontal = ETrue);
|
sl@0
|
45 |
|
sl@0
|
46 |
inline TInt NumberOfWindows() const;
|
sl@0
|
47 |
inline void SetFlowRate(TInt aFlowRate);
|
sl@0
|
48 |
|
sl@0
|
49 |
void Rotate(CFbsBitGc::TGraphicsOrientation aOrientation);
|
sl@0
|
50 |
void SetWindowsVisibility(TBool aVisible);
|
sl@0
|
51 |
|
sl@0
|
52 |
virtual void MoveL();
|
sl@0
|
53 |
|
sl@0
|
54 |
protected:
|
sl@0
|
55 |
CTFlowWindowsController(TInt aNumWindows, TBool aPreload, TSize& aWindowSize, TBool aBouncing, TBool aMoveHorizontal);
|
sl@0
|
56 |
void ConstructL(RArray<TPtrC>& aFileNames, RArray<pTWindowCreatorFunction>& aNewLs, RArray<TPoint>& aInitialPositions);
|
sl@0
|
57 |
void SubmitUpdateL();
|
sl@0
|
58 |
|
sl@0
|
59 |
protected:
|
sl@0
|
60 |
RWsSession iWs;
|
sl@0
|
61 |
RWindowGroup iWinGroup;
|
sl@0
|
62 |
CWsScreenDevice* iScreenDev;
|
sl@0
|
63 |
CSurfaceUtility* iUtility;
|
sl@0
|
64 |
|
sl@0
|
65 |
RArray<CTWindow*> iFlowWindows;
|
sl@0
|
66 |
RArray<TPtrC> iFileNames;
|
sl@0
|
67 |
|
sl@0
|
68 |
RRegion iWindowsRegion;
|
sl@0
|
69 |
|
sl@0
|
70 |
TSize iWindowSize;
|
sl@0
|
71 |
TRect iScreenRect;
|
sl@0
|
72 |
TBool iPreload;
|
sl@0
|
73 |
TInt iNumWindows;
|
sl@0
|
74 |
TInt iDeltaX;
|
sl@0
|
75 |
TInt iDeltaY;
|
sl@0
|
76 |
TBool iBouncing;
|
sl@0
|
77 |
};
|
sl@0
|
78 |
|
sl@0
|
79 |
|
sl@0
|
80 |
inline TInt CTFlowWindowsController::NumberOfWindows() const
|
sl@0
|
81 |
{
|
sl@0
|
82 |
return iNumWindows;
|
sl@0
|
83 |
}
|
sl@0
|
84 |
|
sl@0
|
85 |
/**
|
sl@0
|
86 |
Sets the rate at which the images are scrolled.
|
sl@0
|
87 |
|
sl@0
|
88 |
@param aSpeed The number of pixels to move the image each cycle.
|
sl@0
|
89 |
*/
|
sl@0
|
90 |
inline void CTFlowWindowsController::SetFlowRate(TInt aFlowRate)
|
sl@0
|
91 |
{
|
sl@0
|
92 |
if (iDeltaX > 0)
|
sl@0
|
93 |
{
|
sl@0
|
94 |
iDeltaX = aFlowRate;
|
sl@0
|
95 |
}
|
sl@0
|
96 |
else
|
sl@0
|
97 |
{
|
sl@0
|
98 |
iDeltaY = aFlowRate;
|
sl@0
|
99 |
}
|
sl@0
|
100 |
}
|
sl@0
|
101 |
|
sl@0
|
102 |
|
sl@0
|
103 |
|
sl@0
|
104 |
#endif /*TFLOWINDOWSCONTROLLER_H*/
|