author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 3 | 41300fa6a67c |
child 8 | 3f74d0d4af4c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@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: |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
158 |
{ |
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 ); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
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 |
{ |
|
326 |
if (index==QStyle::PM_Custom_ThinLineWidth) |
|
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; |
|
659 |
default: |
|
660 |
bufferPtr.Append(_L("Default: ")); |
|
661 |
break; |
|
662 |
} |
|
663 |
||
664 |
if (iFileOutputOn) |
|
665 |
{ |
|
666 |
bufferPtr.Append('\t'); |
|
667 |
} |
|
668 |
bufferPtr.AppendNum(aValue); |
|
669 |
bufferPtr.Append(_L(" ")); |
|
670 |
ShowL( *buffer, aLast, iFileOutputOn ); |
|
671 |
CleanupStack::PopAndDestroy( buffer ); |
|
672 |
} |
|
673 |
||
674 |
void CPixelMetricsMapperAppUi::ClearL() |
|
675 |
{ |
|
676 |
iView->ClearL(); |
|
677 |
} |
|
678 |
||
679 |
void CPixelMetricsMapperAppUi::CreateHeaderFileL() const |
|
680 |
{ |
|
681 |
// Open/create resulting file. |
|
682 |
RFile file; |
|
683 |
HBufC* layoutFile = HBufC::NewLC( KMaxFileName ); |
|
684 |
*layoutFile = KLayoutSourceFileAndPath; |
|
685 |
TFileName fileName = *layoutFile; |
|
686 |
CleanupStack::PopAndDestroy(layoutFile); |
|
687 |
RFs& fs = CEikonEnv::Static()->FsSession(); |
|
688 |
TInt error = file.Open(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText ); |
|
689 |
if (error==KErrNotFound) |
|
690 |
{ |
|
691 |
file.Create(fs,fileName, EFileWrite|EFileShareAny|EFileStreamText); |
|
692 |
} |
|
693 |
CleanupClosePushL( file ); |
|
694 |
file.SetSize( 0 ); |
|
695 |
||
696 |
// Make all writes as from textfile. |
|
697 |
TFileText textFile; |
|
698 |
textFile.Set( file ); |
|
699 |
textFile.Seek( ESeekStart ); |
|
700 |
||
701 |
// Take all layout files from private folder. |
|
702 |
CDir* dirList; |
|
703 |
User::LeaveIfError(fs.GetDir( |
|
704 |
KPixelMetricsDataFiles, |
|
705 |
KEntryAttMaskSupported, |
|
706 |
ESortByName, |
|
707 |
dirList)); |
|
708 |
||
709 |
TMySmallBuffer bufferLayoutHdr; |
|
710 |
TMyBigBuffer bufferPMData; |
|
711 |
TInt fileCount = dirList->Count(); |
|
712 |
for (TInt i=0;i<fileCount;i++) |
|
713 |
{ |
|
714 |
// open sourcefile |
|
715 |
RFile sourceFile; |
|
716 |
TFileName layoutFile = (*dirList)[i].iName; |
|
717 |
User::LeaveIfError( sourceFile.Open( |
|
718 |
fs,layoutFile, EFileRead|EFileShareAny|EFileStreamText )); |
|
719 |
CleanupClosePushL( sourceFile ); |
|
720 |
||
721 |
// Make all reads as from textfile. |
|
722 |
TFileText textSourceFile; |
|
723 |
textSourceFile.Set( sourceFile ); |
|
724 |
TFileName layoutName = CreateLayoutNameL( textSourceFile ); |
|
725 |
||
726 |
// rewind - just in case. |
|
727 |
textSourceFile.Seek( ESeekStart ); |
|
728 |
TFileName oneline; |
|
729 |
bufferLayoutHdr.Append(KOpenBrace); |
|
730 |
bufferPMData.Append(KOpenBrace); |
|
731 |
TInt loop = 0; |
|
732 |
FOREVER |
|
733 |
{ |
|
734 |
if( textSourceFile.Read(oneline) != KErrNone ) |
|
735 |
{ |
|
736 |
break; |
|
737 |
} |
|
738 |
// Add commas for all but first line |
|
739 |
if (loop != 0) |
|
740 |
{ |
|
741 |
if ( loop <= KHeaderValues-1) |
|
742 |
{ |
|
743 |
bufferLayoutHdr.Append(KComma); |
|
744 |
} |
|
745 |
else |
|
746 |
{ |
|
747 |
if (loop != KHeaderValues) |
|
748 |
{ |
|
749 |
bufferPMData.Append(KComma); |
|
750 |
} |
|
751 |
} |
|
752 |
if (loop==KHeaderValues) |
|
753 |
{ |
|
754 |
bufferLayoutHdr.Append(_L(",QLatin1String(\"")); |
|
755 |
bufferLayoutHdr.Append(layoutName); |
|
756 |
bufferLayoutHdr.Append(_L("\")")); |
|
757 |
} |
|
758 |
} |
|
759 |
// Remove pixel metrics name and ":" |
|
760 |
oneline = oneline.Mid(oneline.Find(KColon)+1); |
|
761 |
// Remove tab |
|
762 |
oneline = oneline.Mid(oneline.Find(KTab)+1); |
|
763 |
// remove crap from the end of line |
|
764 |
TLex lex(oneline); |
|
765 |
TInt nextValue = -666; |
|
766 |
User::LeaveIfError( lex.Val(nextValue) ); |
|
767 |
if ( loop <= KHeaderValues-1) |
|
768 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
769 |
bufferLayoutHdr.AppendNum(nextValue); |
0 | 770 |
} |
771 |
else |
|
772 |
{ |
|
773 |
if (nextValue == -909) |
|
774 |
bufferPMData.Append(_L("ECommonStyleValue")); |
|
775 |
else |
|
776 |
bufferPMData.AppendNum(nextValue); |
|
777 |
} |
|
778 |
oneline.Zero(); |
|
779 |
loop++; |
|
780 |
} |
|
781 |
file.Flush(); |
|
782 |
bufferLayoutHdr.Append(KEndBraceWithCommaAndCRLF); |
|
783 |
bufferPMData.Append(KEndBraceWithCommaAndCRLF); |
|
784 |
CleanupStack::PopAndDestroy(); //sourceFile |
|
785 |
} |
|
786 |
||
787 |
bufferLayoutHdr = bufferLayoutHdr.Left(bufferLayoutHdr.Length()-2); |
|
788 |
bufferPMData = bufferPMData.Left(bufferPMData.Length()-2); |
|
789 |
textFile.Write(bufferLayoutHdr); |
|
790 |
textFile.Write(KCRLF); |
|
791 |
textFile.Write(bufferPMData); |
|
792 |
delete dirList; |
|
793 |
||
794 |
CleanupStack::PopAndDestroy(); //file |
|
795 |
} |
|
796 |
||
797 |
TFileName CPixelMetricsMapperAppUi::CreateLayoutNameL(TFileText& aFileHandle) const |
|
798 |
{ |
|
799 |
aFileHandle.Seek(ESeekStart); |
|
800 |
// Layout data is deployed like this: |
|
801 |
// first line - height |
|
802 |
// second line - width |
|
803 |
TFileName lines; |
|
804 |
TFileName layoutName; |
|
805 |
||
806 |
TInt height = -666; |
|
807 |
TInt width = -666; |
|
808 |
// Collect name information. |
|
809 |
for (TInt i=0; i<6; i++) |
|
810 |
{ |
|
811 |
User::LeaveIfError(aFileHandle.Read(lines)); |
|
812 |
// Remove pixel metrics name and ":" |
|
813 |
lines = lines.Mid(lines.Find(KColon)+1); |
|
814 |
// Remove tab |
|
815 |
lines = lines.Mid(lines.Find(KTab)+1); |
|
816 |
TLex myLexer(lines); |
|
817 |
TInt error = KErrNone; |
|
818 |
if (i==0) //height is first |
|
819 |
{ |
|
820 |
error = myLexer.Val(height); |
|
821 |
} |
|
822 |
if (i==1) //width is second |
|
823 |
{ |
|
824 |
error = myLexer.Val(width); |
|
825 |
} |
|
826 |
User::LeaveIfError(error); |
|
827 |
} |
|
828 |
||
829 |
// Interpret results and write name to buffer. |
|
830 |
if ( (width == 240 && height == 320) || |
|
831 |
(width == 320 && height == 240)) |
|
832 |
{ |
|
833 |
layoutName.Append(_L("QVGA ")); |
|
834 |
} |
|
835 |
else if ( (width == 360 && height == 640) || |
|
836 |
(width == 640 && height == 360)) |
|
837 |
{ |
|
838 |
layoutName.Append(_L("NHD ")); |
|
839 |
} |
|
840 |
else if ( (width == 480 && height == 640) || |
|
841 |
(width == 640 && height == 480)) |
|
842 |
{ |
|
843 |
layoutName.Append(_L("VGA ")); |
|
844 |
} |
|
845 |
else if ( (width == 800 && height == 352) || |
|
846 |
(width == 352 && height == 800)) |
|
847 |
{ |
|
848 |
layoutName.Append(_L("E90 ")); |
|
849 |
} |
|
850 |
else if ( (width == 800 && height == 480) || |
|
851 |
(width == 480 && height == 800) || |
|
852 |
(width == 848 && height == 480) || |
|
853 |
(width == 480 && height == 848) || |
|
854 |
(width == 854 && height == 480) || |
|
855 |
(width == 480 && height == 854)) |
|
856 |
{ |
|
857 |
layoutName.Append(_L("WVGA ")); |
|
858 |
} |
|
859 |
else if ( (width == 480 && height == 320) || |
|
860 |
(width == 320 && height == 480) || |
|
861 |
(width == 640 && height == 240) || |
|
862 |
(width == 240 && height == 640)) |
|
863 |
{ |
|
864 |
layoutName.Append(_L("HVGA ")); |
|
865 |
} |
|
866 |
else |
|
867 |
{ |
|
868 |
layoutName.Append(_L("Unknown ")); |
|
869 |
layoutName.AppendNum(height); |
|
870 |
layoutName.Append(_L("x")); |
|
871 |
layoutName.AppendNum(width); |
|
872 |
} |
|
873 |
if (width > height) |
|
874 |
{ |
|
875 |
layoutName.Append(_L("Landscape")); |
|
876 |
} |
|
877 |
else |
|
878 |
{ |
|
879 |
layoutName.Append(_L("Portrait")); |
|
880 |
} |
|
881 |
return layoutName; |
|
882 |
} |
|
883 |
||
884 |
// ----------------------------------------------------------------------------- |
|
885 |
// |
|
886 |
// ----------------------------------------------------------------------------- |
|
887 |
// |
|
888 |
CEikAppUi* CPixelMetricsMapperDocument::CreateAppUiL() |
|
889 |
{ |
|
890 |
return( new ( ELeave ) CPixelMetricsMapperAppUi ); |
|
891 |
} |
|
892 |
||
893 |
// ----------------------------------------------------------------------------- |
|
894 |
// |
|
895 |
// ----------------------------------------------------------------------------- |
|
896 |
// |
|
897 |
void CPixelMetricsMapperDocument::ConstructL() |
|
898 |
{ |
|
899 |
} |
|
900 |
||
901 |
// ----------------------------------------------------------------------------- |
|
902 |
// |
|
903 |
// ----------------------------------------------------------------------------- |
|
904 |
// |
|
905 |
TUid CPixelMetricsMapperApplication::AppDllUid() const |
|
906 |
{ |
|
907 |
return KUidPMMapperApplication; |
|
908 |
} |
|
909 |
||
910 |
||
911 |
// ----------------------------------------------------------------------------- |
|
912 |
// |
|
913 |
// ----------------------------------------------------------------------------- |
|
914 |
// |
|
915 |
CApaDocument* CPixelMetricsMapperApplication::CreateDocumentL() |
|
916 |
{ |
|
917 |
CPixelMetricsMapperDocument* document = |
|
918 |
new( ELeave ) CPixelMetricsMapperDocument( *this ); |
|
919 |
CleanupStack::PushL( document ); |
|
920 |
document->ConstructL(); |
|
921 |
CleanupStack::Pop(); |
|
922 |
return( document ); |
|
923 |
} |
|
924 |
||
925 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
926 |
// --------------------------------------------------------- |
|
927 |
// NewApplication implements |
|
928 |
// |
|
929 |
// Creates an instance of application. |
|
930 |
// |
|
931 |
// Returns: an instance of CVtUiApp |
|
932 |
// --------------------------------------------------------- |
|
933 |
// |
|
934 |
LOCAL_C CApaApplication* NewApplication() |
|
935 |
{ |
|
936 |
return new CPixelMetricsMapperApplication; |
|
937 |
} |
|
938 |
||
939 |
// --------------------------------------------------------- |
|
940 |
// E32Main implements |
|
941 |
// |
|
942 |
// It is called when executable is started. |
|
943 |
// |
|
944 |
// Returns: error code. |
|
945 |
// --------------------------------------------------------- |
|
946 |
// |
|
947 |
GLDEF_C TInt E32Main() |
|
948 |
{ |
|
949 |
return EikStart::RunApplication( NewApplication ); |
|
950 |
} |
|
951 |
||
952 |
// End of File |