author | eckhart.koppen@nokia.com |
Wed, 31 Mar 2010 11:06:36 +0300 | |
changeset 7 | f7bc934e204c |
parent 3 | 41300fa6a67c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the utility applications of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
// INCLUDE FILES |
|
43 |
||
44 |
#include <avkon.rsg> |
|
45 |
#include <avkon.hrh> |
|
46 |
#include "pm_mapper.hrh" |
|
47 |
#include "pm_mapperapp.h" |
|
48 |
#include "pm_mapperview.h" |
|
49 |
#include <pm_mapper.rsg> |
|
50 |
||
51 |
#include <BldVariant.hrh> |
|
52 |
||
53 |
#include <w32std.h> |
|
54 |
#include <apgwgnam.h> |
|
55 |
#include <eikstart.h> |
|
56 |
#include <eikenv.h> |
|
57 |
#include <f32file.h> |
|
58 |
||
59 |
#include <avkon.hrh> |
|
60 |
#include <aknenv.h> |
|
61 |
||
62 |
#include <aknnotedialog.h> |
|
63 |
#include <stringloader.h> |
|
64 |
#include <coneresloader.h> |
|
65 |
#include <aknglobalnote.h> |
|
66 |
||
67 |
#include <CentralRepository.h> |
|
68 |
||
69 |
#include <Aknsutils.h> |
|
70 |
#include <AknUtils.h> |
|
71 |
#include "pixel_metrics.h" |
|
72 |
||
73 |
#include <avkon.mbg> |
|
74 |
||
75 |
#include <AknLayoutConfig.h> |
|
76 |
#include <aknsgcc.h> |
|
77 |
||
78 |
typedef TBuf<2048> TMySmallBuffer; |
|
79 |
typedef TBuf<8192> TMyBigBuffer; |
|
80 |
||
81 |
_LIT(KLayoutSourceFileAndPath, "\\private\\2002121f\\pm_layout.cpp"); |
|
82 |
_LIT(KPixelMetricsDataFiles, "\\private\\2002121f\\*.txt"); |
|
83 |
_LIT(KOpenBrace, "{"); |
|
84 |
_LIT(KComma, ","); |
|
85 |
_LIT(KColon, ":"); |
|
86 |
_LIT(KTab, "\t"); |
|
87 |
_LIT(KEndBraceWithCommaAndCRLF, "},\n"); |
|
88 |
_LIT(KCRLF, "\n"); |
|
89 |
||
90 |
// Number of header lines in layout data. |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
const TInt KHeaderValues = 4; |
0 | 92 |
|
93 |
// ============================ MEMBER FUNCTIONS =============================== |
|
94 |
||
95 |
// ----------------------------------------------------------------------------- |
|
96 |
// C++ constructor can NOT contain any code, that |
|
97 |
// might leave. |
|
98 |
// ----------------------------------------------------------------------------- |
|
99 |
// |
|
100 |
CPixelMetricsMapperAppUi::CPixelMetricsMapperAppUi() : iFileOutputOn(EFalse) |
|
101 |
{ |
|
102 |
} |
|
103 |
||
104 |
// ----------------------------------------------------------------------------- |
|
105 |
// Destructor. |
|
106 |
// ----------------------------------------------------------------------------- |
|
107 |
// |
|
108 |
CPixelMetricsMapperAppUi::~CPixelMetricsMapperAppUi() |
|
109 |
{ |
|
110 |
} |
|
111 |
||
112 |
// ----------------------------------------------------------------------------- |
|
113 |
// Symbian 2nd phase constructor can leave. |
|
114 |
// ----------------------------------------------------------------------------- |
|
115 |
// |
|
116 |
void CPixelMetricsMapperAppUi::ConstructL() |
|
117 |
{ |
|
118 |
BaseConstructL(); |
|
119 |
||
120 |
CEikonEnv& eikEnv = *CEikonEnv::Static(); |
|
121 |
||
122 |
eikEnv.WsSession().ComputeMode( |
|
123 |
RWsSession::EPriorityControlDisabled ); |
|
124 |
RThread().SetProcessPriority( EPriorityHigh ); |
|
125 |
||
126 |
CPixelMetricsMapperView* view = new( ELeave ) CPixelMetricsMapperView; |
|
127 |
CleanupStack::PushL( view ); |
|
128 |
view->ConstructL(); |
|
129 |
CleanupStack::Pop(); // view |
|
130 |
AddViewL(view); // transfer ownership to CAknViewAppUi |
|
131 |
iView = view; |
|
132 |
} |
|
133 |
||
134 |
// ----------------------------------------------------------------------------- |
|
135 |
// |
|
136 |
// ----------------------------------------------------------------------------- |
|
137 |
// |
|
138 |
TKeyResponse CPixelMetricsMapperAppUi::HandleKeyEventL( |
|
139 |
const TKeyEvent& /*aKeyEvent*/, |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
140 |
TEventCode /*aType*/ ) |
0 | 141 |
{ |
142 |
return EKeyWasNotConsumed; |
|
143 |
} |
|
144 |
||
145 |
// ----------------------------------------------------------------------------- |
|
146 |
// |
|
147 |
// ----------------------------------------------------------------------------- |
|
148 |
// |
|
149 |
void CPixelMetricsMapperAppUi::HandleCommandL( TInt aCommand ) |
|
150 |
{ |
|
151 |
switch ( aCommand ) |
|
152 |
{ |
|
153 |
case EAknSoftkeyExit: |
|
154 |
case EEikCmdExit: |
|
155 |
Exit(); |
|
156 |
break; |
|
157 |
case ECmdSwitchOutput: |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
158 |
{ |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
159 |
HBufC* buffer = HBufC::NewLC( 100 ); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
160 |
TPtr bufferPtr = buffer->Des(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
TBool last = ETrue; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
bufferPtr.Append(_L("Output switched to ")); |
0 | 163 |
iFileOutputOn = !iFileOutputOn; |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
if (iFileOutputOn) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
bufferPtr.Append(_L("file.")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
else |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
bufferPtr.Append(_L("screen.")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
168 |
ShowL( *buffer, last ); |
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
169 |
} |
0 | 170 |
break; |
171 |
case ECmdStatus: |
|
172 |
{ |
|
173 |
ClearL(); |
|
174 |
||
175 |
// layout |
|
176 |
HBufC* buffer = HBufC::NewLC( 100 ); |
|
177 |
TPtr bufferPtr = buffer->Des(); |
|
178 |
TBool last = ETrue; |
|
179 |
||
180 |
// Orientation |
|
181 |
bufferPtr.Append(_L("Orientation: ")); |
|
182 |
bufferPtr.AppendNum((TInt)iAvkonAppUi->Orientation()); |
|
183 |
ShowL( *buffer, last ); |
|
184 |
bufferPtr.Zero(); |
|
185 |
||
186 |
// Output |
|
187 |
bufferPtr.Append(_L("Output: ")); |
|
188 |
if (iFileOutputOn) bufferPtr.Append(_L("File")); |
|
189 |
else bufferPtr.Append(_L("Screen")); |
|
190 |
ShowL( *buffer, last ); |
|
191 |
bufferPtr.Zero(); |
|
192 |
||
193 |
CAknLayoutConfig::TScreenMode localAppScreenMode = CAknSgcClient::ScreenMode(); |
|
194 |
TInt hashValue = localAppScreenMode.ScreenStyleHash(); |
|
195 |
TPixelsTwipsAndRotation pixels = CAknSgcClient::PixelsAndRotation(); |
|
196 |
TSize pixelSize = pixels.iPixelSize; |
|
197 |
||
198 |
bufferPtr.Append(_L("LayoutName: ")); |
|
199 |
||
200 |
if ( (pixelSize.iWidth == 320 || pixelSize.iWidth == 240 )&& |
|
201 |
(pixelSize.iHeight == 320 || pixelSize.iHeight == 240 )) |
|
202 |
{ |
|
203 |
if (hashValue==0x996F7AA7) |
|
204 |
bufferPtr.Append(_L("QVGA2")); |
|
205 |
else |
|
206 |
bufferPtr.Append(_L("QVGA1")); |
|
207 |
} |
|
208 |
else if ((pixelSize.iWidth == 640 || pixelSize.iWidth == 360 )&& |
|
209 |
(pixelSize.iHeight == 360 || pixelSize.iHeight == 640 )) |
|
210 |
{ |
|
211 |
bufferPtr.Append(_L("nHD")); |
|
212 |
} |
|
213 |
else if ((pixelSize.iWidth == 640 || pixelSize.iWidth == 480 )&& |
|
214 |
(pixelSize.iHeight == 480 || pixelSize.iHeight == 640 )) |
|
215 |
{ |
|
216 |
bufferPtr.Append(_L("VGA")); |
|
217 |
} |
|
218 |
else if ((pixelSize.iWidth == 352 || pixelSize.iWidth == 800 )&& |
|
219 |
(pixelSize.iHeight == 800 || pixelSize.iHeight == 352 )) |
|
220 |
{ |
|
221 |
bufferPtr.Append(_L("E90")); |
|
222 |
} |
|
223 |
else if ((pixelSize.iWidth == 320 || pixelSize.iWidth == 480 || |
|
224 |
pixelSize.iWidth == 240 || pixelSize.iWidth == 640 )&& |
|
225 |
(pixelSize.iHeight == 320 || pixelSize.iHeight == 480 || |
|
226 |
pixelSize.iHeight == 240 || pixelSize.iHeight == 640)) |
|
227 |
{ |
|
228 |
bufferPtr.Append(_L("HVGA")); |
|
229 |
} |
|
230 |
else if ((pixelSize.iWidth == 480 || pixelSize.iWidth == 854 || |
|
231 |
pixelSize.iWidth == 848 || pixelSize.iWidth == 800 )&& |
|
232 |
(pixelSize.iHeight == 800 || pixelSize.iHeight == 480 || |
|
233 |
pixelSize.iHeight == 848 || pixelSize.iHeight == 854)) |
|
234 |
{ |
|
235 |
bufferPtr.Append(_L("WVGA")); |
|
236 |
} |
|
237 |
else |
|
238 |
{ |
|
239 |
bufferPtr.Append(_L("Unknown")); |
|
240 |
} |
|
241 |
||
242 |
ShowL( *buffer, last ); |
|
243 |
bufferPtr.Zero(); |
|
244 |
CleanupStack::PopAndDestroy( buffer ); |
|
245 |
} |
|
246 |
break; |
|
247 |
case ECmdSwitchOrientation: |
|
248 |
{ |
|
249 |
ClearL(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
HBufC* buffer = HBufC::NewLC( 100 ); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
TPtr bufferPtr = buffer->Des(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
TBool last = ETrue; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
|
0 | 254 |
#ifndef __SERIES60_31__ |
255 |
if (!iAvkonAppUi->OrientationCanBeChanged()) |
|
256 |
{ |
|
257 |
bufferPtr.Append(_L("Orientation cannot be changed.")); |
|
258 |
ShowL( *buffer, last ); |
|
259 |
bufferPtr.Zero(); |
|
260 |
delete buffer; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
261 |
break; |
0 | 262 |
} |
263 |
#endif //__SERIES60_31__ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
264 |
|
0 | 265 |
if ( iAvkonAppUi->Orientation() == CAknAppUiBase::EAppUiOrientationPortrait) |
266 |
{ |
|
267 |
iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape); |
|
268 |
} |
|
269 |
else if (iAvkonAppUi->Orientation() == CAknAppUiBase::EAppUiOrientationLandscape) |
|
270 |
{ |
|
271 |
iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationPortrait); |
|
272 |
} |
|
273 |
else |
|
274 |
{ |
|
275 |
// unspecified |
|
276 |
iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape); |
|
277 |
} |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
278 |
bufferPtr.Append(_L("Orientation changed.")); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
279 |
ShowL( *buffer, last ); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
280 |
bufferPtr.Zero(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
281 |
delete buffer; |
0 | 282 |
break; |
283 |
} |
|
284 |
case ECmdStartCalculations: |
|
285 |
{ |
|
286 |
ClearL(); |
|
287 |
// Get known values |
|
288 |
TInt index = 0; |
|
289 |
TBool last = EFalse; |
|
290 |
if (iFileOutputOn) |
|
291 |
{ |
|
292 |
TRect screenRect; |
|
293 |
AknLayoutUtils::LayoutMetricsRect( |
|
294 |
AknLayoutUtils::EApplicationWindow, |
|
295 |
screenRect ); |
|
296 |
||
297 |
// Add screen dimensions |
|
298 |
TInt height = screenRect.Height(); |
|
299 |
TInt width = screenRect.Width(); |
|
300 |
TBuf16<32> tgt; |
|
301 |
// HEIGTH |
|
302 |
tgt.Append(_L("height: \t")); |
|
303 |
tgt.AppendNum(height, EDecimal); // put max height into text file |
|
304 |
ShowL( tgt, last ); |
|
305 |
tgt.Zero(); |
|
306 |
// WIDTH |
|
307 |
tgt.Append(_L("width: \t")); |
|
308 |
tgt.AppendNum(width, EDecimal); // put max width into text file |
|
309 |
ShowL( tgt, last ); |
|
310 |
tgt.Zero(); |
|
311 |
// VERSION |
|
312 |
TPixelMetricsVersion version = PixelMetrics::Version(); |
|
313 |
tgt.Append(_L("major_version: \t")); |
|
314 |
tgt.AppendNum(version.majorVersion, EDecimal); // put major version into text file |
|
315 |
ShowL( tgt, last ); |
|
316 |
tgt.Zero(); |
|
317 |
tgt.Append(_L("minor_version: \t")); |
|
318 |
tgt.AppendNum(version.minorVersion, EDecimal); // put minor version into text file |
|
319 |
ShowL( tgt, last ); |
|
320 |
tgt.Zero(); |
|
321 |
} |
|
322 |
||
323 |
TInt myValue = KErrNotFound; |
|
324 |
for (;;) |
|
325 |
{ |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
326 |
if (index==QStyle::PM_Custom_MessageBoxHeight) |
0 | 327 |
{ |
328 |
last = ETrue; |
|
329 |
} |
|
330 |
myValue = PixelMetrics::PixelMetricValue(static_cast<QStyle::PixelMetric>(index)); |
|
331 |
ShowSingleValueL( index, myValue, last ); |
|
332 |
||
333 |
if (last) break; |
|
334 |
// if last before custom values, "jump" to custom base |
|
335 |
if (index==QStyle::PM_SubMenuOverlap) index = QStyle::PM_CustomBase; |
|
336 |
index++; |
|
337 |
} |
|
338 |
} |
|
339 |
break; |
|
340 |
case ECmdCreateHeaderFile: |
|
341 |
CreateHeaderFileL(); |
|
342 |
break; |
|
343 |
default: |
|
344 |
break; |
|
345 |
} |
|
346 |
} |
|
347 |
||
348 |
// ----------------------------------------------------------------------------- |
|
349 |
// |
|
350 |
// ----------------------------------------------------------------------------- |
|
351 |
// |
|
352 |
void CPixelMetricsMapperAppUi::ShowL( const TDesC& aText, TBool& aLast, const TBool& aFileOutput ) |
|
353 |
{ |
|
354 |
_LIT( KTestPrefix, "\t" ); |
|
355 |
||
356 |
HBufC* buffer = HBufC::NewLC( aText.Length() + KTestPrefix().Length() ); |
|
357 |
TPtr ptr = buffer->Des(); |
|
358 |
ptr.Append( KTestPrefix ); |
|
359 |
ptr.Append( aText ); |
|
360 |
iView->ShowL( *buffer, aLast, aFileOutput ); |
|
361 |
CleanupStack::PopAndDestroy( buffer ); |
|
362 |
} |
|
363 |
||
364 |
void CPixelMetricsMapperAppUi::ShowSingleValueL(TInt& aPixelMetric, TInt& aValue, TBool& aLast ) |
|
365 |
{ |
|
366 |
HBufC* buffer = HBufC::NewLC( 100 ); |
|
367 |
TPtr bufferPtr = buffer->Des(); |
|
368 |
||
369 |
switch (aPixelMetric) |
|
370 |
{ |
|
371 |
case QStyle::PM_DockWidgetTitleMargin: |
|
372 |
bufferPtr.Append(_L("DockTitleMargin: ")); |
|
373 |
break; |
|
374 |
case QStyle::PM_DockWidgetTitleBarButtonMargin: |
|
375 |
bufferPtr.Append(_L("DockTitleBtnMargin: ")); |
|
376 |
break; |
|
377 |
case QStyle::PM_ButtonMargin: |
|
378 |
bufferPtr.Append(_L("ButtonMargin: ")); |
|
379 |
break; |
|
380 |
case QStyle::PM_ButtonDefaultIndicator: |
|
381 |
bufferPtr.Append(_L("ButtonDefaultIndicator: ")); |
|
382 |
break; |
|
383 |
case QStyle::PM_MdiSubWindowFrameWidth: |
|
384 |
bufferPtr.Append(_L("MdiSubWndFrameW: ")); |
|
385 |
break; |
|
386 |
case QStyle::PM_ComboBoxFrameWidth: |
|
387 |
bufferPtr.Append(_L("ComboBoxFrameWidth: ")); |
|
388 |
break; |
|
389 |
case QStyle::PM_SpinBoxFrameWidth: |
|
390 |
bufferPtr.Append(_L("SpinBoxFrameWidth: ")); |
|
391 |
break; |
|
392 |
case QStyle::PM_DefaultFrameWidth: |
|
393 |
bufferPtr.Append(_L("DefaultFrameWidth: ")); |
|
394 |
break; |
|
395 |
case QStyle::PM_RadioButtonLabelSpacing: |
|
396 |
bufferPtr.Append(_L("RadioButtonLabelSpc: ")); |
|
397 |
break; |
|
398 |
case QStyle::PM_CheckBoxLabelSpacing: |
|
399 |
bufferPtr.Append(_L("CheckBoxLabelSpacing: ")); |
|
400 |
break; |
|
401 |
case QStyle::PM_ToolTipLabelFrameWidth: |
|
402 |
bufferPtr.Append(_L("ToolTipLabelFrameW: ")); |
|
403 |
break; |
|
404 |
case QStyle::PM_ListViewIconSize: |
|
405 |
bufferPtr.Append(_L("ListViewIconSize: ")); |
|
406 |
break; |
|
407 |
case QStyle::PM_LargeIconSize: |
|
408 |
bufferPtr.Append(_L("LargeIconSize: ")); |
|
409 |
break; |
|
410 |
case QStyle::PM_IconViewIconSize: |
|
411 |
bufferPtr.Append(_L("IconViewIconSize: ")); |
|
412 |
break; |
|
413 |
case QStyle::PM_TabBarIconSize: |
|
414 |
bufferPtr.Append(_L("TabBarIconSize: ")); |
|
415 |
break; |
|
416 |
case QStyle::PM_MessageBoxIconSize: |
|
417 |
bufferPtr.Append(_L("MessageBoxIconSize: ")); |
|
418 |
break; |
|
419 |
case QStyle::PM_ButtonIconSize: |
|
420 |
bufferPtr.Append(_L("ButtonIconSize: ")); |
|
421 |
break; |
|
422 |
case QStyle::PM_TextCursorWidth: |
|
423 |
bufferPtr.Append(_L("TextCursorWidth: ")); |
|
424 |
break; |
|
425 |
case QStyle::PM_SliderLength: |
|
426 |
bufferPtr.Append(_L("SliderLength: ")); |
|
427 |
break; |
|
428 |
case QStyle::PM_SliderThickness: |
|
429 |
bufferPtr.Append(_L("SliderThickness: ")); |
|
430 |
break; |
|
431 |
case QStyle::PM_SliderTickmarkOffset: |
|
432 |
bufferPtr.Append(_L("SliderTickmarkOffset: ")); |
|
433 |
break; |
|
434 |
case QStyle::PM_SliderControlThickness: |
|
435 |
bufferPtr.Append(_L("SliderCntrlThickness: ")); |
|
436 |
break; |
|
437 |
case QStyle::PM_SliderSpaceAvailable: |
|
438 |
bufferPtr.Append(_L("SliderSpaceAvailable: ")); |
|
439 |
break; |
|
440 |
case QStyle::PM_MenuBarItemSpacing: |
|
441 |
bufferPtr.Append(_L("MenuBarItemSpacing: ")); |
|
442 |
break; |
|
443 |
case QStyle::PM_MenuBarHMargin: |
|
444 |
bufferPtr.Append(_L("MenuBarHMargin: ")); |
|
445 |
break; |
|
446 |
case QStyle::PM_MenuBarVMargin: |
|
447 |
bufferPtr.Append(_L("MenuBarVMargin: ")); |
|
448 |
break; |
|
449 |
case QStyle::PM_ToolBarItemSpacing: |
|
450 |
bufferPtr.Append(_L("ToolBarItemSpacing: ")); |
|
451 |
break; |
|
452 |
case QStyle::PM_ToolBarFrameWidth: |
|
453 |
bufferPtr.Append(_L("ToolBarFrameWidth: ")); |
|
454 |
break; |
|
455 |
case QStyle::PM_ToolBarItemMargin: |
|
456 |
bufferPtr.Append(_L("ToolBarItemMargin: ")); |
|
457 |
break; |
|
458 |
case QStyle::PM_LayoutLeftMargin: |
|
459 |
bufferPtr.Append(_L("LayoutLeftMargin: ")); |
|
460 |
break; |
|
461 |
case QStyle::PM_LayoutRightMargin: |
|
462 |
bufferPtr.Append(_L("LayoutRightMargin: ")); |
|
463 |
break; |
|
464 |
case QStyle::PM_LayoutTopMargin: |
|
465 |
bufferPtr.Append(_L("LayoutTopMargin: ")); |
|
466 |
break; |
|
467 |
case QStyle::PM_LayoutBottomMargin: |
|
468 |
bufferPtr.Append(_L("LayoutBottomMargin: ")); |
|
469 |
break; |
|
470 |
case QStyle::PM_LayoutHorizontalSpacing: |
|
471 |
bufferPtr.Append(_L("LayoutHSpacing: ")); |
|
472 |
break; |
|
473 |
case QStyle::PM_LayoutVerticalSpacing: |
|
474 |
bufferPtr.Append(_L("LayoutVSpacing: ")); |
|
475 |
break; |
|
476 |
case QStyle::PM_MaximumDragDistance: |
|
477 |
bufferPtr.Append(_L("MaxDragDistance: ")); |
|
478 |
break; |
|
479 |
case QStyle::PM_ScrollBarExtent: |
|
480 |
bufferPtr.Append(_L("ScrollBarExtent: ")); |
|
481 |
break; |
|
482 |
case QStyle::PM_ScrollBarSliderMin: |
|
483 |
bufferPtr.Append(_L("ScrollBarSliderMin: ")); |
|
484 |
break; |
|
485 |
case QStyle::PM_MenuBarPanelWidth: |
|
486 |
bufferPtr.Append(_L("MenuBarPanelWidth: ")); |
|
487 |
break; |
|
488 |
case QStyle::PM_ProgressBarChunkWidth: |
|
489 |
bufferPtr.Append(_L("ProgBarChunkWidth: ")); |
|
490 |
break; |
|
491 |
case QStyle::PM_TabBarTabOverlap: |
|
492 |
bufferPtr.Append(_L("TabBarTabOverlap: ")); |
|
493 |
break; |
|
494 |
case QStyle::PM_TabBarTabHSpace: |
|
495 |
bufferPtr.Append(_L("TabBarTabHSpace: ")); |
|
496 |
break; |
|
497 |
case QStyle::PM_TabBarTabVSpace: |
|
498 |
bufferPtr.Append(_L("TabBarTabVSpace: ")); |
|
499 |
break; |
|
500 |
case QStyle::PM_TabBarBaseHeight: |
|
501 |
bufferPtr.Append(_L("TabBarBaseHeight: ")); |
|
502 |
break; |
|
503 |
case QStyle::PM_TabBarBaseOverlap: |
|
504 |
bufferPtr.Append(_L("TabBarBaseOverlap: ")); |
|
505 |
break; |
|
506 |
case QStyle::PM_TabBarScrollButtonWidth: |
|
507 |
bufferPtr.Append(_L("TabBarScrollBtnWidth: ")); |
|
508 |
break; |
|
509 |
case QStyle::PM_TabBarTabShiftHorizontal: |
|
510 |
bufferPtr.Append(_L("TabBarTabShiftH: ")); |
|
511 |
break; |
|
512 |
case QStyle::PM_TabBarTabShiftVertical: |
|
513 |
bufferPtr.Append(_L("TabBarTabShiftV: ")); |
|
514 |
break; |
|
515 |
case QStyle::PM_MenuPanelWidth: |
|
516 |
bufferPtr.Append(_L("MenuPanelWidth: ")); |
|
517 |
break; |
|
518 |
case QStyle::PM_MenuHMargin: |
|
519 |
bufferPtr.Append(_L("MenuHMargin: ")); |
|
520 |
break; |
|
521 |
case QStyle::PM_MenuVMargin: |
|
522 |
bufferPtr.Append(_L("MenuVMargin: ")); |
|
523 |
break; |
|
524 |
case QStyle::PM_MenuDesktopFrameWidth: |
|
525 |
bufferPtr.Append(_L("MenuFrameWidth: ")); |
|
526 |
break; |
|
527 |
case QStyle::PM_SmallIconSize: |
|
528 |
bufferPtr.Append(_L("SmallIconSize: ")); |
|
529 |
break; |
|
530 |
case QStyle::PM_FocusFrameHMargin: |
|
531 |
bufferPtr.Append(_L("FocusFrameHMargin: ")); |
|
532 |
break; |
|
533 |
case QStyle::PM_FocusFrameVMargin: |
|
534 |
bufferPtr.Append(_L("FocusFrameVMargin: ")); |
|
535 |
break; |
|
536 |
case QStyle::PM_ToolBarIconSize: |
|
537 |
bufferPtr.Append(_L("ToolBarIconSize: ")); |
|
538 |
break; |
|
539 |
case QStyle::PM_TitleBarHeight: // use titlepane height |
|
540 |
bufferPtr.Append(_L("TitleBarHeight: ")); |
|
541 |
break; |
|
542 |
case QStyle::PM_IndicatorWidth: |
|
543 |
bufferPtr.Append(_L("IndicatorWidth: ")); |
|
544 |
break; |
|
545 |
case QStyle::PM_IndicatorHeight: |
|
546 |
bufferPtr.Append(_L("IndicatorHeight: ")); |
|
547 |
break; |
|
548 |
case QStyle::PM_ExclusiveIndicatorHeight: |
|
549 |
bufferPtr.Append(_L("ExclusiveIndHeight: ")); |
|
550 |
break; |
|
551 |
case QStyle::PM_ExclusiveIndicatorWidth: |
|
552 |
bufferPtr.Append(_L("ExclusiveIndWidth: ")); |
|
553 |
break; |
|
554 |
case QStyle::PM_HeaderMargin: // not in S60 |
|
555 |
bufferPtr.Append(_L("HeaderMargin: ")); |
|
556 |
break; |
|
557 |
case QStyle::PM_MenuScrollerHeight: // not in S60 |
|
558 |
bufferPtr.Append(_L("MenuScrollerHeight: ")); |
|
559 |
break; |
|
560 |
case QStyle::PM_MenuTearoffHeight: // not in S60 |
|
561 |
bufferPtr.Append(_L("MenuTearoffHeight: ")); |
|
562 |
break; |
|
563 |
case QStyle::PM_DockWidgetFrameWidth: // not in S60 |
|
564 |
bufferPtr.Append(_L("DockFrameWidth: ")); |
|
565 |
break; |
|
566 |
case QStyle::PM_DockWidgetSeparatorExtent: // not in S60 |
|
567 |
bufferPtr.Append(_L("DockSepExtent: ")); |
|
568 |
break; |
|
569 |
case QStyle::PM_MdiSubWindowMinimizedWidth: //no such thing in S60 |
|
570 |
bufferPtr.Append(_L("MdiSubWndMinWidth: ")); |
|
571 |
break; |
|
572 |
case QStyle::PM_HeaderGripMargin: // not in S60 |
|
573 |
bufferPtr.Append(_L("HeaderGripMargin: ")); |
|
574 |
break; |
|
575 |
case QStyle::PM_SplitterWidth: // not in S60 |
|
576 |
bufferPtr.Append(_L("SplitterWidth: ")); |
|
577 |
break; |
|
578 |
case QStyle::PM_ToolBarExtensionExtent: // not in S60 |
|
579 |
bufferPtr.Append(_L("ToolBarExtExtent: ")); |
|
580 |
break; |
|
581 |
case QStyle::PM_ToolBarSeparatorExtent: // not in S60 |
|
582 |
bufferPtr.Append(_L("ToolBarSepExtent: ")); |
|
583 |
break; |
|
584 |
case QStyle::PM_ToolBarHandleExtent: // not in s60 |
|
585 |
bufferPtr.Append(_L("ToolBarHandleExtent: ")); |
|
586 |
break; |
|
587 |
case QStyle::PM_MenuButtonIndicator: // none??? |
|
588 |
bufferPtr.Append(_L("MenuButtonIndicator: ")); |
|
589 |
break; |
|
590 |
case QStyle::PM_ButtonShiftHorizontal: //none in 3.x |
|
591 |
bufferPtr.Append(_L("ButtonShiftHorizontal: ")); |
|
592 |
break; |
|
593 |
case QStyle::PM_ButtonShiftVertical: // none in 3.x |
|
594 |
bufferPtr.Append(_L("ButtonShiftVertical: ")); |
|
595 |
break; |
|
596 |
case QStyle::PM_TabBar_ScrollButtonOverlap: // not used in S60 - tab arrows are on left and right side of tab group - not together |
|
597 |
bufferPtr.Append(_L("TabScrollBtnOverlap: ")); |
|
598 |
break; |
|
599 |
case QStyle::PM_SizeGripSize: // use default |
|
600 |
bufferPtr.Append(_L("SizeGripSize: ")); |
|
601 |
break; |
|
602 |
case QStyle::PM_DockWidgetHandleExtent: |
|
603 |
bufferPtr.Append(_L("DockWdgtHandleExt: ")); |
|
604 |
break; |
|
605 |
case QStyle::PM_CheckListButtonSize: |
|
606 |
bufferPtr.Append(_L("CheckListButtonSize: ")); |
|
607 |
break; |
|
608 |
case QStyle::PM_CheckListControllerSize: |
|
609 |
bufferPtr.Append(_L("CheckListCntlerSize: ")); |
|
610 |
break; |
|
611 |
case QStyle::PM_DialogButtonsSeparator: |
|
612 |
bufferPtr.Append(_L("DialogBtnSeparator: ")); |
|
613 |
break; |
|
614 |
case QStyle::PM_DialogButtonsButtonWidth: |
|
615 |
bufferPtr.Append(_L("DialogBtnWidth: ")); |
|
616 |
break; |
|
617 |
case QStyle::PM_DialogButtonsButtonHeight: |
|
618 |
bufferPtr.Append(_L("DialogBtnHeight: ")); |
|
619 |
break; |
|
620 |
case QStyle::PM_HeaderMarkSize: |
|
621 |
bufferPtr.Append(_L("HeaderMarkSize: ")); |
|
622 |
break; |
|
623 |
case QStyle::PM_SpinBoxSliderHeight: |
|
624 |
bufferPtr.Append(_L("SpinBoxSliderHeight: ")); |
|
625 |
break; |
|
626 |
case QStyle::PM_DefaultTopLevelMargin: |
|
627 |
bufferPtr.Append(_L("DefaultTopLvlMrg: ")); |
|
628 |
break; |
|
629 |
case QStyle::PM_DefaultChildMargin: |
|
630 |
bufferPtr.Append(_L("DefaultChildMrg: ")); |
|
631 |
break; |
|
632 |
case QStyle::PM_DefaultLayoutSpacing: |
|
633 |
bufferPtr.Append(_L("DefaultlayoutSpc: ")); |
|
634 |
break; |
|
635 |
case QStyle::PM_TabCloseIndicatorWidth: |
|
636 |
bufferPtr.Append(_L("TabCloseIndWidth: ")); |
|
637 |
break; |
|
638 |
case QStyle::PM_TabCloseIndicatorHeight: |
|
639 |
bufferPtr.Append(_L("TabCloseIndHeight: ")); |
|
640 |
break; |
|
641 |
case QStyle::PM_ScrollView_ScrollBarSpacing: |
|
642 |
bufferPtr.Append(_L("ScrollViewBarSpc: ")); |
|
643 |
break; |
|
644 |
case QStyle::PM_SubMenuOverlap: |
|
645 |
bufferPtr.Append(_L("SubMenuOverlap: ")); |
|
646 |
break; |
|
647 |
case QStyle::PM_Custom_FrameCornerHeight: |
|
648 |
bufferPtr.Append(_L("C_FrCornerHeight: ")); |
|
649 |
break; |
|
650 |
case QStyle::PM_Custom_FrameCornerWidth: |
|
651 |
bufferPtr.Append(_L("C_FrCornerWidth: ")); |
|
652 |
break; |
|
653 |
case QStyle::PM_Custom_ThinLineWidth: |
|
654 |
bufferPtr.Append(_L("C_ThinLineWidth: ")); |
|
655 |
break; |
|
656 |
case QStyle::PM_Custom_BoldLineWidth: |
|
657 |
bufferPtr.Append(_L("C_BoldLineWidth: ")); |
|
658 |
break; |
|
7
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
659 |
case QStyle::PM_Custom_MessageBoxHeight: |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
660 |
bufferPtr.Append(_L("C_MsgBoxHeight: ")); |
f7bc934e204c
5cabc75a39ca2f064f70b40f72ed93c74c4dc19b
eckhart.koppen@nokia.com
parents:
3
diff
changeset
|
661 |
break; |
0 | 662 |
default: |
663 |
bufferPtr.Append(_L("Default: ")); |
|
664 |
break; |
|
665 |
} |
|
666 |
||
667 |
if (iFileOutputOn) |
|
668 |
{ |
|
669 |
bufferPtr.Append('\t'); |
|
670 |
} |
|
671 |
bufferPtr.AppendNum(aValue); |
|
672 |
bufferPtr.Append(_L(" ")); |
|
673 |
ShowL( *buffer, aLast, iFileOutputOn ); |
|
674 |
CleanupStack::PopAndDestroy( buffer ); |
|
675 |
} |
|
676 |
||
677 |
void CPixelMetricsMapperAppUi::ClearL() |
|
678 |
{ |
|
679 |
iView->ClearL(); |
|
680 |
} |
|
681 |
||
682 |
void CPixelMetricsMapperAppUi::CreateHeaderFileL() const |
|
683 |
{ |
|
684 |
// Open/create resulting file. |
|
685 |
RFile file; |
|
686 |
HBufC* layoutFile = HBufC::NewLC( KMaxFileName ); |
|
687 |
*layoutFile = KLayoutSourceFileAndPath; |
|
688 |
TFileName fileName = *layoutFile; |
|
689 |
CleanupStack::PopAndDestroy(layoutFile); |
|
690 |
RFs& fs = CEikonEnv::Static()->FsSession(); |
|
691 |
TInt error = file.Open(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText ); |
|
692 |
if (error==KErrNotFound) |
|
693 |
{ |
|
694 |
file.Create(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText); |
|
695 |
} |
|
696 |
CleanupClosePushL( file ); |
|
697 |
file.SetSize( 0 ); |
|
698 |
||
699 |
// Make all writes as from textfile. |
|
700 |
TFileText textFile; |
|
701 |
textFile.Set( file ); |
|
702 |
textFile.Seek( ESeekStart ); |
|
703 |
||
704 |
// Take all layout files from private folder. |
|
705 |
CDir* dirList; |
|
706 |
User::LeaveIfError(fs.GetDir( |
|
707 |
KPixelMetricsDataFiles, |
|
708 |
KEntryAttMaskSupported, |
|
709 |
ESortByName, |
|
710 |
dirList)); |
|
711 |
||
712 |
TMySmallBuffer bufferLayoutHdr; |
|
713 |
TMyBigBuffer bufferPMData; |
|
714 |
TInt fileCount = dirList->Count(); |
|
715 |
for (TInt i=0;i<fileCount;i++) |
|
716 |
{ |
|
717 |
// open sourcefile |
|
718 |
RFile sourceFile; |
|
719 |
TFileName layoutFile = (*dirList)[i].iName; |
|
720 |
User::LeaveIfError( sourceFile.Open( |
|
721 |
fs,layoutFile, EFileRead|EFileShareAny|EFileStreamText )); |
|
722 |
CleanupClosePushL( sourceFile ); |
|
723 |
||
724 |
// Make all reads as from textfile. |
|
725 |
TFileText textSourceFile; |
|
726 |
textSourceFile.Set( sourceFile ); |
|
727 |
TFileName layoutName = CreateLayoutNameL( textSourceFile ); |
|
728 |
||
729 |
// rewind - just in case. |
|
730 |
textSourceFile.Seek( ESeekStart ); |
|
731 |
TFileName oneline; |
|
732 |
bufferLayoutHdr.Append(KOpenBrace); |
|
733 |
bufferPMData.Append(KOpenBrace); |
|
734 |
TInt loop = 0; |
|
735 |
FOREVER |
|
736 |
{ |
|
737 |
if( textSourceFile.Read(oneline) != KErrNone ) |
|
738 |
{ |
|
739 |
break; |
|
740 |
} |
|
741 |
// Add commas for all but first line |
|
742 |
if (loop != 0) |
|
743 |
{ |
|
744 |
if ( loop <= KHeaderValues-1) |
|
745 |
{ |
|
746 |
bufferLayoutHdr.Append(KComma); |
|
747 |
} |
|
748 |
else |
|
749 |
{ |
|
750 |
if (loop != KHeaderValues) |
|
751 |
{ |
|
752 |
bufferPMData.Append(KComma); |
|
753 |
} |
|
754 |
} |
|
755 |
if (loop==KHeaderValues) |
|
756 |
{ |
|
757 |
bufferLayoutHdr.Append(_L(",QLatin1String(\"")); |
|
758 |
bufferLayoutHdr.Append(layoutName); |
|
759 |
bufferLayoutHdr.Append(_L("\")")); |
|
760 |
} |
|
761 |
} |
|
762 |
// Remove pixel metrics name and ":" |
|
763 |
oneline = oneline.Mid(oneline.Find(KColon)+1); |
|
764 |
// Remove tab |
|
765 |
oneline = oneline.Mid(oneline.Find(KTab)+1); |
|
766 |
// remove crap from the end of line |
|
767 |
TLex lex(oneline); |
|
768 |
TInt nextValue = -666; |
|
769 |
User::LeaveIfError( lex.Val(nextValue) ); |
|
770 |
if ( loop <= KHeaderValues-1) |
|
771 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
772 |
bufferLayoutHdr.AppendNum(nextValue); |
0 | 773 |
} |
774 |
else |
|
775 |
{ |
|
776 |
if (nextValue == -909) |
|
777 |
bufferPMData.Append(_L("ECommonStyleValue")); |
|
778 |
else |
|
779 |
bufferPMData.AppendNum(nextValue); |
|
780 |
} |
|
781 |
oneline.Zero(); |
|
782 |
loop++; |
|
783 |
} |
|
784 |
file.Flush(); |
|
785 |
bufferLayoutHdr.Append(KEndBraceWithCommaAndCRLF); |
|
786 |
bufferPMData.Append(KEndBraceWithCommaAndCRLF); |
|
787 |
CleanupStack::PopAndDestroy(); //sourceFile |
|
788 |
} |
|
789 |
||
790 |
bufferLayoutHdr = bufferLayoutHdr.Left(bufferLayoutHdr.Length()-2); |
|
791 |
bufferPMData = bufferPMData.Left(bufferPMData.Length()-2); |
|
792 |
textFile.Write(bufferLayoutHdr); |
|
793 |
textFile.Write(KCRLF); |
|
794 |
textFile.Write(bufferPMData); |
|
795 |
delete dirList; |
|
796 |
||
797 |
CleanupStack::PopAndDestroy(); //file |
|
798 |
} |
|
799 |
||
800 |
TFileName CPixelMetricsMapperAppUi::CreateLayoutNameL(TFileText& aFileHandle) const |
|
801 |
{ |
|
802 |
aFileHandle.Seek(ESeekStart); |
|
803 |
// Layout data is deployed like this: |
|
804 |
// first line - height |
|
805 |
// second line - width |
|
806 |
TFileName lines; |
|
807 |
TFileName layoutName; |
|
808 |
||
809 |
TInt height = -666; |
|
810 |
TInt width = -666; |
|
811 |
// Collect name information. |
|
812 |
for (TInt i=0; i<6; i++) |
|
813 |
{ |
|
814 |
User::LeaveIfError(aFileHandle.Read(lines)); |
|
815 |
// Remove pixel metrics name and ":" |
|
816 |
lines = lines.Mid(lines.Find(KColon)+1); |
|
817 |
// Remove tab |
|
818 |
lines = lines.Mid(lines.Find(KTab)+1); |
|
819 |
TLex myLexer(lines); |
|
820 |
TInt error = KErrNone; |
|
821 |
if (i==0) //height is first |
|
822 |
{ |
|
823 |
error = myLexer.Val(height); |
|
824 |
} |
|
825 |
if (i==1) //width is second |
|
826 |
{ |
|
827 |
error = myLexer.Val(width); |
|
828 |
} |
|
829 |
User::LeaveIfError(error); |
|
830 |
} |
|
831 |
||
832 |
// Interpret results and write name to buffer. |
|
833 |
if ( (width == 240 && height == 320) || |
|
834 |
(width == 320 && height == 240)) |
|
835 |
{ |
|
836 |
layoutName.Append(_L("QVGA ")); |
|
837 |
} |
|
838 |
else if ( (width == 360 && height == 640) || |
|
839 |
(width == 640 && height == 360)) |
|
840 |
{ |
|
841 |
layoutName.Append(_L("NHD ")); |
|
842 |
} |
|
843 |
else if ( (width == 480 && height == 640) || |
|
844 |
(width == 640 && height == 480)) |
|
845 |
{ |
|
846 |
layoutName.Append(_L("VGA ")); |
|
847 |
} |
|
848 |
else if ( (width == 800 && height == 352) || |
|
849 |
(width == 352 && height == 800)) |
|
850 |
{ |
|
851 |
layoutName.Append(_L("E90 ")); |
|
852 |
} |
|
853 |
else if ( (width == 800 && height == 480) || |
|
854 |
(width == 480 && height == 800) || |
|
855 |
(width == 848 && height == 480) || |
|
856 |
(width == 480 && height == 848) || |
|
857 |
(width == 854 && height == 480) || |
|
858 |
(width == 480 && height == 854)) |
|
859 |
{ |
|
860 |
layoutName.Append(_L("WVGA ")); |
|
861 |
} |
|
862 |
else if ( (width == 480 && height == 320) || |
|
863 |
(width == 320 && height == 480) || |
|
864 |
(width == 640 && height == 240) || |
|
865 |
(width == 240 && height == 640)) |
|
866 |
{ |
|
867 |
layoutName.Append(_L("HVGA ")); |
|
868 |
} |
|
869 |
else |
|
870 |
{ |
|
871 |
layoutName.Append(_L("Unknown ")); |
|
872 |
layoutName.AppendNum(height); |
|
873 |
layoutName.Append(_L("x")); |
|
874 |
layoutName.AppendNum(width); |
|
875 |
} |
|
876 |
if (width > height) |
|
877 |
{ |
|
878 |
layoutName.Append(_L("Landscape")); |
|
879 |
} |
|
880 |
else |
|
881 |
{ |
|
882 |
layoutName.Append(_L("Portrait")); |
|
883 |
} |
|
884 |
return layoutName; |
|
885 |
} |
|
886 |
||
887 |
// ----------------------------------------------------------------------------- |
|
888 |
// |
|
889 |
// ----------------------------------------------------------------------------- |
|
890 |
// |
|
891 |
CEikAppUi* CPixelMetricsMapperDocument::CreateAppUiL() |
|
892 |
{ |
|
893 |
return( new ( ELeave ) CPixelMetricsMapperAppUi ); |
|
894 |
} |
|
895 |
||
896 |
// ----------------------------------------------------------------------------- |
|
897 |
// |
|
898 |
// ----------------------------------------------------------------------------- |
|
899 |
// |
|
900 |
void CPixelMetricsMapperDocument::ConstructL() |
|
901 |
{ |
|
902 |
} |
|
903 |
||
904 |
// ----------------------------------------------------------------------------- |
|
905 |
// |
|
906 |
// ----------------------------------------------------------------------------- |
|
907 |
// |
|
908 |
TUid CPixelMetricsMapperApplication::AppDllUid() const |
|
909 |
{ |
|
910 |
return KUidPMMapperApplication; |
|
911 |
} |
|
912 |
||
913 |
||
914 |
// ----------------------------------------------------------------------------- |
|
915 |
// |
|
916 |
// ----------------------------------------------------------------------------- |
|
917 |
// |
|
918 |
CApaDocument* CPixelMetricsMapperApplication::CreateDocumentL() |
|
919 |
{ |
|
920 |
CPixelMetricsMapperDocument* document = |
|
921 |
new( ELeave ) CPixelMetricsMapperDocument( *this ); |
|
922 |
CleanupStack::PushL( document ); |
|
923 |
document->ConstructL(); |
|
924 |
CleanupStack::Pop(); |
|
925 |
return( document ); |
|
926 |
} |
|
927 |
||
928 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
929 |
// --------------------------------------------------------- |
|
930 |
// NewApplication implements |
|
931 |
// |
|
932 |
// Creates an instance of application. |
|
933 |
// |
|
934 |
// Returns: an instance of CVtUiApp |
|
935 |
// --------------------------------------------------------- |
|
936 |
// |
|
937 |
LOCAL_C CApaApplication* NewApplication() |
|
938 |
{ |
|
939 |
return new CPixelMetricsMapperApplication; |
|
940 |
} |
|
941 |
||
942 |
// --------------------------------------------------------- |
|
943 |
// E32Main implements |
|
944 |
// |
|
945 |
// It is called when executable is started. |
|
946 |
// |
|
947 |
// Returns: error code. |
|
948 |
// --------------------------------------------------------- |
|
949 |
// |
|
950 |
GLDEF_C TInt E32Main() |
|
951 |
{ |
|
952 |
return EikStart::RunApplication( NewApplication ); |
|
953 |
} |
|
954 |
||
955 |
// End of File |