|
1 /* |
|
2 * Copyright (c) 2009 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: AknPhysics parameter provider |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AKNPHYSICSPARAMETERPROVIDER_H |
|
20 #define C_AKNPHYSICSPARAMETERPROVIDER_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "aknphysicscenreplistener.h" |
|
25 |
|
26 class CRepository; |
|
27 |
|
28 /** |
|
29 * ODE parameter provider |
|
30 * |
|
31 */ |
|
32 NONSHARABLE_CLASS( CAknPhysicsParameterProvider ) : public CBase, |
|
33 public MAknPhysicsCenRepObserver |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CAknPhysicsParameterProvider* NewL(); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CAknPhysicsParameterProvider* NewLC(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CAknPhysicsParameterProvider(); |
|
52 |
|
53 /** |
|
54 * Returns view mass value. |
|
55 * |
|
56 * @return View mass value. |
|
57 */ |
|
58 TInt ViewMass() const; |
|
59 |
|
60 /** |
|
61 * Returns gravity value. |
|
62 * |
|
63 * @return Gravity value. |
|
64 */ |
|
65 TInt Gravity() const; |
|
66 |
|
67 /** |
|
68 * Returns surface erp value. |
|
69 * |
|
70 * @return Surface erp value. |
|
71 */ |
|
72 TInt SurfaceErp() const; |
|
73 |
|
74 /** |
|
75 * Returns surface cfm value. |
|
76 * |
|
77 * @return Surface cfm value. |
|
78 */ |
|
79 TInt SurfaceCfm() const; |
|
80 |
|
81 /** |
|
82 * Returns highlight timeout value. |
|
83 * |
|
84 * @return Highlight timeout value. |
|
85 */ |
|
86 TInt HighlightTimeout() const; |
|
87 |
|
88 /** |
|
89 * Returns drag threshold value. |
|
90 * |
|
91 * @return Drag threshold value. |
|
92 */ |
|
93 TInt DragThreshold() const; |
|
94 |
|
95 /** |
|
96 * Returns frame delay value. |
|
97 * |
|
98 * @return Frame delay value. |
|
99 */ |
|
100 TInt FrameDelay() const; |
|
101 |
|
102 /** |
|
103 * Returns min frame interval value. |
|
104 * |
|
105 * @return Min frame interval value. |
|
106 */ |
|
107 TInt MinFrameInterval() const; |
|
108 |
|
109 /** |
|
110 * Returns ETrue if ode feature is enabled. |
|
111 * |
|
112 * @return ETrue if feature is enabled. |
|
113 */ |
|
114 static TBool FeatureEnabled(); |
|
115 |
|
116 /** |
|
117 * Returns short list empty space value. |
|
118 * |
|
119 * @return Short list empty space value. |
|
120 */ |
|
121 TInt ShortListEmptySpace() const; |
|
122 |
|
123 /** |
|
124 * Returns long list empty space value. |
|
125 * |
|
126 * @return Long list empty space value. |
|
127 */ |
|
128 TInt LongListEmptySpace() const; |
|
129 |
|
130 /** |
|
131 * Returns whether FPS logging is enabled. |
|
132 */ |
|
133 TBool FpsLoggingEnabled() const; |
|
134 |
|
135 // from base class MAknPhysicsCenRepObserver |
|
136 |
|
137 /** |
|
138 * Informs the observer that the cenrep |
|
139 * value have been changed. |
|
140 * |
|
141 * @param aKey CenRep value key. |
|
142 */ |
|
143 void CenRepValueChanged( const TInt& aKey ); |
|
144 |
|
145 private: |
|
146 |
|
147 /** |
|
148 * C++ constructor. |
|
149 */ |
|
150 CAknPhysicsParameterProvider(); |
|
151 |
|
152 /** |
|
153 * Symbian second-phase constructor. |
|
154 */ |
|
155 void ConstructL(); |
|
156 |
|
157 /** |
|
158 * Reads ode parameters from cen rep. |
|
159 */ |
|
160 void ReadValuesFromCenRepL(); |
|
161 |
|
162 /** |
|
163 * Sets ode parameters as defaults. |
|
164 * |
|
165 * @param aWriteToCenRep ETrue if values should be written to cen rep. |
|
166 */ |
|
167 void SetDefaultValues( TBool aWriteToCenRep ); |
|
168 |
|
169 /** |
|
170 * Checks are the values set. |
|
171 */ |
|
172 TBool ValuesAreSet(); |
|
173 |
|
174 private: // data |
|
175 |
|
176 /** |
|
177 * Central repository. |
|
178 * Own. |
|
179 */ |
|
180 CRepository* iCenRep; |
|
181 |
|
182 /** |
|
183 * View mass value. |
|
184 */ |
|
185 TInt iViewMass; |
|
186 |
|
187 /** |
|
188 * Gravity value. |
|
189 */ |
|
190 TInt iGravity; |
|
191 |
|
192 /** |
|
193 * Surface erp value. |
|
194 */ |
|
195 TInt iSurfaceErp; |
|
196 |
|
197 /** |
|
198 * Surface cfm value. |
|
199 */ |
|
200 TInt iSurfaceCfm; |
|
201 |
|
202 /** |
|
203 * Highlight timeout value. |
|
204 */ |
|
205 TInt iHighlightTimeout; |
|
206 |
|
207 /** |
|
208 * Drag threshold value. |
|
209 */ |
|
210 TInt iDragThreshold; |
|
211 |
|
212 /** |
|
213 * Frame delay value. |
|
214 */ |
|
215 TInt iFrameDelay; |
|
216 |
|
217 /** |
|
218 * Min frame interval value. |
|
219 */ |
|
220 TInt iMinFrameInterval; |
|
221 |
|
222 /** |
|
223 * Empty space percent in short lists. |
|
224 */ |
|
225 TInt iShortListEmptySpace; |
|
226 |
|
227 /** |
|
228 * Empty space percent in long lists. |
|
229 */ |
|
230 TInt iLongListEmptySpace; |
|
231 |
|
232 /** |
|
233 * FPS logging enabled / disabled. |
|
234 */ |
|
235 TBool iFpsLoggingEnabled; |
|
236 |
|
237 /** |
|
238 * CenRep listener. |
|
239 * Own. |
|
240 */ |
|
241 CAknPhysicsCenRepListener* iListener; |
|
242 |
|
243 }; |
|
244 |
|
245 |
|
246 #endif // C_AKNPHYSICSPARAMETERPROVIDER_H |