author | Simon Howkins <simonh@symbian.org> |
Wed, 27 Oct 2010 16:22:14 +0100 | |
changeset 1284 | 0b4a09013baf |
parent 872 | 17498133d9ad |
permissions | -rw-r--r-- |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
1 |
/* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
3 |
* All rights reserved. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
872 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
872 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
8 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
11 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
12 |
* Contributors: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
13 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
14 |
* Description: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
15 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
16 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
17 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
18 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
19 |
@test |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
20 |
@internalComponent |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
21 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
22 |
This contains CT_DataMeasureTextOutput |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
23 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
24 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
25 |
#include "T_DataMeasureTextOutput.h" |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
26 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
27 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
28 |
/*@{*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
29 |
/// Parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
30 |
_LIT(KValue, "value"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
31 |
_LIT(KRectAx, "rect_ax"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
32 |
_LIT(KRectAy, "rect_ay"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
33 |
_LIT(KRectBx, "rect_bx"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
34 |
_LIT(KRectBy, "rect_by"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
35 |
_LIT(KWidth, "width"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
36 |
_LIT(KHeight, "height"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
37 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
38 |
/// Commands |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
39 |
_LIT(KCmdNew, "new"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
40 |
_LIT(KCmdSetBounds, "iBounds"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
41 |
_LIT(KCmdSetChars, "iChars"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
42 |
_LIT(KCmdSetGlyphs, "iGlyphs"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
_LIT(KCmdSetGroups, "iGroups"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
44 |
_LIT(KCmdSetMaxGlyphSize, "iMaxGlyphSize"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
_LIT(KCmdSetSpaces, "iSpaces"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
_LIT(KCmdDestructor, "~"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
47 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
48 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
49 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
50 |
/*@}*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
51 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
52 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
53 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
54 |
* Two phase constructor |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
55 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
56 |
CT_DataMeasureTextOutput* CT_DataMeasureTextOutput::NewL() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
57 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
58 |
CT_DataMeasureTextOutput* ret = new (ELeave) CT_DataMeasureTextOutput(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
59 |
CleanupStack::PushL(ret); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
60 |
ret->ConstructL(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
61 |
CleanupStack::Pop(ret); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
62 |
return ret; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
63 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
64 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
65 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
66 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
67 |
* Protected constructor. First phase construction |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
68 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
69 |
CT_DataMeasureTextOutput::CT_DataMeasureTextOutput() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
: CDataWrapperBase() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
, iMeasureTextOutput(NULL) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
73 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
74 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
75 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
76 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
77 |
* Protected second phase construction |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
79 |
void CT_DataMeasureTextOutput::ConstructL() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
80 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
81 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
82 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
83 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
84 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
85 |
* Destructor. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
86 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
87 |
CT_DataMeasureTextOutput::~CT_DataMeasureTextOutput() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
89 |
DestroyData(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
90 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
91 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
92 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
93 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
94 |
* cleanup implementation. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
95 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
96 |
void CT_DataMeasureTextOutput::DestroyData() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
97 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
98 |
delete iMeasureTextOutput; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
99 |
iMeasureTextOutput = NULL; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
100 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
101 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
102 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
103 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
104 |
* Return a pointer to the object that the data wraps |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
105 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
106 |
* @return pointer to the object that the data wraps |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
107 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
108 |
TAny* CT_DataMeasureTextOutput::GetObject() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
109 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
110 |
return iMeasureTextOutput; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
111 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
112 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
113 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
114 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
115 |
* Process a command read from the ini file |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
116 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
117 |
* @param aDataWrapper test step requiring command to be processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
118 |
* @param aCommand the command to process |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
119 |
* @param aSection the entry in the ini file requiring the command to be processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
120 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
121 |
* @return ETrue if the command is processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
122 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
123 |
TBool CT_DataMeasureTextOutput::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
124 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
125 |
TBool retVal = ETrue; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
126 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
127 |
if (aCommand == KCmdNew) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
128 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
129 |
DoCmdNew(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
130 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
131 |
else if (aCommand == KCmdSetBounds) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
132 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
133 |
DoCmdSetBounds(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
134 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
135 |
else if (aCommand == KCmdSetChars) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
136 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
137 |
DoCmdSetChars(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
138 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
139 |
else if (aCommand == KCmdSetGlyphs) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
140 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
141 |
DoCmdSetGlyphs(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
142 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
143 |
else if (aCommand == KCmdSetGroups) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
144 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
145 |
DoCmdSetGroups(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
146 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
147 |
else if (aCommand == KCmdSetMaxGlyphSize) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
148 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
149 |
DoCmdSetMaxGlyphSize(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
150 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
151 |
else if (aCommand == KCmdSetSpaces) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
152 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
153 |
DoCmdSetSpaces(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
154 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
155 |
else if (aCommand == KCmdDestructor) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
156 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
157 |
DestroyData(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
158 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
159 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
160 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
161 |
retVal=EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
162 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
163 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
164 |
return retVal; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
165 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
166 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
167 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
168 |
////////////////// COMMANDS IMPLEMENTATION //////////////////////// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
169 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
170 |
/** Creates an instance of TMeasureTextOutput structure */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
171 |
void CT_DataMeasureTextOutput::DoCmdNew() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
172 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
173 |
INFO_PRINTF1(_L("Creates an instance of TMeasureTextOutput structure")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
174 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
175 |
// cleanup if any |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
176 |
DestroyData(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
177 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
178 |
// call new operator |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
179 |
TRAPD(err, iMeasureTextOutput = new (ELeave) CFont::TMeasureTextOutput()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
180 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
181 |
// check error code |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
182 |
if (err != KErrNone) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
183 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
184 |
ERR_PRINTF2(_L("Error creating an instance: %d"), err); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
185 |
SetError(err); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
186 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
187 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
188 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
189 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
190 |
/** Sets TMeasureTextOutputData::iChars */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
191 |
void CT_DataMeasureTextOutput::DoCmdSetChars(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
192 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
193 |
INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iChars")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
194 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
195 |
// get value from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
196 |
TInt value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
197 |
if (GetValueFromConfig(*this,aSection, value)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
198 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
199 |
iMeasureTextOutput->iChars = value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
200 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
201 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
202 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
203 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
204 |
/** Sets TMeasureTextOutputData::iGlyphs */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
205 |
void CT_DataMeasureTextOutput::DoCmdSetGlyphs(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
206 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
207 |
INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iGlyphs")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
208 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
209 |
// get value from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
210 |
TInt value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
211 |
if (GetValueFromConfig(*this, aSection, value)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
212 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
213 |
iMeasureTextOutput->iGlyphs = value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
214 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
215 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
216 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
217 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
218 |
/** Sets TMeasureTextOutputData::iGroups */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
219 |
void CT_DataMeasureTextOutput::DoCmdSetGroups(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
220 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
221 |
INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iGroups")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
222 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
223 |
// get value from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
224 |
TInt value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
225 |
if (GetValueFromConfig(*this, aSection, value)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
226 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
227 |
iMeasureTextOutput->iGroups = value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
228 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
229 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
230 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
231 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
232 |
/** Sets TMeasureTextOutputData::iSpaces */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
233 |
void CT_DataMeasureTextOutput::DoCmdSetSpaces(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
234 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
235 |
INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iSpaces")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
236 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
237 |
// get value from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
238 |
TInt value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
239 |
if (GetValueFromConfig(*this, aSection, value)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
240 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
241 |
iMeasureTextOutput->iSpaces = value; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
242 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
243 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
244 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
245 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
246 |
/** Sets TMeasureTextOutputData::iBounds */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
247 |
void CT_DataMeasureTextOutput::DoCmdSetBounds(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
248 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
249 |
INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iBounds")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
250 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
251 |
TBool dataOk = ETrue; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
252 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
253 |
// get rect Ax from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
254 |
TInt rectAx; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
255 |
if(!GetIntFromConfig(aSection, KRectAx(), rectAx)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
256 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
257 |
ERR_PRINTF2(_L("No %S"), &KRectAx()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
258 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
259 |
dataOk = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
260 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
261 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
262 |
// get rect Ay from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
263 |
TInt rectAy; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
264 |
if(!GetIntFromConfig(aSection, KRectAy(), rectAy)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
265 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
266 |
ERR_PRINTF2(_L("No %S"), &KRectAy()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
267 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
268 |
dataOk = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
269 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
270 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
271 |
// get rect Bx from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
272 |
TInt rectBx; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
273 |
if(!GetIntFromConfig(aSection, KRectBx(), rectBx)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
274 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
275 |
ERR_PRINTF2(_L("No %S"), &KRectBx()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
276 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
277 |
dataOk = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
278 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
279 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
280 |
// get rect By from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
281 |
TInt rectBy; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
282 |
if(!GetIntFromConfig(aSection, KRectBy(), rectBy)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
283 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
284 |
ERR_PRINTF2(_L("No %S"), &KRectBy()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
285 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
286 |
dataOk = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
287 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
288 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
289 |
// set the field |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
290 |
if (dataOk) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
291 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
292 |
iMeasureTextOutput->iBounds.SetRect(rectAx, rectAy, rectBx, rectBy); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
293 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
294 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
295 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
296 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
297 |
/** Sets TMeasureTextOutputData::iMaxGlyphSize */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
298 |
void CT_DataMeasureTextOutput::DoCmdSetMaxGlyphSize(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
299 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
300 |
INFO_PRINTF1(_L("Sets TMeasureTextOutputData::iMaxGlyphSize")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
301 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
302 |
TBool dataOk = ETrue; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
303 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
304 |
// get width from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
305 |
TInt width; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
306 |
if(!GetIntFromConfig(aSection, KWidth(), width)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
307 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
308 |
ERR_PRINTF2(_L("No %S"), &KWidth()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
309 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
310 |
dataOk = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
311 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
312 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
313 |
// get height from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
314 |
TInt height; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
315 |
if(!GetIntFromConfig(aSection, KHeight(), height)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
316 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
317 |
ERR_PRINTF2(_L("No %S"), &KHeight()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
318 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
319 |
dataOk = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
320 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
321 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
322 |
// set the field |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
323 |
if (dataOk) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
324 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
325 |
iMeasureTextOutput->iMaxGlyphSize.iWidth = width; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
326 |
iMeasureTextOutput->iMaxGlyphSize.iHeight = height; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
327 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
328 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
329 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
330 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
331 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
332 |
///////////////////////////////// UTIL METHODS ////////////////////////////////////// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
333 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
334 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
335 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
336 |
* Utility method that fetches a int value from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
337 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
338 |
TBool CT_DataMeasureTextOutput::GetValueFromConfig(CDataWrapper& iInputStep, const TDesC& aSection, TInt& aValue) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
339 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
340 |
TBool ret=iInputStep.GetIntFromConfig(aSection, KValue(), aValue); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
341 |
if (!ret) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
342 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
343 |
iInputStep.ERR_PRINTF2(_L("No %S"), &KValue()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
344 |
iInputStep.SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
345 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
346 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
347 |
return ret; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
348 |
} |