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_DataFbsFont |
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_DataFbsFont.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 |
/// Parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
29 |
_LIT(KText, "text"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
30 |
_LIT(KExpectedBool, "expected_bool"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
31 |
_LIT(KCharCode, "char_code"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
32 |
_LIT(KNullBitmapPointerExpected, "null_bitmap_pointer_expected"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
33 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
34 |
/// Commands |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
35 |
_LIT(KCmdGetFontMetrics, "GetFontMetrics"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
36 |
_LIT(KCmdTextWidthInPixelsWithCharWidth, "TextWidthInPixelsWithCharWidth"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
37 |
_LIT(KCmdHandle, "Handle"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
38 |
_LIT(KCmdCharacterMetrics, "CharacterMetrics"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
39 |
_LIT(KCmdRawTextWidthInPixels, "RawTextWidthInPixels"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
40 |
_LIT(KCmdGetFaceAttrib, "GetFaceAttrib"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
41 |
_LIT(KCmdIsOpenFont, "IsOpenFont"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
42 |
_LIT(KCmdHasCharacter, "HasCharacter"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
/*@}*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
44 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
* Constructor |
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 |
CT_DataFbsFont* CT_DataFbsFont::NewL() |
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 |
CT_DataFbsFont* ret = new (ELeave) CT_DataFbsFont(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
51 |
return ret; |
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 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
55 |
* Protected constructor. First phase construction |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
56 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
57 |
CT_DataFbsFont::CT_DataFbsFont() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
58 |
: CT_DataFont() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
59 |
, iFbsFont(NULL) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
60 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
61 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
62 |
|
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 |
* Process a command read from the ini file |
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 |
* @param aDataWrapper test step requiring command to be processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
67 |
* @param aCommand the command to process |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
68 |
* @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
|
69 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
* @return ETrue if the command is processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
TBool CT_DataFbsFont::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex) |
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 |
TBool ret=ETrue; |
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 |
if (aCommand == KCmdGetFontMetrics) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
77 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
DoCmdGetFontMetrics(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
79 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
80 |
else if (aCommand == KCmdTextWidthInPixelsWithCharWidth) |
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 |
DoCmdTextWidthInPixelsWithCharWidth(aSection); |
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 |
else if (aCommand == KCmdHandle) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
85 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
86 |
DoCmdHandle(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
87 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
else if (aCommand == KCmdCharacterMetrics) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
89 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
90 |
DoCmdCharacterMetrics(aSection); |
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 |
else if (aCommand == KCmdRawTextWidthInPixels) |
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 |
DoCmdRawTextWidthInPixels(aSection); |
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 |
else if (aCommand == KCmdGetFaceAttrib) |
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 |
DoCmdGetFaceAttrib(aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
99 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
100 |
else if (aCommand == KCmdIsOpenFont) |
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 |
DoCmdIsOpenFont(aSection); |
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 |
else if (aCommand == KCmdHasCharacter) |
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 |
DoCmdHasCharacter(aSection); |
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 |
else |
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 |
ret=CT_DataFont::DoCommandL(aCommand, aSection, aAsyncErrorIndex); |
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 |
return ret; |
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 |
|
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 |
CFont* CT_DataFbsFont::GetFont() const |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
118 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
119 |
return iFbsFont; |
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 |
|
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 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
124 |
* Return a pointer to the object that the data wraps |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
125 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
126 |
* @return pointer to the object that the data wraps |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
127 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
128 |
TAny* CT_DataFbsFont::GetObject() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
129 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
130 |
return iFbsFont; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
131 |
} |
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 |
|
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 |
* Sets a fbs font |
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 |
* @param aNewFont fbs font |
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 |
void CT_DataFbsFont::SetObjectL(TAny* aObject) |
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 |
// no clean up needed, because fonts are managed by server side |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
142 |
iFbsFont = static_cast<CFbsFont*>(aObject); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
143 |
} |
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 |
|
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 |
* Disown a fbs font |
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 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
150 |
void CT_DataFbsFont::DisownObjectL() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
151 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
152 |
// no clean up needed, because fonts are managed by server side |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
153 |
iFbsFont=NULL; |
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 |
|
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 |
/** Calls CFbsFont::GetFontMetrics() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
158 |
void CT_DataFbsFont::DoCmdGetFontMetrics(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
159 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
160 |
TOpenFontMetrics metrics; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
161 |
TBool actual = iFbsFont->GetFontMetrics(metrics); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
162 |
INFO_PRINTF2(_L("Calls CFbsFont::GetFontMetrics() %d"), actual); |
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 |
// get if true expected flag from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
165 |
TBool expected; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
166 |
if ( GetBoolFromConfig(aSection, KExpectedBool(), expected) ) |
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 |
// check that the value is as expected |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
169 |
if (actual != expected) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
170 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
171 |
ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
172 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
173 |
} |
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 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
176 |
|
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 |
/** Calls CFbsFont::TextWidthInPixels() using SCharWidth output paramter */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
179 |
void CT_DataFbsFont::DoCmdTextWidthInPixelsWithCharWidth(const TDesC& aSection) |
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 |
INFO_PRINTF1(_L("Calls CFbsFont::TextWidthInPixels() using SCharWidth output paramter")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
182 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
183 |
// get text from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
184 |
TPtrC text; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
185 |
if (!GetStringFromConfig(aSection, KText(), text)) |
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 |
ERR_PRINTF2(_L("No %S"), &KText()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
188 |
SetBlockResult(EFail); |
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 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
191 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
192 |
// call TextWidthInPixels() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
193 |
SCharWidth charWidth; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
194 |
iFbsFont->TextWidthInPixels(text, charWidth); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
195 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
196 |
// validate SCharWidth |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
197 |
if (charWidth.iMove != charWidth.iLeftAdjust + charWidth.iWidth + charWidth.iRightAdjust) |
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 |
ERR_PRINTF5(_L("Move is not equal to left adjust + width + right adjust!, move: %d, leftAdjust: %d, width: %d, rightAdjust: %d"), charWidth.iMove, charWidth.iLeftAdjust, charWidth.iWidth, charWidth.iRightAdjust); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
200 |
SetBlockResult(EFail); |
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 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
205 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
206 |
/** Calls CFbsFont::Handle() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
207 |
void CT_DataFbsFont::DoCmdHandle() |
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 |
// call Handle() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
210 |
TInt handle = iFbsFont->Handle(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
211 |
INFO_PRINTF2(_L("Calls CFbsFont::Handle() %d"), handle); |
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 |
// validate hanle |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
214 |
if (handle == 0) |
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 |
ERR_PRINTF1(_L("Handle is zero!")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
217 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
218 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
219 |
} |
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 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
222 |
/** Calls CFbsFont::CharacterMetrics() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
223 |
void CT_DataFbsFont::DoCmdCharacterMetrics(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
224 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
225 |
INFO_PRINTF1(_L("Calls CFbsFont::CharacterMetrics()")); |
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 |
// get character code from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
228 |
TInt charCode = 0; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
229 |
if(!GetIntFromConfig(aSection, KCharCode(), charCode)) |
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 |
ERR_PRINTF2(_L("No %S"), &KCharCode()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
232 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
233 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
234 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
235 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
236 |
// call CharacterMetrics() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
237 |
const TUint8* bitmapPointer; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
238 |
iFbsFont->CharacterMetrics(charCode, bitmapPointer); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
239 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
240 |
// get if NULL bitmap pointer expected flag from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
241 |
TBool expectedNull = EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
242 |
if(GetBoolFromConfig(aSection, KNullBitmapPointerExpected(), expectedNull)) |
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 |
// check that on retirn the bitmap pointer is not NULL |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
245 |
if ( expectedNull ) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
246 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
247 |
if ( bitmapPointer!=NULL ) |
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 |
ERR_PRINTF1(_L("Bitmap pointer is NOT null!")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
250 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
251 |
} |
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 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
254 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
255 |
if ( bitmapPointer==NULL ) |
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_PRINTF1(_L("Bitmap pointer is null!")); |
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 |
} |
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 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
263 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
264 |
|
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 |
/** Calls CFbsFont::RawTextWidthInPixels() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
267 |
void CT_DataFbsFont::DoCmdRawTextWidthInPixels(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
268 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
269 |
INFO_PRINTF1(_L("Calls CFbsFont::RawTextWidthInPixels()")); |
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 text from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
272 |
TPtrC text; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
273 |
if (!GetStringFromConfig(aSection, KText(), text)) |
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"), &KText()); |
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 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
278 |
else |
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 |
// call RawTextWidthInPixels() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
281 |
TInt width = iFbsFont->RawTextWidthInPixels(text); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
282 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
283 |
// check result against MeasureText() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
284 |
TInt measureTextWidth = iFbsFont->MeasureText(text); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
285 |
if ( width != measureTextWidth) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
286 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
287 |
ERR_PRINTF3(_L("The result of RawTextWidthInPixels() is not the same as for MeasureText(): %d, and %d"), width, measureTextWidth); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
288 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
289 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
290 |
} |
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 |
|
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 |
/** Calls CFbsFont::GetFaceAttrib() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
295 |
void CT_DataFbsFont::DoCmdGetFaceAttrib(const TDesC& aSection) |
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 |
INFO_PRINTF1(_L("Calls CFbsFont::GetFaceAttrib()")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
298 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
299 |
// call GetFaceAttrib() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
300 |
TOpenFontFaceAttrib attrib; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
301 |
TBool actual = iFbsFont->GetFaceAttrib(attrib); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
302 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
303 |
// get if true expected flag from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
304 |
TBool expected; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
305 |
if(GetBoolFromConfig(aSection, KExpectedBool(), expected)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
306 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
307 |
// check that the value is as expected |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
308 |
if (actual != expected) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
309 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
310 |
ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
311 |
SetBlockResult(EFail); |
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 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
314 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
315 |
|
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 |
/** Calls CFbsFont::IsOpenFont() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
318 |
void CT_DataFbsFont::DoCmdIsOpenFont(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
319 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
320 |
INFO_PRINTF1(_L("Calls CFbsFont::IsOpenFont()")); |
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 |
// call IsOpenFont() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
323 |
TBool actual = iFbsFont->IsOpenFont(); |
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 |
// check that the value is as expected if there is a expected bool parameter |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
326 |
TBool expected; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
327 |
if (GetBoolFromConfig(aSection, KExpectedBool(), expected) ) |
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 |
// check that the value is as expected |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
330 |
if (actual != expected) |
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 |
ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
333 |
SetBlockResult(EFail); |
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 |
} |
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 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
339 |
/** Calls CFbsFont::HasCharacter() */ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
340 |
void CT_DataFbsFont::DoCmdHasCharacter(const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
341 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
342 |
INFO_PRINTF1(_L("Calls CFbsFont::HasCharacter()")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
343 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
344 |
// get character code from parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
345 |
TInt charCode = 0; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
346 |
if(!GetIntFromConfig(aSection, KCharCode(), charCode)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
347 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
348 |
ERR_PRINTF2(_L("No %S"), &KCharCode()); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
349 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
350 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
351 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
352 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
353 |
// call HasCharacter() |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
354 |
TBool actual = iFbsFont->HasCharacter(charCode); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
355 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
356 |
TBool expected; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
357 |
if(GetBoolFromConfig(aSection, KExpectedBool(), expected)) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
358 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
359 |
// check that the value is as expected |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
360 |
if (actual != expected) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
361 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
362 |
ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expected, actual); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
363 |
SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
364 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
365 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
366 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
367 |
} |