common/tools/ats/smoketest/graphics/gdi/src/T_DataFont.cpp
author victorp@symbian.org
Wed, 03 Feb 2010 16:06:24 +0000
changeset 872 17498133d9ad
parent 833 6ffc235847d0
permissions -rw-r--r--
adding EPL headers to smoke test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     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
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     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_DataFont
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
//	User includes
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
#include "T_DataFont.h"
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
//	Epoc includes
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
#include <gdi.h>
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
/*@{*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
///	Parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
_LIT(KText,									"text");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
_LIT(KWidthAvailable,						"width_available");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
_LIT(KCalculateExcess,						"calculate_excess");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
_LIT(KExpectedExcess,						"expected_excess");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
_LIT(KExpectedResult,						"expected_result");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
_LIT(KExpectedFont,							"expected_font");	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
_LIT(KCharCode,								"char_code");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
_LIT(KUid,									"uid");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
_LIT(KMeasureTextOutput,					"measure_text_output");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
_LIT(KMeasureTextInput,						"measure_text_input");
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
///	Commands
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
_LIT(KCmdFontCapitalAscent,					"FontCapitalAscent");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
_LIT(KCmdFontMaxAscent,						"FontMaxAscent");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
_LIT(KCmdFontStandardDescent,				"FontStandardDescent");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
_LIT(KCmdFontMaxDescent,					"FontMaxDescent");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
_LIT(KCmdFontLineGap,						"FontLineGap");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
_LIT(KCmdFontMaxHeight,						"FontMaxHeight");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
_LIT(KCmdTypeUid,							"TypeUid");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
_LIT(KCmdHeightInPixels,					"HeightInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
_LIT(KCmdAscentInPixels,					"AscentInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
_LIT(KCmdDescentInPixels,					"DescentInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
_LIT(KCmdCharWidthInPixels,					"CharWidthInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
_LIT(KCmdTextCount,							"TextCount");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
_LIT(KCmdMaxCharWidthInPixels,				"MaxCharWidthInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
_LIT(KCmdMaxNormalCharWidthInPixels,		"MaxNormalCharWidthInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
_LIT(KCmdFontSpecInTwips,					"FontSpecInTwips");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
_LIT(KCmdWidthZeroInPixels,					"WidthZeroInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
_LIT(KCmdBaselineOffsetInPixels,			"BaselineOffsetInPixels");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
_LIT(KCmdGetCharacterData,					"GetCharacterData");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
_LIT(KCmdMeasureText,						"MeasureText");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
_LIT(KCmdExtendedFunction,					"ExtendedFunction");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
_LIT(KCmdTextWidthInPixels,					"TextWidthInPixels");
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
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
* Constructor. First phase construction
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
CT_DataFont::CT_DataFont()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
:	CDataWrapperBase()
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
* Process a command read from the ini file
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
* @param aDataWrapper	test step requiring command to be processed
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
* @param aCommand	the command to process
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
* @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
    82
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
* @return ETrue if the command is processed
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
TBool CT_DataFont::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
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
	TBool ret=ETrue;
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
	if (aCommand == KCmdFontCapitalAscent)
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
		DoCmdFontCapitalAscent(aSection);
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
	else if (aCommand == KCmdFontMaxAscent)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
		DoCmdFontMaxAscent(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
	else if (aCommand == KCmdFontStandardDescent)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
		DoCmdFontStandardDescent(aSection);
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
	else if (aCommand == KCmdFontMaxDescent)
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
		DoCmdFontMaxDescent(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	else if (aCommand == KCmdFontLineGap)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
		DoCmdFontLineGap(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
	else if (aCommand == KCmdFontMaxHeight)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
		DoCmdFontMaxHeight(aSection);
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
	else if (aCommand == KCmdTypeUid)
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
		DoCmdTypeUid(aSection);
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
	else if (aCommand == KCmdHeightInPixels)
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
		DoCmdHeightInPixels(aSection);
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
	else if (aCommand == KCmdAscentInPixels)
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
		DoCmdAscentInPixels(aSection);
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
	else if (aCommand == KCmdDescentInPixels)
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
		DoCmdDescentInPixels(aSection);
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
	else if (aCommand == KCmdCharWidthInPixels)
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
		DoCmdCharWidthInPixels(aSection);
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
	else if (aCommand == KCmdTextCount)
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
		DoCmdTextCount(aSection);
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
	else if (aCommand == KCmdMaxCharWidthInPixels)
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
		DoCmdMaxCharWidthInPixels(aSection);
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
	else if (aCommand == KCmdMaxNormalCharWidthInPixels)
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
		DoCmdMaxNormalCharWidthInPixels(aSection);
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
	else if (aCommand == KCmdFontSpecInTwips)
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
		DoCmdFontSpecInTwips(aSection);
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
	else if (aCommand == KCmdWidthZeroInPixels)
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
		DoCmdWidthZeroInPixels(aSection);
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
	else if (aCommand == KCmdBaselineOffsetInPixels)
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
		DoCmdBaselineOffsetInPixels(aSection);
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
	else if (aCommand == KCmdGetCharacterData)
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
		DoCmdGetCharacterData(aSection);
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
	else if (aCommand == KCmdMeasureText)
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
		DoCmdMeasureTextL(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
	else if (aCommand == KCmdExtendedFunction)
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
		DoCmdExtendedFunction(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
	else if (aCommand == KCmdTextWidthInPixels)
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
		DoCmdTextWidthInPixels(aSection);
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
	else
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
		ret=EFalse;
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
	return ret;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
	}
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
////////////////// COMMANDS IMPLEMENTATION  ////////////////////////
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
/** Calls CFont::TextCount() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
void CT_DataFont::DoCmdTextCount(const TDesC& aSection)
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
	INFO_PRINTF1(_L("Calls CFont::TextCount()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
	// get text from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
	TPtrC	text;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
	if ( !GetStringFromConfig(aSection, KText(), text) )
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
		ERR_PRINTF2(_L("No %S"), &KText());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
		SetBlockResult(EFail);
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
	// get available width from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
	TInt	widthAvailable = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
	if(!GetIntFromConfig(aSection, KWidthAvailable(), widthAvailable))
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
		ERR_PRINTF2(_L("No %S"), &KWidthAvailable());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
		SetBlockResult(EFail);
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
	// get if to use version of TextCount() that calculates excess from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
	TBool	calculateExcess = EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
	GetBoolFromConfig(aSection, KCalculateExcess(), calculateExcess);
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 TextCount()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
	TInt	result = KErrNone;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
	if ( calculateExcess )
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
		TInt	excess = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
		result = GetFont()->TextCount(text, widthAvailable, excess);
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
		// get expected excess from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
		TInt	expectedExcess = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
		if ( GetIntFromConfig(aSection, KExpectedExcess(), expectedExcess) )
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
			ERR_PRINTF1(_L("An expected excess should not be provided if calculate excess is set to false."));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
			SetBlockResult(EFail);
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
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
		result = GetFont()->TextCount(text, widthAvailable);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
		}
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
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
		if (result != expectedResult)
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
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
		}
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
/** Calls CFont::TextWidthInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
void CT_DataFont::DoCmdTextWidthInPixels(const TDesC& aSection)
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
	INFO_PRINTF1(_L("Calls CFont::TextWidthInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
	// get text from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
	TPtrC	text;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
	if (!GetStringFromConfig(aSection, KText(), text))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
		ERR_PRINTF2(_L("No %S"), &KText());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
		SetBlockResult(EFail);
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
	// call TextWidthInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
	TInt	result = GetFont()->TextWidthInPixels(text);
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
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
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
		if (result != expectedResult)
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
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
			SetBlockResult(EFail);
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
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
	}
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
/** Calls CFont::CharWidthInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
void CT_DataFont::DoCmdCharWidthInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
	INFO_PRINTF1(_L("Calls CFont::CharWidthInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
	// get character code from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
	TInt	charCode = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
	if(!GetIntFromConfig(aSection, KCharCode(), charCode))
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
		ERR_PRINTF2(_L("No %S"), &KCharCode());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
	// call CharWidthInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
	TInt	result = GetFont()->CharWidthInPixels(charCode);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
	TInt 	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
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
		if (result != expectedResult)
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
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
			SetBlockResult(EFail);
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
/** Calls CFont::FontCapitalAscent() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
void CT_DataFont::DoCmdFontCapitalAscent(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
	INFO_PRINTF1(_L("Calls CFont::FontCapitalAscent()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
	// call FontCapitalAscent()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
	TInt	result = GetFont()->FontCapitalAscent();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
			SetBlockResult(EFail);
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
/** Calls CFont::FontMaxAscent() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
void CT_DataFont::DoCmdFontMaxAscent(const TDesC& aSection)
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
	INFO_PRINTF1(_L("Calls CFont::FontMaxAscent()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
	// call FontMaxAscent()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
	TInt	result = GetFont()->FontMaxAscent();
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
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
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
		if (result != expectedResult)
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
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
			SetBlockResult(EFail);
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
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
/** Calls CFont::FontStandardDescent() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
void CT_DataFont::DoCmdFontStandardDescent(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
	INFO_PRINTF1(_L("Calls CFont::FontStandardDescent()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
	// call FontStandardDescent()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
	TInt	result = GetFont()->FontStandardDescent();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
		if (result != expectedResult)
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
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
		}
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
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
/** Calls CFont::FontMaxDescent() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
void CT_DataFont::DoCmdFontMaxDescent(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   361
	INFO_PRINTF1(_L("Calls CFont::FontMaxDescent()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   362
	// call FontMaxDescent()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
	TInt	result = GetFont()->FontMaxDescent();
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
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   366
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   367
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   376
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   377
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
/** Calls CFont::FontLineGap() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   379
void CT_DataFont::DoCmdFontLineGap(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
	INFO_PRINTF1(_L("Calls CFont::FontLineGap()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   382
	// call FontLineGap()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   383
	TInt	result = GetFont()->FontLineGap();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   384
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   385
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   386
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   387
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   388
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   389
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   390
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   391
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   392
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   393
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   394
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   395
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   396
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   397
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   398
/** Calls CFont::FontMaxHeight() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   399
void CT_DataFont::DoCmdFontMaxHeight(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   400
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   401
	INFO_PRINTF1(_L("Calls CFont::FontMaxHeight()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   402
	// call FontMaxHeight()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   403
	TInt	result = GetFont()->FontMaxHeight();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   404
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   405
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   406
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   407
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   408
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   409
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   410
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   411
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   412
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   413
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   414
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   415
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   416
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   417
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   418
/** Calls CFont::TypeUid() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   419
void CT_DataFont::DoCmdTypeUid(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   420
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   421
	INFO_PRINTF1(_L("Calls CFont::TypeUid()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   422
	// call TypeUid()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   423
	TUid	result = GetFont()->TypeUid();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   424
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   425
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   426
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   427
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   428
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   429
		if (result != TUid::Uid(expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   430
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   431
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result.iUid);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   432
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   433
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   434
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   435
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   436
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   437
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   438
/** Calls CFont::HeightInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   439
void CT_DataFont::DoCmdHeightInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   440
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   441
	INFO_PRINTF1(_L("Calls CFont::HeightInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   442
	// call HeightInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   443
	TInt	result = GetFont()->HeightInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   444
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   445
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   446
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   447
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   448
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   449
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   450
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   451
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   452
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   453
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   454
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   455
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   456
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   457
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   458
/** Calls CFont::AscentInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   459
void CT_DataFont::DoCmdAscentInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   460
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   461
	INFO_PRINTF1(_L("Calls CFont::AscentInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   462
	// call AscentInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   463
	TInt	result = GetFont()->AscentInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   464
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   465
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   466
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   467
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   468
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   469
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   470
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   471
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   472
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   473
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   474
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   475
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   476
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   477
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   478
/** Calls CFont::DescentInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   479
void CT_DataFont::DoCmdDescentInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   480
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   481
	INFO_PRINTF1(_L("Calls CFont::DescentInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   482
	// call DescentInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   483
	TInt	result = GetFont()->DescentInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   484
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   485
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   486
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   487
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   488
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   489
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   490
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   491
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   492
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   493
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   494
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   495
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   496
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   497
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   498
/** Calls CFont::MaxCharWidthInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   499
void CT_DataFont::DoCmdMaxCharWidthInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   500
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   501
	INFO_PRINTF1(_L("Calls CFont::MaxCharWidthInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   502
	// call MaxCharWidthInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   503
	TInt	result = GetFont()->MaxCharWidthInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   504
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   505
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   506
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   507
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   508
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   509
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   510
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   511
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   512
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   513
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   514
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   515
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   516
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   517
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   518
/** Calls CFont::MaxNormalCharWidthInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   519
void CT_DataFont::DoCmdMaxNormalCharWidthInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   520
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   521
	INFO_PRINTF1(_L("Calls CFont::MaxNormalCharWidthInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   522
	// call MaxNormalCharWidthInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   523
	TInt	result = GetFont()->MaxNormalCharWidthInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   524
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   525
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   526
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   527
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   528
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   529
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   530
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   531
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   532
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   533
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   534
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   535
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   536
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   537
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   538
/** Calls CFont::FontSpecInTwips() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   539
void CT_DataFont::DoCmdFontSpecInTwips(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   540
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   541
	INFO_PRINTF1(_L("Calls CFont::FontSpecInTwips()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   542
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   543
	// call FontSpecInTwips()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   544
	TFontSpec	fontSpec=GetFont()->FontSpecInTwips();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   545
	INFO_PRINTF3(_L("iName	%S, iHeight    %d"), &fontSpec.iTypeface.iName,fontSpec.iHeight);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   546
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   547
	TFontSpec expectedFontSpec;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   548
	if(GetFontSpecFromConfig(aSection, KExpectedFont(), expectedFontSpec))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   549
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   550
		// just check font name
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   551
		if( fontSpec.iTypeface.iName!=expectedFontSpec.iTypeface.iName)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   552
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   553
			ERR_PRINTF3(_L("The result is not as expected! expected font: %S, actual font: %S"),
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   554
					&expectedFontSpec.iTypeface.iName, &fontSpec.iTypeface.iName);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   555
			SetError(-1);			
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   556
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   557
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   558
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   559
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   560
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   561
/** Calls CFont::WidthZeroInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   562
void CT_DataFont::DoCmdWidthZeroInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   563
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   564
	INFO_PRINTF1(_L("Calls CFont::WidthZeroInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   565
	// call WidthZeroInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   566
	TInt	result = GetFont()->WidthZeroInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   567
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   568
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   569
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   570
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   571
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   572
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   573
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   574
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   575
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   576
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   577
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   578
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   579
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   580
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   581
/** Calls CFont::BaselineOffsetInPixels() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   582
void CT_DataFont::DoCmdBaselineOffsetInPixels(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   583
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   584
	INFO_PRINTF1(_L("Calls CFont::BaselineOffsetInPixels()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   585
	// call BaselineOffsetInPixels()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   586
	TInt	result = GetFont()->BaselineOffsetInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   587
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   588
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   589
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   590
	if(GetIntFromConfig(aSection, KExpectedResult(), expectedResult))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   591
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   592
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   593
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   594
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   595
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   596
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   597
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   598
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   599
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   600
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   601
/** Calls CFont::GetCharacterData() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   602
void CT_DataFont::DoCmdGetCharacterData(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   603
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   604
	INFO_PRINTF1(_L("Calls CFont::GetCharacterData()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   605
	// get character code from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   606
	TInt	charCode = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   607
	if(!GetIntFromConfig(aSection, KCharCode(), charCode))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   608
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   609
		ERR_PRINTF2(_L("No %S"), &KCharCode());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   610
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   611
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   612
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   613
	// call GetCharacterData()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   614
	TUint								code = charCode;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   615
	TOpenFontCharMetrics				metrics;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   616
	const TUint8*						bitmapPointer;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   617
	TSize								bitmapSize;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   618
	CFont::TCharacterDataAvailability	ret=GetFont()->GetCharacterData(code, metrics, bitmapPointer, bitmapSize);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   619
	INFO_PRINTF2(_L("CharacterDataAvailability %d"), ret);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   620
	INFO_PRINTF2(_L("Height                    %d"), bitmapSize.iHeight);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   621
	INFO_PRINTF2(_L("Width                     %d"), bitmapSize.iWidth);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   622
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   623
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   624
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   625
/** Calls CFont::ExtendedFunction() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   626
void CT_DataFont::DoCmdExtendedFunction(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   627
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   628
	INFO_PRINTF1(_L("Calls CFont::ExtendedFunction()"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   629
	// get function UID from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   630
	TInt	uidInt = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   631
	if(!GetHexFromConfig(aSection, KUid(), uidInt))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   632
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   633
		ERR_PRINTF2(_L("No %S"), &KUid());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   634
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   635
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   636
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   637
	// call ExtendedFunction()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   638
	TInt	result=GetFont()->ExtendedFunction(TUid::Uid(uidInt), NULL);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   639
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   640
	// get expected result from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   641
	TInt	expectedResult = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   642
	if ( GetIntFromConfig(aSection, KExpectedResult(), expectedResult) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   643
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   644
		if (result != expectedResult)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   645
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   646
			ERR_PRINTF3(_L("The result is not as expected! expected: %d, actual: %d"), expectedResult, result);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   647
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   648
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   649
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   650
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   651
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   652
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   653
/** Calls CFbsFont::MeasureText() */
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   654
void CT_DataFont::DoCmdMeasureTextL(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   655
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   656
	CFont::TMeasureTextInput*	measureTextInputPointer = NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   657
	GetMeasureTextInputL(*this, KMeasureTextInput(), aSection, measureTextInputPointer);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   658
	if ( measureTextInputPointer==NULL )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   659
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   660
		INFO_PRINTF1(_L("measureTextInputPointer NULL"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   661
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   662
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   663
	CFont::TMeasureTextOutput*	measureTextOutputPointer = NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   664
	GetMeasureTextOutputL(*this, KMeasureTextOutput(), aSection, measureTextOutputPointer);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   665
	if ( measureTextOutputPointer==NULL )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   666
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   667
		INFO_PRINTF1(_L("measureTextOutputPointer NULL"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   668
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   669
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   670
	// get text from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   671
	TPtrC	text;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   672
	if (!GetStringFromConfig(aSection, KText(), text))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   673
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   674
		ERR_PRINTF2(_L("No %S"), &KText());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   675
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   676
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   677
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   678
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   679
		TInt	width=GetFont()->MeasureText(text, measureTextInputPointer, measureTextOutputPointer);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   680
		INFO_PRINTF2(_L("MeasureText %d"), width);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   681
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   682
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   683
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   684
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   685
////////////////// UTIL METHODS ////////////////////////
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   686
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   687
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   688
/**
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   689
* Utility method that fetches TMeasureTextInput pointer by command parameter name from INI-file.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   690
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   691
TBool CT_DataFont::GetMeasureTextInputL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection, CFont::TMeasureTextInput*& aMeasureTextInput)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   692
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   693
	// get MeasureTextInputData object from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   694
	TPtrC	measureTextInputDataObjectName;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   695
	TBool	ret=aDataWrapper.GetStringFromConfig(aSection, aParameterName, measureTextInputDataObjectName);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   696
	if ( ret )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   697
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   698
		// check that the data object was found
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   699
		aMeasureTextInput=static_cast<CFont::TMeasureTextInput*>(aDataWrapper.GetDataObjectL(measureTextInputDataObjectName));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   700
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   701
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   702
	return ret;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   703
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   704
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   705
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   706
/**
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   707
* Utility method that fetches TMeasureTextOutput pointer by command parameter name from INI-file.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   708
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   709
TBool CT_DataFont::GetMeasureTextOutputL(CDataWrapper& aDataWrapper, const TDesC& aParameterName, const TDesC& aSection, CFont::TMeasureTextOutput*& aMeasureTextOutput)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   710
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   711
	// get MeasureTextOutputData object from parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   712
	TPtrC	measureTextOutputDataObjectName;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   713
	TBool	ret=aDataWrapper.GetStringFromConfig(aSection, aParameterName, measureTextOutputDataObjectName);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   714
	if ( ret )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   715
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   716
		// check that the data object was found
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   717
		aMeasureTextOutput=static_cast<CFont::TMeasureTextOutput*>(aDataWrapper.GetDataObjectL(measureTextOutputDataObjectName));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   718
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   719
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   720
	return ret;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   721
	}