|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef ALFPERFAPPSUITETESTCASESCROLL_H_ |
|
19 #define ALFPERFAPPSUITETESTCASESCROLL_H_ |
|
20 |
|
21 // INLUDES |
|
22 #include "AlfPerfAppSuiteTestCaseControl.h" |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CAlfImageLoaderUtil; |
|
26 class CAlfImageVisual; |
|
27 class CAlfViewportLayout; |
|
28 class CAlfGridLayout; |
|
29 class CAlfPerfAppSuiteTestCase; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 class CAlfPerfAppSuiteTestCaseScroll : public CAlfPerfAppSuiteTestCaseControl |
|
33 { |
|
34 private: |
|
35 |
|
36 enum TTextStyle |
|
37 { |
|
38 EPersonSuiteBig = 0, |
|
39 EPersonSuiteSmall, |
|
40 ENumberOfStyles |
|
41 }; |
|
42 public: // Construction and destrcution |
|
43 |
|
44 /** |
|
45 * C++ constructor. |
|
46 * @param aAppSuiteTestCase used as observer |
|
47 */ |
|
48 CAlfPerfAppSuiteTestCaseScroll(CAlfPerfAppSuiteTestCase* aAppSuiteTestCase); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CAlfPerfAppSuiteTestCaseScroll(); |
|
54 |
|
55 /** |
|
56 * Second phase constructor. |
|
57 * @param aEnv Alf environment. |
|
58 * @param aCaseId Testcase id. |
|
59 * @param aVisibleArea Screen area to use. |
|
60 */ |
|
61 virtual void ConstructL( |
|
62 CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea ); |
|
63 public: // From CAlfPerfAppSuiteTestCaseControl |
|
64 |
|
65 /** |
|
66 * Starts execution. |
|
67 * If this method leaves, then request must not be completed. |
|
68 * By default, this method completes immediately. |
|
69 */ |
|
70 virtual void DoStartExecuteL(); |
|
71 |
|
72 /** |
|
73 * Handles events. |
|
74 * @param aEvent event to be handled. |
|
75 * @return ETrue if consumed, EFalse otherwise. |
|
76 */ |
|
77 virtual TBool OfferEventL( const TAlfEvent& aEvent ); |
|
78 /** |
|
79 * Sets visible area. |
|
80 * @param aVisibleArea visible area. |
|
81 */ |
|
82 virtual void SetVisibleArea( const TRect& aVisibleArea ); |
|
83 |
|
84 /** |
|
85 * Informs that all textures have been loaded. |
|
86 * @param aErrorCode error code of texture loading |
|
87 */ |
|
88 void ImagesLoaded( TInt aErrorCode ); |
|
89 |
|
90 private: // New functions |
|
91 |
|
92 void CreateTextStylesL(); |
|
93 |
|
94 /** |
|
95 * Starts the next animation cycle. |
|
96 */ |
|
97 void NextCycleL(); |
|
98 |
|
99 void ConstructPictureNumberSuiteL( |
|
100 CAlfLayout* aParentLayout, |
|
101 const TAlfImage& aImage, |
|
102 const TInt aNumber ); |
|
103 |
|
104 void ConstructPeopleSuiteL( |
|
105 CAlfLayout* aParentLayout ); |
|
106 |
|
107 CAlfGridLayout* ConstructPeopleSuiteListItemLayoutL( |
|
108 CAlfLayout* aParentLayout, |
|
109 TBool aSelected = EFalse ); |
|
110 |
|
111 CAlfGridLayout* ConstructPeopleSuiteListItemTextLayoutL( |
|
112 CAlfLayout* aParentLayout ); |
|
113 |
|
114 void ConstructPeopleSuiteListHeaderL( |
|
115 CAlfLayout* aParentLayout, |
|
116 const TAlfImage& aImage, |
|
117 const TDesC& aText ); |
|
118 |
|
119 void ConstructPeopleSuiteListItemL( |
|
120 CAlfLayout* aParentLayout, |
|
121 const TDesC& aName, |
|
122 const TDesC& aDescription, |
|
123 TBool aSelected = EFalse ); |
|
124 |
|
125 private: // Data |
|
126 /** |
|
127 * Cycle counter. |
|
128 */ |
|
129 TInt iCycleCounter; |
|
130 |
|
131 /** |
|
132 * Image loader utility. |
|
133 * Owned. |
|
134 */ |
|
135 CAlfImageLoaderUtil* iLoader; |
|
136 |
|
137 |
|
138 /** |
|
139 * Pointer to viewport layout. |
|
140 * Not owned. |
|
141 */ |
|
142 CAlfViewportLayout* iViewPortLayout; |
|
143 |
|
144 /** |
|
145 * Current viewport position. |
|
146 */ |
|
147 TAlfRealPoint iViewPortPos; |
|
148 |
|
149 TInt iSuiteWidth; |
|
150 |
|
151 /** |
|
152 * Number of application suites in this testcase. |
|
153 */ |
|
154 TInt iSuiteCount; |
|
155 |
|
156 |
|
157 /** |
|
158 * Lenghts of one trasition cycle. |
|
159 */ |
|
160 TInt iCycleLenght; |
|
161 |
|
162 RArray<TInt> iTextStyles; |
|
163 |
|
164 /** |
|
165 * If it equals to iSuiteCount, |
|
166 * that means all application suites have loaded their textures. |
|
167 */ |
|
168 TInt iLoadedImages; |
|
169 |
|
170 /** |
|
171 * Used for callback. |
|
172 * Not owned. |
|
173 */ |
|
174 CAlfPerfAppSuiteTestCase* iAppSuiteTestCase; |
|
175 }; |
|
176 |
|
177 #endif /*ALFPERFAPPSUITETESTCASESCROLL_H_*/ |
|
178 |
|
179 // end of file |
|
180 |