graphics/fbserv/src/T_DataFbsSession.cpp
branchSymbian2
changeset 1 8758140453c0
child 3 235c00e46fb7
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 /**
       
    19 @test
       
    20 @internalComponent
       
    21 
       
    22 This contains CT_DataFbsSession
       
    23 */
       
    24 
       
    25 #include "T_DataFbsSession.h"
       
    26 #include "T_GraphicsUtil.h"
       
    27 
       
    28 
       
    29 /*@{*/
       
    30 ///	Parameters
       
    31 _LIT(KSession,										"session");
       
    32 _LIT(KInvalidSession,								"invalid_session");
       
    33 _LIT(KNullSession,									"null_session");
       
    34 _LIT(KExpectedCallBack,								"expected");
       
    35 _LIT(KExpectedDiff,									"expected_diff");
       
    36 _LIT(KFbsMessage,									"fbs_message");
       
    37 _LIT(KBitmap,										"bitmap");
       
    38 _LIT(KFbsParameter0,								"parameter0");
       
    39 _LIT(KFbsParameter1,								"parameter1");
       
    40 _LIT(KFbsParameter2,								"parameter2");
       
    41 _LIT(KFbsParameter3,								"parameter3");
       
    42 _LIT(KVersionName,									"name");
       
    43 _LIT(KVersionBuild,									"build");
       
    44 _LIT(KVersionMajor,									"major");
       
    45 _LIT(KVersionMinor,									"minor");
       
    46 
       
    47 ///	Commands
       
    48 _LIT(KCmdConstructor,								"Constructor");
       
    49 _LIT(KCmdConnect,									"Connect");
       
    50 _LIT(KCmdDisconnect,								"Disconnect");
       
    51 _LIT(KCmdGetSession,								"GetSession");
       
    52 _LIT(KCmdCallBack,									"CallBack");
       
    53 _LIT(KCmdSetCallBack,								"SetCallBack");
       
    54 _LIT(KCmdResetCallBack,								"ResetCallBack");
       
    55 _LIT(KCmdResourceCount,								"ResourceCount");
       
    56 _LIT(KCmdSendCommand,								"SendCommand");
       
    57 _LIT(KCmdVersion,									"Version");
       
    58 _LIT(KCmdHeapBase,									"HeapBase");
       
    59 _LIT(KCmdSessionHandle,								"SessionHandle");
       
    60 
       
    61 _LIT(KFbsMessInit,									"EFbsMessInit");
       
    62 _LIT(KFbsMessShutdown,								"EFbsMessShutdown");
       
    63 _LIT(KFbsMessClose,									"EFbsMessClose");
       
    64 _LIT(KFbsMessResourceCount,							"EFbsMessResourceCount");
       
    65 _LIT(KFbsMessNumTypefaces,							"EFbsMessNumTypefaces");
       
    66 _LIT(KFbsMessTypefaceSupport,						"EFbsMessTypefaceSupport");
       
    67 _LIT(KFbsMessFontHeightInTwips,						"EFbsMessFontHeightInTwips");
       
    68 _LIT(KFbsMessFontHeightInPixels,					"EFbsMessFontHeightInPixels");
       
    69 _LIT(KFbsMessAddFontStoreFile,						"EFbsMessAddFontStoreFile");
       
    70 _LIT(KFbsMessInstallFontStoreFile,					"EFbsMessInstallFontStoreFile");
       
    71 _LIT(KFbsMessRemoveFontStoreFile,					"EFbsMessRemoveFontStoreFile");
       
    72 _LIT(KFbsMessSetPixelHeight,						"EFbsMessSetPixelHeight");
       
    73 _LIT(KFbsMessGetFontById,							"EFbsMessGetFontById");
       
    74 _LIT(KFbsMessFontDuplicate,							"EFbsMessFontDuplicate");
       
    75 _LIT(KFbsMessBitmapCreate,							"EFbsMessBitmapCreate");
       
    76 _LIT(KFbsMessBitmapResize,							"EFbsMessBitmapResize");
       
    77 _LIT(KFbsMessBitmapDuplicate,						"EFbsMessBitmapDuplicate");
       
    78 _LIT(KFbsMessBitmapLoad,							"EFbsMessBitmapLoad");
       
    79 _LIT(KFbsMessDefaultAllocFail,						"EFbsMessDefaultAllocFail");
       
    80 _LIT(KFbsMessDefaultMark,							"EFbsMessDefaultMark");
       
    81 _LIT(KFbsMessDefaultMarkEnd,						"EFbsMessDefaultMarkEnd");
       
    82 _LIT(KFbsMessUserAllocFail,							"EFbsMessUserAllocFail");
       
    83 _LIT(KFbsMessUserMark,								"EFbsMessUserMark");
       
    84 _LIT(KFbsMessUserMarkEnd,							"EFbsMessUserMarkEnd");
       
    85 _LIT(KFbsMessHeapCheck,								"EFbsMessHeapCheck");
       
    86 _LIT(KFbsMessRasterize,								"EFbsMessRasterize");
       
    87 _LIT(KFbsMessFaceAttrib,							"EFbsMessFaceAttrib");
       
    88 _LIT(KFbsMessHasCharacter,							"EFbsMessHasCharacter");
       
    89 _LIT(KFbsMessSetDefaultGlyphBitmapType,				"EFbsMessSetDefaultGlyphBitmapType");
       
    90 _LIT(KFbsMessGetDefaultGlyphBitmapType,				"EFbsMessGetDefaultGlyphBitmapType");
       
    91 _LIT(KFbsMessFontNameAlias,							"EFbsMessFontNameAlias");
       
    92 _LIT(KFbsMessBitmapCompress,						"EFbsMessBitmapCompress");
       
    93 _LIT(KFbsMessGetHeapSizes,							"EFbsMessGetHeapSizes");
       
    94 _LIT(KFbsMessGetNearestFontToDesignHeightInTwips,	"EFbsMessGetNearestFontToDesignHeightInTwips");
       
    95 _LIT(KFbsMessGetNearestFontToMaxHeightInTwips,		"EFbsMessGetNearestFontToMaxHeightInTwips");
       
    96 _LIT(KFbsMessGetNearestFontToDesignHeightInPixels,	"EFbsMessGetNearestFontToDesignHeightInPixels");
       
    97 _LIT(KFbsMessGetNearestFontToMaxHeightInPixels,		"EFbsMessGetNearestFontToMaxHeightInPixels");
       
    98 _LIT(KFbsMessShapeText,								"EFbsMessShapeText");
       
    99 _LIT(KFbsMessShapeDelete,							"EFbsMessShapeDelete");
       
   100 _LIT(KFbsMessDefaultLanguageForMetrics,				"EFbsMessDefaultLanguageForMetrics");
       
   101 _LIT(KFbsMessSetTwipsHeight,						"EFbsMessSetTwipsHeight");
       
   102 _LIT(KFbsMessGetTwipsHeight,						"EFbsMessGetTwipsHeight");
       
   103 _LIT(KFbsCompress,									"EFbsCompress");
       
   104 _LIT(KFbsMessBitmapBgCompress,						"EFbsMessBitmapBgCompress");
       
   105 _LIT(KFbsSetSystemDefaultTypefaceName,				"EFbsSetSystemDefaultTypefaceName");
       
   106 _LIT(KFbsGetAllBitmapHandles,						"EFbsGetAllBitmapHandles");
       
   107 _LIT(KFbsMessCreateLinkedTypeface,					"EFbsMessCreateLinkedTypeface");
       
   108 _LIT(KFbsMessSetHeapFail,							"EFbsMessSetHeapFail");
       
   109 _LIT(KFbsMessHeapCount,								"EFbsMessHeapCount");
       
   110 _LIT(KFbsMessSetHeapReset,							"EFbsMessSetHeapReset");
       
   111 _LIT(KFbsMessSetHeapCheck,							"EFbsMessSetHeapCheck");
       
   112 _LIT(KFbsMessHeap,									"EFbsMessHeap");
       
   113 _LIT(KFbsMessLinkedCache,							"EFbsMessLinkedCache");
       
   114 _LIT(KFbsMessBitmapClean,							"EFbsMessBitmapClean");
       
   115 /*@}*/
       
   116 
       
   117 /**
       
   118 * Two phase constructor
       
   119 */
       
   120 CT_DataFbsSession* CT_DataFbsSession::NewL()
       
   121 	{
       
   122 	CT_DataFbsSession*	ret = new (ELeave) CT_DataFbsSession();
       
   123 	CleanupStack::PushL(ret);
       
   124 	ret->ConstructL();
       
   125 	CleanupStack::Pop(ret);
       
   126 	return ret;
       
   127 	}
       
   128 
       
   129 /**
       
   130 * Protected constructor. First phase construction
       
   131 */
       
   132 CT_DataFbsSession::CT_DataFbsSession()
       
   133 :	CDataWrapperBase()
       
   134 ,	iSession(NULL)
       
   135 ,	iResourceCount(-1)
       
   136 ,	iCallBackCalled(EFalse)
       
   137 	{
       
   138 	}
       
   139 
       
   140 /**
       
   141 * Second phase construction
       
   142 */
       
   143 void CT_DataFbsSession::ConstructL()
       
   144 	{
       
   145 	}
       
   146 
       
   147 /**
       
   148 * Protected destructor.
       
   149 */
       
   150 CT_DataFbsSession::~CT_DataFbsSession()
       
   151 	{
       
   152 	}
       
   153 
       
   154 /**
       
   155 * Process a command read from the ini file
       
   156 *
       
   157 * @param aDataWrapper	test step requiring command to be processed
       
   158 * @param aCommand	the command to process
       
   159 * @param aSection		the entry in the ini file requiring the command to be processed
       
   160 *
       
   161 * @return ETrue if the command is processed
       
   162 */
       
   163 TBool CT_DataFbsSession::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
       
   164 	{
       
   165 	TBool	ret=ETrue;
       
   166 
       
   167 	if (aCommand == KCmdConstructor)
       
   168 		{
       
   169 		DoCmdConstructor();
       
   170 		}
       
   171 	else if (aCommand == KCmdConnect)
       
   172 		{
       
   173 		DoCmdConnect(aSection);
       
   174 		}
       
   175 	else if (aCommand == KCmdDisconnect)
       
   176 		{
       
   177 		DoCmdDisconnect();
       
   178 		}
       
   179 	else if (aCommand == KCmdGetSession)
       
   180 		{
       
   181 		DoCmdGetSession(aSection);
       
   182 		}
       
   183 	else if (aCommand == KCmdCallBack)
       
   184 		{
       
   185 		DoCmdCallBack(aSection);
       
   186 		}
       
   187 	else if (aCommand == KCmdResetCallBack)
       
   188 		{
       
   189 		DoCmdResetCallBack();
       
   190 		}
       
   191 	else if (aCommand == KCmdSetCallBack)
       
   192 		{
       
   193 		DoCmdSetCallBack();
       
   194 		}
       
   195 	else if (aCommand == KCmdResourceCount)
       
   196 		{
       
   197 		DoCmdResourceCount(aSection);
       
   198 		}
       
   199 	else if (aCommand == KCmdSendCommand)
       
   200 		{
       
   201 		DoCmdSendCommandL(aSection);
       
   202 		}
       
   203 	else if (aCommand == KCmdVersion)
       
   204 		{
       
   205 		DoCmdVersion(aSection);
       
   206 		}
       
   207 	else if (aCommand == KCmdHeapBase)
       
   208 		{
       
   209 		DoCmdHeapBase();
       
   210 		}
       
   211 	else if (aCommand == KCmdSessionHandle)
       
   212 		{
       
   213 		DoCmdSessionHandle();
       
   214 		}
       
   215 	else
       
   216 		{
       
   217 		ret=EFalse;
       
   218 		}
       
   219 
       
   220 	return ret;
       
   221 	}
       
   222 
       
   223 
       
   224 void CT_DataFbsSession::DoCmdConstructor()
       
   225 	{
       
   226 	INFO_PRINTF1(_L("Call RFbsSession's constructor"));
       
   227 
       
   228 	RFbsSession	tempSession;
       
   229 	}
       
   230 
       
   231 
       
   232 /** RFbsSession::Connect() Call */
       
   233 void CT_DataFbsSession::DoCmdConnect(const TDesC& aSection)
       
   234 	{
       
   235 	INFO_PRINTF1(_L("RFbsSession::Connect() call"));
       
   236 
       
   237 	TBool	session=EFalse;
       
   238 	GetBoolFromConfig(aSection, KSession(), session);
       
   239 
       
   240 	TBool	invalidSession=EFalse;
       
   241 	GetBoolFromConfig(aSection, KInvalidSession(), invalidSession);
       
   242 
       
   243 	TInt	err=KErrNone;
       
   244 	if ( session )
       
   245 		{
       
   246 		err=RFbsSession::Connect(FileServer());
       
   247 		}
       
   248 	else if ( invalidSession )
       
   249 		{
       
   250 		err=RFbsSession::Connect(iFsUnconnected);
       
   251 		}
       
   252 	else
       
   253 		{
       
   254 		err=RFbsSession::Connect();
       
   255 		}
       
   256 
       
   257 	if ( err!=KErrNone )
       
   258 		{
       
   259 		ERR_PRINTF2(_L("Connect failed with error %d"), err);
       
   260 		SetError(err);
       
   261 		}
       
   262 	}
       
   263 
       
   264 /** RFbsSession::Disconnect() call */
       
   265 void CT_DataFbsSession::DoCmdDisconnect()
       
   266 	{
       
   267 	INFO_PRINTF1(_L("RFbsSession::Disconnect() call"));
       
   268 	RFbsSession::Disconnect();
       
   269 	}
       
   270 
       
   271 /** RFbsSession::GetSession() check */
       
   272 void CT_DataFbsSession::DoCmdGetSession(const TDesC& aSection)
       
   273 	{
       
   274 	INFO_PRINTF1(_L("RFbsSession::GetSession() check"));
       
   275 
       
   276 	// get not_null_session parameter value
       
   277 
       
   278 	TBool	nullSessionExpected = EFalse;
       
   279 	GetBoolFromConfig(aSection, KNullSession(), nullSessionExpected);
       
   280 
       
   281 	// check result of GetSession() method
       
   282 	iSession = RFbsSession::GetSession();
       
   283 
       
   284 	if ( nullSessionExpected )
       
   285 		{
       
   286 		if ( iSession != NULL )
       
   287 			{
       
   288 			// Session is expected to be null but it is not null
       
   289 			ERR_PRINTF1(_L("Session is expected to be null but it is not null!"));
       
   290 			SetBlockResult(EFail);
       
   291 			}
       
   292 		}
       
   293 	else
       
   294 		{
       
   295 		if ( iSession == NULL )
       
   296 			{
       
   297 			ERR_PRINTF1(_L("Session is expected to be not null but it is null!"));
       
   298 			SetBlockResult(EFail);
       
   299 			}
       
   300 		}
       
   301 	}
       
   302 
       
   303 
       
   304 /** RFbsSession::CallBack() call */
       
   305 void CT_DataFbsSession::DoCmdCallBack(const TDesC& aSection)
       
   306 	{
       
   307 	INFO_PRINTF1(_L("RFbsSession::CallBack() call"));
       
   308 	iCallBackCalled=EFalse;
       
   309 	iSession->CallBack();
       
   310 
       
   311 	// get expected callback parameter value
       
   312 	TBool	expected;
       
   313 	if( GetBoolFromConfig(aSection, KExpectedCallBack(), expected) )
       
   314 		{
       
   315 		if ( expected != iCallBackCalled )
       
   316 			{
       
   317 			ERR_PRINTF3(_L("Expected callback %d does not equal actual callback %d"), expected, iCallBackCalled);
       
   318 			SetBlockResult(EFail);
       
   319 			}
       
   320 		}
       
   321 	}
       
   322 
       
   323 
       
   324 /** Set call back function uding RFbsSession::SetCallBack() */
       
   325 void CT_DataFbsSession::DoCmdSetCallBack()
       
   326 	{
       
   327 	INFO_PRINTF1(_L("Set call back function uding SetCallBack()"));
       
   328 	TCallBack	callBack(CallBackFunction, this);
       
   329 	iCallBackCalled=EFalse;
       
   330 	iSession->SetCallBack(callBack);
       
   331 	}
       
   332 
       
   333 
       
   334 /** RFbsSession::ResetCallBack() call */
       
   335 void CT_DataFbsSession::DoCmdResetCallBack()
       
   336 	{
       
   337 	INFO_PRINTF1(_L("RFbsSession::ResetCallBack() call"));
       
   338 	iCallBackCalled=EFalse;
       
   339 	iSession->ResetCallBack();
       
   340 	}
       
   341 
       
   342 
       
   343 /** RFbsSession::ResourceCount() call, memorize resource count */
       
   344 void CT_DataFbsSession::DoCmdResourceCount(const TDesC& aSection)
       
   345 	{
       
   346 	TInt	resourceCount=iSession->ResourceCount();
       
   347 	INFO_PRINTF2(_L("RFbsSession::ResourceCount() %d"), resourceCount);
       
   348 
       
   349 
       
   350 	// get expected difference from parameters
       
   351 	TInt	expectedDifference;
       
   352 	if ( GetIntFromConfig(aSection, KExpectedDiff(), expectedDifference) )
       
   353 		{
       
   354 		TInt	actualDifference=resourceCount-iResourceCount;
       
   355 		if ( actualDifference != expectedDifference )
       
   356 			{
       
   357 			ERR_PRINTF3(_L("Resource count difference is not as expected! expected: %d, actual: %d"), expectedDifference, actualDifference);
       
   358 			SetBlockResult(EFail);
       
   359 			}
       
   360 		}
       
   361 
       
   362 	iResourceCount = resourceCount;
       
   363 	}
       
   364 
       
   365 
       
   366 /** RFbsSession::SendCommand() call */
       
   367 void CT_DataFbsSession::DoCmdSendCommandL(const TDesC& aSection)
       
   368 	{
       
   369 	INFO_PRINTF1(_L("RFbsSession::SendCommand() call"));
       
   370 
       
   371 	TInt		fbsParameter0=0;
       
   372 	CFbsBitmap*	fbsBitmap=NULL;
       
   373 	if ( CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KBitmap(), fbsBitmap) )
       
   374 		{
       
   375 		fbsParameter0=fbsBitmap->Handle();
       
   376 		}
       
   377 	else
       
   378 		{
       
   379 		GetIntFromConfig(aSection, KFbsParameter0(), fbsParameter0);
       
   380 		}
       
   381 
       
   382 	TInt	fbsParameter1=0;
       
   383 	GetIntFromConfig(aSection, KFbsParameter1(), fbsParameter1);
       
   384 
       
   385 	TInt	fbsParameter2=0;
       
   386 	GetIntFromConfig(aSection, KFbsParameter2(), fbsParameter2);
       
   387 
       
   388 	TInt	fbsParameter3=0;
       
   389 	GetIntFromConfig(aSection, KFbsParameter3(), fbsParameter3);
       
   390 
       
   391 	TInt	fbsMessage;
       
   392 	if ( !GetFbsMessage(aSection, fbsMessage) )
       
   393 		{
       
   394 		ERR_PRINTF1(_L("No fbs message"));
       
   395 		SetBlockResult(EFail);
       
   396 		}
       
   397 	else
       
   398 		{
       
   399 		iSession->SendCommand(fbsMessage, fbsParameter0, fbsParameter1, fbsParameter2, fbsParameter3);
       
   400 		}
       
   401 	}
       
   402 
       
   403 
       
   404 /** RFbsSession::Version() call */
       
   405 void CT_DataFbsSession::DoCmdVersion(const TDesC& aSection)
       
   406 	{
       
   407 	INFO_PRINTF1(_L("RFbsSession::Version() call"));
       
   408 
       
   409 	TVersion		version		= iSession->Version();
       
   410 	TVersionName	versionName	= version.Name();
       
   411 	INFO_PRINTF2(_L("Version name  : %s"), &versionName);
       
   412 	INFO_PRINTF2(_L("Version build : %d"), (TInt)version.iBuild);
       
   413 	INFO_PRINTF2(_L("Version major : %d"), (TInt)version.iMajor);
       
   414 	INFO_PRINTF2(_L("Version minor : %d"), (TInt)version.iMinor);
       
   415 
       
   416 	TPtrC	name;
       
   417 	if ( GetStringFromConfig(aSection, KVersionName(), name) )
       
   418 		{
       
   419 		if ( name != version.Name() )
       
   420 			{
       
   421 			ERR_PRINTF1(_L("Name does not match expected name"));
       
   422 			SetBlockResult(EFail);
       
   423 			}
       
   424 		}
       
   425 
       
   426 	TInt	intTemp;
       
   427 	if ( GetIntFromConfig(aSection, KVersionBuild(), intTemp) )
       
   428 		{
       
   429 		if ( intTemp != version.iBuild )
       
   430 			{
       
   431 			ERR_PRINTF1(_L("Build does not match expected build"));
       
   432 			SetBlockResult(EFail);
       
   433 			}
       
   434 		}
       
   435 
       
   436 	if ( GetIntFromConfig(aSection, KVersionMajor(), intTemp) )
       
   437 		{
       
   438 		if ( intTemp != version.iMajor )
       
   439 			{
       
   440 			ERR_PRINTF1(_L("Major does not match expected major"));
       
   441 			SetBlockResult(EFail);
       
   442 			}
       
   443 		}
       
   444 
       
   445 	if ( GetIntFromConfig(aSection, KVersionMinor(), intTemp) )
       
   446 		{
       
   447 		if ( intTemp != version.iMinor )
       
   448 			{
       
   449 			ERR_PRINTF1(_L("Minor does not match expected minor"));
       
   450 			SetBlockResult(EFail);
       
   451 			}
       
   452 		}
       
   453 
       
   454 	if (version.Name() == _L("") && version.iBuild == 0 && version.iMajor == 0 && version.iMinor == 0)
       
   455 		{
       
   456 		ERR_PRINTF1(_L("Some version fields are not set!"));
       
   457 		SetBlockResult(EFail);
       
   458 		}
       
   459 	}
       
   460 
       
   461 
       
   462 /** RFbsSession::HeapBase() call */
       
   463 void CT_DataFbsSession::DoCmdHeapBase()
       
   464 	{
       
   465 	TUint8*	heapBase = iSession->HeapBase();
       
   466 	INFO_PRINTF2(_L("RFbsSession::HeapBase() %d"), heapBase);
       
   467 
       
   468 	if (heapBase == NULL)
       
   469 		{
       
   470 		ERR_PRINTF1(_L("Heap base is null!"));
       
   471 		SetBlockResult(EFail);
       
   472 		}
       
   473 	}
       
   474 
       
   475 
       
   476 /** RFbsSession::SessionHandle() call */
       
   477 void CT_DataFbsSession::DoCmdSessionHandle()
       
   478 	{
       
   479 	TInt	sessionHandle = iSession->SessionHandle();
       
   480 	INFO_PRINTF2(_L("RFbsSession::SessionHandle() %d"), sessionHandle);
       
   481 
       
   482 	if (sessionHandle == 0)
       
   483 		{
       
   484 		ERR_PRINTF1(_L("Session handle is 0!"));
       
   485 		SetBlockResult(EFail);
       
   486 		}
       
   487 	}
       
   488 
       
   489 
       
   490 /**
       
   491 * Return a pointer to the object that the data wraps. Not implemented, returns NULL.
       
   492 *
       
   493 * @return pointer to the object that the data wraps. Not implemented, returns NULL.
       
   494 */
       
   495 TAny* CT_DataFbsSession::GetObject()
       
   496 	{
       
   497 	return iSession;
       
   498 	}
       
   499 
       
   500 
       
   501 /** Function used as a call back, that sets GlobalCallBackCalled to true*/
       
   502 TInt CT_DataFbsSession::CallBackFunction(TAny* aThis)
       
   503 	{
       
   504 	return static_cast<CT_DataFbsSession*>(aThis)->CallBackFunction();
       
   505 	}
       
   506 
       
   507 
       
   508 /** Function used as a call back, that sets GlobalCallBackCalled to true*/
       
   509 TInt CT_DataFbsSession::CallBackFunction()
       
   510 	{
       
   511 	return iCallBackCalled = ETrue;
       
   512 	}
       
   513 
       
   514 TBool CT_DataFbsSession::GetFbsMessage(const TDesC& aSection, TInt& aMessage)
       
   515 	{
       
   516 	TPtrC	fbsMessage;
       
   517 	TBool	ret=GetStringFromConfig(aSection, KFbsMessage(), fbsMessage);
       
   518 	if ( !ret )
       
   519 		{
       
   520 		ERR_PRINTF2(_L("No %S"), &KFbsMessage());
       
   521 		SetBlockResult(EFail);
       
   522 		}
       
   523 	else
       
   524 		{
       
   525 		if ( fbsMessage==KFbsMessInit )
       
   526 			{
       
   527 			aMessage = EFbsMessInit;
       
   528 			}
       
   529 		else if ( fbsMessage==KFbsMessShutdown )
       
   530 			{
       
   531 			aMessage = EFbsMessShutdown;
       
   532 			}
       
   533 		else if ( fbsMessage==KFbsMessClose )
       
   534 			{
       
   535 			aMessage = EFbsMessClose;
       
   536 			}
       
   537 		else if ( fbsMessage==KFbsMessResourceCount )
       
   538 			{
       
   539 			aMessage = EFbsMessResourceCount;
       
   540 			}
       
   541 		else if ( fbsMessage==KFbsMessNumTypefaces )
       
   542 			{
       
   543 			aMessage = EFbsMessNumTypefaces;
       
   544 			}
       
   545 		else if ( fbsMessage==KFbsMessTypefaceSupport )
       
   546 			{
       
   547 			aMessage = EFbsMessTypefaceSupport;
       
   548 			}
       
   549 		else if ( fbsMessage==KFbsMessFontHeightInTwips )
       
   550 			{
       
   551 			aMessage = EFbsMessFontHeightInTwips;
       
   552 			}
       
   553 		else if ( fbsMessage==KFbsMessFontHeightInPixels )
       
   554 			{
       
   555 			aMessage = EFbsMessFontHeightInPixels;
       
   556 			}
       
   557 		else if ( fbsMessage==KFbsMessAddFontStoreFile )
       
   558 			{
       
   559 			aMessage = EFbsMessAddFontStoreFile;
       
   560 			}
       
   561 		else if ( fbsMessage==KFbsMessInstallFontStoreFile )
       
   562 			{
       
   563 			aMessage = EFbsMessInstallFontStoreFile;
       
   564 			}
       
   565 		else if ( fbsMessage==KFbsMessRemoveFontStoreFile )
       
   566 			{
       
   567 			aMessage = EFbsMessRemoveFontStoreFile;
       
   568 			}
       
   569 		else if ( fbsMessage==KFbsMessSetPixelHeight )
       
   570 			{
       
   571 			aMessage = EFbsMessSetPixelHeight;
       
   572 			}
       
   573 		else if ( fbsMessage==KFbsMessGetFontById )
       
   574 			{
       
   575 			aMessage = EFbsMessGetFontById;
       
   576 			}
       
   577 		else if ( fbsMessage==KFbsMessFontDuplicate )
       
   578 			{
       
   579 			aMessage = EFbsMessFontDuplicate;
       
   580 			}
       
   581 		else if ( fbsMessage==KFbsMessBitmapCreate )
       
   582 			{
       
   583 			aMessage = EFbsMessBitmapCreate;
       
   584 			}
       
   585 		else if ( fbsMessage==KFbsMessBitmapResize )
       
   586 			{
       
   587 			aMessage = EFbsMessBitmapResize;
       
   588 			}
       
   589 		else if ( fbsMessage==KFbsMessBitmapDuplicate )
       
   590 			{
       
   591 			aMessage = EFbsMessBitmapDuplicate;
       
   592 			}
       
   593 		else if ( fbsMessage==KFbsMessBitmapLoad )
       
   594 			{
       
   595 			aMessage = EFbsMessBitmapLoad;
       
   596 			}
       
   597 		else if ( fbsMessage==KFbsMessDefaultAllocFail )
       
   598 			{
       
   599 			aMessage = EFbsMessDefaultAllocFail;
       
   600 			}
       
   601 		else if ( fbsMessage==KFbsMessDefaultMark )
       
   602 			{
       
   603 			aMessage = EFbsMessDefaultMark;
       
   604 			}
       
   605 		else if ( fbsMessage==KFbsMessDefaultMarkEnd )
       
   606 			{
       
   607 			aMessage = EFbsMessDefaultMarkEnd;
       
   608 			}
       
   609 		else if ( fbsMessage==KFbsMessUserAllocFail )
       
   610 			{
       
   611 			aMessage = EFbsMessUserAllocFail;
       
   612 			}
       
   613 		else if ( fbsMessage==KFbsMessUserMark )
       
   614 			{
       
   615 			aMessage = EFbsMessUserMark;
       
   616 			}
       
   617 		else if ( fbsMessage==KFbsMessUserMarkEnd )
       
   618 			{
       
   619 			aMessage = EFbsMessUserMarkEnd;
       
   620 			}
       
   621 		else if ( fbsMessage==KFbsMessHeapCheck )
       
   622 			{
       
   623 			aMessage = EFbsMessHeapCheck;
       
   624 			}
       
   625 		else if ( fbsMessage==KFbsMessRasterize )
       
   626 			{
       
   627 			aMessage = EFbsMessRasterize;
       
   628 			}
       
   629 		else if ( fbsMessage==KFbsMessFaceAttrib )
       
   630 			{
       
   631 			aMessage = EFbsMessFaceAttrib;
       
   632 			}
       
   633 		else if ( fbsMessage==KFbsMessHasCharacter )
       
   634 			{
       
   635 			aMessage = EFbsMessHasCharacter;
       
   636 			}
       
   637 		else if ( fbsMessage==KFbsMessSetDefaultGlyphBitmapType )
       
   638 			{
       
   639 			aMessage = EFbsMessSetDefaultGlyphBitmapType;
       
   640 			}
       
   641 		else if ( fbsMessage==KFbsMessGetDefaultGlyphBitmapType )
       
   642 			{
       
   643 			aMessage = EFbsMessGetDefaultGlyphBitmapType;
       
   644 			}
       
   645 		else if ( fbsMessage==KFbsMessFontNameAlias )
       
   646 			{
       
   647 			aMessage = EFbsMessFontNameAlias;
       
   648 			}
       
   649 		else if ( fbsMessage==KFbsMessBitmapCompress )
       
   650 			{
       
   651 			aMessage = EFbsMessBitmapCompress;
       
   652 			}
       
   653 		else if ( fbsMessage==KFbsMessGetHeapSizes )
       
   654 			{
       
   655 			aMessage = EFbsMessGetHeapSizes;
       
   656 			}
       
   657 		else if ( fbsMessage==KFbsMessGetNearestFontToDesignHeightInTwips )
       
   658 			{
       
   659 			aMessage = EFbsMessGetNearestFontToDesignHeightInTwips;
       
   660 			}
       
   661 		else if ( fbsMessage==KFbsMessGetNearestFontToMaxHeightInTwips )
       
   662 			{
       
   663 			aMessage = EFbsMessGetNearestFontToMaxHeightInTwips;
       
   664 			}
       
   665 		else if ( fbsMessage==KFbsMessGetNearestFontToDesignHeightInPixels )
       
   666 			{
       
   667 			aMessage = EFbsMessGetNearestFontToDesignHeightInPixels;
       
   668 			}
       
   669 		else if ( fbsMessage==KFbsMessGetNearestFontToMaxHeightInPixels )
       
   670 			{
       
   671 			aMessage = EFbsMessGetNearestFontToMaxHeightInPixels;
       
   672 			}
       
   673 		else if ( fbsMessage==KFbsMessShapeText )
       
   674 			{
       
   675 			aMessage = EFbsMessShapeText;
       
   676 			}
       
   677 		else if ( fbsMessage==KFbsMessShapeDelete )
       
   678 			{
       
   679 			aMessage = EFbsMessShapeDelete;
       
   680 			}
       
   681 		else if ( fbsMessage==KFbsMessDefaultLanguageForMetrics )
       
   682 			{
       
   683 			aMessage = EFbsMessDefaultLanguageForMetrics;
       
   684 			}
       
   685 		else if ( fbsMessage==KFbsMessSetTwipsHeight )
       
   686 			{
       
   687 			aMessage = EFbsMessSetTwipsHeight;
       
   688 			}
       
   689 		else if ( fbsMessage==KFbsMessGetTwipsHeight )
       
   690 			{
       
   691 			aMessage = EFbsMessGetTwipsHeight;
       
   692 			}
       
   693 		else if ( fbsMessage==KFbsCompress )
       
   694 			{
       
   695 			aMessage = EFbsCompress;
       
   696 			}
       
   697 		else if ( fbsMessage==KFbsMessBitmapBgCompress )
       
   698 			{
       
   699 			aMessage = EFbsMessBitmapBgCompress;
       
   700 			}
       
   701 
       
   702 		else if ( fbsMessage==KFbsSetSystemDefaultTypefaceName )
       
   703 			{
       
   704 			aMessage = EFbsSetSystemDefaultTypefaceName;
       
   705 			}
       
   706 		else if ( fbsMessage==KFbsGetAllBitmapHandles )
       
   707 			{
       
   708 			aMessage = EFbsGetAllBitmapHandles;
       
   709 			}
       
   710 		else if ( fbsMessage==KFbsMessCreateLinkedTypeface )
       
   711 			{
       
   712 			aMessage = EFbsMessCreateLinkedTypeface;
       
   713 			}
       
   714 		else if ( fbsMessage==KFbsMessSetHeapFail )
       
   715 			{
       
   716 			aMessage = EFbsMessSetHeapFail;
       
   717 			}
       
   718 		else if ( fbsMessage==KFbsMessHeapCount )
       
   719 			{
       
   720 			aMessage = EFbsMessHeapCount;
       
   721 			}
       
   722 		else if ( fbsMessage==KFbsMessSetHeapReset )
       
   723 			{
       
   724 			aMessage = EFbsMessSetHeapReset;
       
   725 			}
       
   726 		else if ( fbsMessage==KFbsMessSetHeapCheck )
       
   727 			{
       
   728 			aMessage = EFbsMessSetHeapCheck;
       
   729 			}
       
   730 		else if ( fbsMessage==KFbsMessHeap )
       
   731 			{
       
   732 			aMessage = EFbsMessHeap;
       
   733 			}
       
   734 		else if ( fbsMessage==KFbsMessLinkedCache )
       
   735 			{
       
   736 			aMessage = EFbsMessLinkedCache;
       
   737 			}
       
   738 		else if ( fbsMessage==KFbsMessBitmapClean )
       
   739 			{
       
   740 			aMessage = EFbsMessBitmapClean;
       
   741 			}
       
   742 		else
       
   743 			{
       
   744 			ret=GetIntFromConfig(aSection, KFbsMessage(), aMessage);
       
   745 			}
       
   746 		}
       
   747 
       
   748 	return ret;
       
   749 	}