graphics/wserv/src/T_DataWindowGroup.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
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 #include "T_DataWindowGroup.h"
       
    19 #include "T_GraphicsUtil.h"
       
    20 
       
    21 /*@{*/
       
    22 _LIT(KDataClassname,	"RWindowGroup");
       
    23 
       
    24 // Fields
       
    25 _LIT(KFldAdjust					,"adjust");
       
    26 _LIT(KFldCaptureKey				,"capturekey");
       
    27 _LIT(KFldClientHandle			,"clienthandle");
       
    28 _LIT(KFldClipRect				,"cliprect");
       
    29 _LIT(KFldCursor					,"cursor");
       
    30 _LIT(KFldDeviceNumber			,"devicenumber");
       
    31 _LIT(KFldFlags					,"flags");
       
    32 _LIT(KFldIdOfParentWindowGroup	,"idofparentwindowgroup");
       
    33 _LIT(KFldInputKeyCode			,"inputkeycode");
       
    34 _LIT(KFldIsFocusable			,"isfocusable");
       
    35 _LIT(KFldKeycode				,"keycode");
       
    36 _LIT(KFldModifier				,"modifier");
       
    37 _LIT(KFldModifierMask			,"modifiermask");
       
    38 _LIT(KFldOrdinalPriority		,"ordinalpriority");
       
    39 _LIT(KFldOutputKeyCode			,"outputkeycode");
       
    40 _LIT(KFldPos					,"pos");
       
    41 _LIT(KFldProcessSID				,"processsid");
       
    42 _LIT(KFldPriority				,"priority");
       
    43 _LIT(KFldRepeatTime				,"repeattime");
       
    44 _LIT(KFldScanCode				,"scancode");
       
    45 _LIT(KFldScreenDevice			,"screendevice");
       
    46 _LIT(KFldState					,"state");
       
    47 _LIT(KFldStdScanCode			,"stdscancode");
       
    48 _LIT(KFldTip					,"tip");
       
    49 _LIT(KFldType					,"type");
       
    50 _LIT(KFldWin					,"win");
       
    51 _LIT(KFldWs						,"ws");
       
    52 _LIT(KFldID						,"id");
       
    53 _LIT(KFldIDName					,"id_name");
       
    54 
       
    55 //Parameters
       
    56 _LIT(KinputWGN,					"inputWGN");
       
    57 _LIT(KexpectedReturnWGN,		"expectRtnWGN");
       
    58 _LIT(KOwningWGIdentifier,		"OwningWGId");
       
    59 _LIT(KOwningWGIdName,			"OwningWGId_name");
       
    60 
       
    61 //Commands
       
    62 _LIT(KCmdnew,									"new");
       
    63 _LIT(KCmdDestructor,							"~");
       
    64 _LIT(KCmdConstruct,								"Construct");
       
    65 _LIT(KCmdConstructChildApp,						"ConstructChildApp");
       
    66 _LIT(KCmdAllowProcessToCreateChildWindowGroups,	"AllowProcessToCreateChildWindowGroups");
       
    67 _LIT(KCmdEnableReceiptOfFocus,					"EnableReceiptOfFocus");
       
    68 _LIT(KCmdAutoForeground,						"AutoForeground");
       
    69 _LIT(KCmdSetOrdinalPriorityAdjust,				"SetOrdinalPriorityAdjust");
       
    70 _LIT(KCmdSetOrdinalPositionErr,					"SetOrdinalPositionErr");
       
    71 _LIT(KCmdCaptureKey,							"CaptureKey");
       
    72 _LIT(KCmdCancelCaptureKey,						"CancelCaptureKey");
       
    73 _LIT(KCmdCaptureKeyUpAndDowns,					"CaptureKeyUpAndDowns");
       
    74 _LIT(KCmdCancelCaptureKeyUpAndDowns,			"CancelCaptureKeyUpAndDowns");
       
    75 _LIT(KCmdCaptureLongKey,						"CaptureLongKey");
       
    76 _LIT(KCmdCancelCaptureLongKey,					"CancelCaptureLongKey");
       
    77 _LIT(KCmdAddPriorityKey,						"AddPriorityKey");
       
    78 _LIT(KCmdRemovePriorityKey,						"RemovePriorityKey");
       
    79 _LIT(KCmdSetTextCursor,							"SetTextCursor");
       
    80 _LIT(KCmdCancelTextCursor,						"CancelTextCursor");
       
    81 _LIT(KCmdSetOwningWindowGroup,					"SetOwningWindowGroup");
       
    82 _LIT(KCmdDefaultOwningWindow,					"DefaultOwningWindow");
       
    83 _LIT(KCmdSetName,								"SetName");
       
    84 _LIT(KCmdName,									"Name");
       
    85 _LIT(KCmdIdentifier,							"Identifier");
       
    86 _LIT(KCmdDisableKeyClick,						"DisableKeyClick");
       
    87 _LIT(KCmdEnableScreenChangeEvents,				"EnableScreenChangeEvents");
       
    88 _LIT(KCmdDisableScreenChangeEvents,				"DisableScreenChangeEvents");
       
    89 _LIT(KCmdSimulatePointerEvent,					"SimulatePointerEvent");
       
    90 _LIT(KCmdSetChildGroup,							"SetChildGroup");
       
    91 _LIT(KCmdClearChildGroup,						"ClearChildGroup");
       
    92 
       
    93 ///	Logging
       
    94 _LIT(KLogError,									"Error=%d");
       
    95 _LIT(KLogMissingParameter,						"Missing parameter '%S'");
       
    96 _LIT(KLogMissingExpectedValue,					"Missing expected value '%S'");
       
    97 _LIT(KLogNotExpectedValueString,				"'%S' is not as expected='%S', actual='%S'");
       
    98 /*@}*/
       
    99 
       
   100 //////////////////////////////////////////////////////////////////////
       
   101 // Construction/Destruction
       
   102 //////////////////////////////////////////////////////////////////////
       
   103 
       
   104 CT_DataWindowGroup* CT_DataWindowGroup::NewL()
       
   105 	{
       
   106 	CT_DataWindowGroup*	ret=new (ELeave) CT_DataWindowGroup();
       
   107 	CleanupStack::PushL(ret);
       
   108 	ret->ConstructL();
       
   109 	CleanupStack::Pop(ret);
       
   110 	return ret;
       
   111 	}
       
   112 
       
   113 CT_DataWindowGroup::CT_DataWindowGroup()
       
   114 :	CT_DataWindowTreeNode()
       
   115 ,	iWindowGroup(NULL)
       
   116 ,	iCaptureKeyHandle(0)
       
   117 	{
       
   118 	}
       
   119 
       
   120 void CT_DataWindowGroup::ConstructL()
       
   121 	{
       
   122 	}
       
   123 
       
   124 CT_DataWindowGroup::~CT_DataWindowGroup()
       
   125 	{
       
   126 	DestroyData();
       
   127 	}
       
   128 
       
   129 void CT_DataWindowGroup::SetObjectL(TAny* aAny)
       
   130 	{
       
   131 	DestroyData();
       
   132 	iWindowGroup = static_cast<RWindowGroup*> (aAny);
       
   133 	}
       
   134 
       
   135 void CT_DataWindowGroup::DisownObjectL()
       
   136 	{
       
   137 	iWindowGroup = NULL;
       
   138 	}
       
   139 
       
   140 void CT_DataWindowGroup::DestroyData()
       
   141 	{
       
   142 	delete iWindowGroup;
       
   143 	iWindowGroup=NULL;
       
   144 	}
       
   145 
       
   146 RWindowTreeNode* CT_DataWindowGroup::GetWindowTreeNode() const
       
   147 	{
       
   148 	return iWindowGroup;
       
   149 	}
       
   150 
       
   151 /**
       
   152 * Process a command read from the ini file
       
   153 *
       
   154 * @param aCommand			the command to process
       
   155 * @param aSection			the entry in the ini file requiring the command to be processed
       
   156 * @param aAsyncErrorIndex	index of command. used for async calls
       
   157 *
       
   158 * @return ETrue if the command is processed
       
   159 */
       
   160 TBool CT_DataWindowGroup::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
       
   161 	{
       
   162 	TBool	ret = ETrue;
       
   163 
       
   164 	if ( aCommand==KCmdDestructor )
       
   165 		{
       
   166 		DoCmdDestructor();
       
   167 		}
       
   168 	else if ( aCommand==KCmdnew || aCommand==KDataClassname )
       
   169 		{
       
   170 		DoCmdnewL(aSection);
       
   171 		}
       
   172 	else if ( aCommand==KCmdConstruct )
       
   173 		{
       
   174 		DoCmdConstructL(aSection);
       
   175 		}
       
   176 	else if ( aCommand==KCmdConstructChildApp )
       
   177 		{
       
   178 		DoCmdConstructChildAppL(aSection);
       
   179 		}
       
   180 	else if ( aCommand==KCmdAllowProcessToCreateChildWindowGroups )
       
   181 		{
       
   182 		DoCmdAllowProcessToCreateChildWindowGroups(aSection);
       
   183 		}
       
   184 	else if ( aCommand==KCmdEnableReceiptOfFocus )
       
   185 		{
       
   186 		DoCmdEnableReceiptOfFocus(aSection);
       
   187 		}
       
   188 	else if ( aCommand==KCmdAutoForeground )
       
   189 		{
       
   190 		DoCmdAutoForeground(aSection);
       
   191 		}
       
   192 	else if ( aCommand==KCmdSetOrdinalPriorityAdjust )
       
   193 		{
       
   194 		DoCmdSetOrdinalPriorityAdjust(aSection);
       
   195 		}
       
   196 	else if ( aCommand==KCmdSetOrdinalPositionErr )
       
   197 		{
       
   198 		DoCmdSetOrdinalPositionErr(aSection);
       
   199 		}
       
   200 	else if ( aCommand==KCmdCaptureKey )
       
   201 		{
       
   202 		DoCmdCaptureKey(aSection);
       
   203 		}
       
   204 	else if ( aCommand==KCmdCancelCaptureKey )
       
   205 		{
       
   206 		DoCmdCancelCaptureKey(aSection);
       
   207 		}
       
   208 	else if ( aCommand==KCmdCaptureKeyUpAndDowns )
       
   209 		{
       
   210 		DoCmdCaptureKeyUpAndDowns(aSection);
       
   211 		}
       
   212 	else if ( aCommand==KCmdCancelCaptureKeyUpAndDowns )
       
   213 		{
       
   214 		DoCmdCancelCaptureKeyUpAndDowns(aSection);
       
   215 		}
       
   216 	else if ( aCommand==KCmdCaptureLongKey )
       
   217 		{
       
   218 		DoCmdCaptureLongKey(aSection);
       
   219 		}
       
   220 	else if ( aCommand==KCmdCancelCaptureLongKey )
       
   221 		{
       
   222 		DoCmdCancelCaptureLongKey(aSection);
       
   223 		}
       
   224 	else if ( aCommand==KCmdAddPriorityKey )
       
   225 		{
       
   226 		DoCmdAddPriorityKey(aSection);
       
   227 		}
       
   228 	else if ( aCommand==KCmdRemovePriorityKey )
       
   229 		{
       
   230 		DoCmdRemovePriorityKey(aSection);
       
   231 		}
       
   232 	else if ( aCommand==KCmdSetTextCursor )
       
   233 		{
       
   234 		DoCmdSetTextCursorL(aSection);
       
   235 		}
       
   236 	else if ( aCommand==KCmdCancelTextCursor )
       
   237 		{
       
   238 		DoCmdCancelTextCursor();
       
   239 		}
       
   240 	else if ( aCommand==KCmdSetOwningWindowGroup )
       
   241 		{
       
   242 		DoCmdSetOwningWindowGroupL(aSection);
       
   243 		}
       
   244 	else if ( aCommand==KCmdDefaultOwningWindow )
       
   245 		{
       
   246 		DoCmdDefaultOwningWindow();
       
   247 		}
       
   248 	else if ( aCommand==KCmdSetName )
       
   249 		{
       
   250 		DoCmdSetName(aSection);
       
   251 		}
       
   252 	else if ( aCommand==KCmdName )
       
   253 		{
       
   254 		DoCmdName(aSection);
       
   255 		}
       
   256 	else if ( aCommand==KCmdIdentifier )
       
   257 		{
       
   258 		DoCmdIdentifier();
       
   259 		}
       
   260 	else if ( aCommand==KCmdDisableKeyClick )
       
   261 		{
       
   262 		DoCmdDisableKeyClick(aSection);
       
   263 		}
       
   264 	else if ( aCommand==KCmdEnableScreenChangeEvents )
       
   265 		{
       
   266 		DoCmdEnableScreenChangeEvents();
       
   267 		}
       
   268 	else if ( aCommand==KCmdDisableScreenChangeEvents )
       
   269 		{
       
   270 		DoCmdDisableScreenChangeEvents();
       
   271 		}
       
   272 	else if ( aCommand==KCmdSimulatePointerEvent )
       
   273 		{
       
   274 		DoCmdSimulatePointerEvent(aSection);
       
   275 		}
       
   276 	else if ( aCommand==KCmdSetChildGroup )
       
   277 		{
       
   278 		DoCmdSetChildGroupL(aSection);
       
   279 		}
       
   280 	else if ( aCommand==KCmdClearChildGroup )
       
   281 		{
       
   282 		DoCmdClearChildGroup();
       
   283 		}
       
   284 	else
       
   285 		{
       
   286 		ret=CT_DataWindowTreeNode::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
       
   287 		}
       
   288 
       
   289 	return ret;
       
   290 	}
       
   291 
       
   292 
       
   293 void CT_DataWindowGroup::DoCmdnewL(const TDesC& aSection)
       
   294 	{
       
   295 	DestroyData();
       
   296 
       
   297 	// Get test data for command input parameter(s)
       
   298 	TPtrC	wsName;
       
   299 	RWsSession* ws=NULL;
       
   300 	if ( GetStringFromConfig(aSection, KFldWs, wsName) )
       
   301 		{
       
   302 		ws = static_cast<RWsSession*>(GetDataObjectL(wsName));
       
   303 		}
       
   304 
       
   305 	TInt	err=KErrNone;
       
   306 	if ( ws!=NULL )
       
   307 		{
       
   308 		// Execute command and log parameters
       
   309 		INFO_PRINTF1(_L("execute new RWindowGroup(RWsSession)"));
       
   310 		TRAP( err, iWindowGroup = new (ELeave) RWindowGroup(*ws));
       
   311 		}
       
   312 	else
       
   313 		{
       
   314 		// Execute command and log parameters
       
   315 		INFO_PRINTF1(_L("execute new RWindowGroup()"));
       
   316 		TRAP( err, iWindowGroup = new (ELeave) RWindowGroup());
       
   317 		}
       
   318 
       
   319 	if ( err!=KErrNone )
       
   320 		{
       
   321 		ERR_PRINTF2(KLogError, err);
       
   322 		SetError(err);
       
   323 		}
       
   324 	}
       
   325 
       
   326 
       
   327 void CT_DataWindowGroup::DoCmdDestructor()
       
   328 	{
       
   329 	DestroyData();
       
   330 	}
       
   331 
       
   332 
       
   333 void CT_DataWindowGroup::DoCmdConstructL(const TDesC& aSection)
       
   334 	{
       
   335 	TInt	returnCode=KErrNone;
       
   336 
       
   337 	// Get test data for command input parameter(s)
       
   338 	TInt	datClientHandle;
       
   339 	TBool	hasClientHandle = GetIntFromConfig(aSection, KFldClientHandle, datClientHandle);
       
   340 	if ( !hasClientHandle )
       
   341 		{
       
   342 		ERR_PRINTF2(KLogMissingParameter, &KFldClientHandle);
       
   343 		SetBlockResult(EFail);
       
   344 		}
       
   345 	else
       
   346 		{
       
   347 		TBool	datIsFocusable;
       
   348 		TBool	hasIsFocusable = GetBoolFromConfig(aSection, KFldIsFocusable, datIsFocusable);
       
   349 
       
   350 #if defined(SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS)
       
   351 		CWsScreenDevice*	screenDevice=NULL;
       
   352 		// Execute command and log parameters
       
   353 		if ( CT_GraphicsUtil::GetWsScreenDeviceL(*this, aSection, KFldScreenDevice, screenDevice) )
       
   354 			{
       
   355 			if ( hasIsFocusable )
       
   356 				{
       
   357 				INFO_PRINTF1(_L("execute Construct(TUint32, TBool, CWsScreenDevice)"));
       
   358 				returnCode = iWindowGroup->Construct(datClientHandle, datIsFocusable, screenDevice);
       
   359 				}
       
   360 			else
       
   361 				{
       
   362 				INFO_PRINTF1(_L("execute Construct(TUint32, CWsScreenDevice)"));
       
   363 				returnCode = iWindowGroup->Construct(datClientHandle, screenDevice);
       
   364 				}
       
   365 			}
       
   366 		else
       
   367 #endif
       
   368 			{
       
   369 			if ( hasIsFocusable )
       
   370 				{
       
   371 				INFO_PRINTF1(_L("execute Construct(TUint32, TBool)"));
       
   372 				returnCode = iWindowGroup->Construct(datClientHandle, datIsFocusable);
       
   373 				}
       
   374 			else
       
   375 				{
       
   376 				INFO_PRINTF1(_L("execute Construct(TUint32)"));
       
   377 				returnCode = iWindowGroup->Construct(datClientHandle);
       
   378 				}
       
   379 			}
       
   380 		}
       
   381 
       
   382 	// Check the command return code, if !=KErrNone then stop this command
       
   383 	if ( returnCode!=KErrNone )
       
   384 		{
       
   385 		ERR_PRINTF2(KLogError, returnCode);
       
   386 		SetError(returnCode);
       
   387 		}
       
   388 
       
   389 	// No command output parameter to display and check
       
   390 	}
       
   391 
       
   392 
       
   393 void CT_DataWindowGroup::DoCmdConstructChildAppL(const TDesC& aSection)
       
   394 	{
       
   395 	TBool	dataOk=ETrue;
       
   396 	TInt	returnCode=KErrNone;
       
   397 
       
   398 	// Get test data for command input parameter(s)
       
   399 	TInt	datIdOfParentWindowGroup;
       
   400 	if ( !GetIntFromConfig(aSection, KFldIdOfParentWindowGroup, datIdOfParentWindowGroup) )
       
   401 		{
       
   402 		CDataWrapperBase*	wrapper=NULL;
       
   403 		TPtrC	objectName;
       
   404 		if ( GetStringFromConfig(aSection, KFldIdOfParentWindowGroup(), objectName) )
       
   405 			{
       
   406 			wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
       
   407 
       
   408 			}
       
   409 		
       
   410 		if ( wrapper==NULL )
       
   411 			{
       
   412 			dataOk=EFalse;
       
   413 			ERR_PRINTF2(KLogMissingParameter, &KFldIdOfParentWindowGroup);
       
   414 			SetBlockResult(EFail);
       
   415 			}
       
   416 		else
       
   417 			{
       
   418 			datIdOfParentWindowGroup = wrapper->GetIdentifier();
       
   419 			}
       
   420 		}
       
   421 
       
   422 	TInt	datClientHandle;
       
   423 	if ( !GetIntFromConfig(aSection, KFldClientHandle, datClientHandle) )
       
   424 		{
       
   425 		dataOk=EFalse;
       
   426 		ERR_PRINTF2(KLogMissingParameter, &KFldClientHandle);
       
   427 		SetBlockResult(EFail);
       
   428 		}
       
   429 
       
   430 	if ( dataOk )
       
   431 		{
       
   432 		TBool	datIsFocusable;
       
   433 		if ( GetBoolFromConfig(aSection, KFldIsFocusable, datIsFocusable) )
       
   434 			{
       
   435 			// Execute command and log parameters
       
   436 			INFO_PRINTF1(_L("execute ConstructChildApp(TInt, TUint32, TBool)"));
       
   437 			returnCode = iWindowGroup->ConstructChildApp(datIdOfParentWindowGroup, datClientHandle, datIsFocusable);
       
   438 			}
       
   439 		else
       
   440 			{
       
   441 			// Execute command and log parameters
       
   442 			INFO_PRINTF1(_L("execute ConstructChildApp(TInt, TUint32)"));
       
   443 			returnCode = iWindowGroup->ConstructChildApp(datIdOfParentWindowGroup, datClientHandle);
       
   444 			}
       
   445 
       
   446 		// Check the command return code, if !=KErrNone then stop this command
       
   447 		if ( returnCode!=KErrNone )
       
   448 			{
       
   449 			ERR_PRINTF2(KLogError, returnCode);
       
   450 			SetError(returnCode);
       
   451 			}
       
   452 
       
   453 		// No command output parameter to display and check
       
   454 		}
       
   455 	}
       
   456 
       
   457 
       
   458 void CT_DataWindowGroup::DoCmdAllowProcessToCreateChildWindowGroups(const TDesC& aSection)
       
   459 	{
       
   460 	// Get test data for command input parameter(s)
       
   461 	TInt	datProcess;
       
   462 	if ( !GetIntFromConfig(aSection, KFldProcessSID, datProcess) )
       
   463 		{
       
   464 		ERR_PRINTF2(KLogMissingParameter, &KFldProcessSID);
       
   465 		SetBlockResult(EFail);
       
   466 		}
       
   467 	else
       
   468 		{
       
   469 		// Execute command and log parameters
       
   470 		INFO_PRINTF1(_L("execute AllowProcessToCreateChildWindowGroups(TUid)"));
       
   471 		iWindowGroup->AllowProcessToCreateChildWindowGroups(TUid::Uid(datProcess));
       
   472 		}
       
   473 
       
   474 	// No command return value and output parameter to display and check
       
   475 	}
       
   476 
       
   477 
       
   478 void CT_DataWindowGroup::DoCmdEnableReceiptOfFocus(const TDesC& aSection)
       
   479 	{
       
   480 	// Get test data for command input parameter(s)
       
   481 	TBool	datState;
       
   482 	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
       
   483 		{
       
   484 		ERR_PRINTF2(KLogMissingParameter, &KFldState);
       
   485 		SetBlockResult(EFail);
       
   486 		}
       
   487 	else
       
   488 		{
       
   489 		// Execute command and log parameters
       
   490 		INFO_PRINTF1(_L("execute EnableReceiptOfFocus(TBool)"));
       
   491 		iWindowGroup->EnableReceiptOfFocus(datState);
       
   492 		}
       
   493 
       
   494 	// No command return value and output parameter to display and check
       
   495 	}
       
   496 
       
   497 
       
   498 void CT_DataWindowGroup::DoCmdAutoForeground(const TDesC& aSection)
       
   499 	{
       
   500 	// Get test data for command input parameter(s)
       
   501 	TBool	datState;
       
   502 	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
       
   503 		{
       
   504 		ERR_PRINTF2(KLogMissingParameter, &KFldState);
       
   505 		SetBlockResult(EFail);
       
   506 		}
       
   507 	else
       
   508 		{
       
   509 		// Execute command and log parameters
       
   510 		INFO_PRINTF1(_L("execute AutoForeground(TBool)"));
       
   511 		iWindowGroup->AutoForeground(datState);
       
   512 		}
       
   513 
       
   514 	// No command return value and output parameter to display and check
       
   515 	}
       
   516 
       
   517 
       
   518 void CT_DataWindowGroup::DoCmdSetOrdinalPriorityAdjust(const TDesC& aSection)
       
   519 	{
       
   520 	// Get test data for command input parameter(s)
       
   521 	TInt	datAdjust;
       
   522 	if ( !GetIntFromConfig(aSection, KFldAdjust, datAdjust) )
       
   523 		{
       
   524 		ERR_PRINTF2(KLogMissingParameter, &KFldAdjust);
       
   525 		SetBlockResult(EFail);
       
   526 		}
       
   527 	else
       
   528 		{
       
   529 		// Execute command and log parameters
       
   530 		INFO_PRINTF1(_L("execute SetOrdinalPriorityAdjust(TInt)"));
       
   531 		iWindowGroup->SetOrdinalPriorityAdjust(datAdjust);
       
   532 		}
       
   533 
       
   534 	// No command return value and output parameter to display and check
       
   535 	}
       
   536 
       
   537 
       
   538 void CT_DataWindowGroup::DoCmdSetOrdinalPositionErr(const TDesC& aSection)
       
   539 	{
       
   540 	TBool	dataOk=ETrue;
       
   541 
       
   542 	// Get test data for command input parameter(s)
       
   543 	TInt	datPos;
       
   544 	if ( !GetIntFromConfig(aSection, KFldPos, datPos) )
       
   545 		{
       
   546 		dataOk=EFalse;
       
   547 		ERR_PRINTF2(KLogMissingParameter, &KFldPos);
       
   548 		SetBlockResult(EFail);
       
   549 		}
       
   550 
       
   551 	TInt	datOrdinalPriority;
       
   552 	if ( !GetIntFromConfig(aSection, KFldOrdinalPriority, datOrdinalPriority) )
       
   553 		{
       
   554 		dataOk=EFalse;
       
   555 		ERR_PRINTF2(KLogMissingParameter, &KFldOrdinalPriority);
       
   556 		SetBlockResult(EFail);
       
   557 		}
       
   558 
       
   559 	if ( dataOk )
       
   560 		{
       
   561 		// Execute command and log parameters
       
   562 		INFO_PRINTF1(_L("execute SetOrdinalPositionErr(TInt, TInt)"));
       
   563 		TInt	returnCode = iWindowGroup->SetOrdinalPositionErr(datPos, datOrdinalPriority);
       
   564 
       
   565 		// Check the command return code, if !=KErrNone then stop this command
       
   566 		if ( returnCode!=KErrNone )
       
   567 			{
       
   568 			ERR_PRINTF2(KLogError, returnCode);
       
   569 			SetError(returnCode);
       
   570 			}
       
   571 
       
   572 		// No command output parameter to display and check
       
   573 		}
       
   574 	}
       
   575 
       
   576 void CT_DataWindowGroup::DoCmdCaptureKey(const TDesC& aSection)
       
   577 	{
       
   578 	TBool	dataOk=ETrue;
       
   579 
       
   580 	TKeyCode	keyCode;
       
   581 	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeycode, keyCode) )
       
   582 		{
       
   583 		dataOk=EFalse;
       
   584 		ERR_PRINTF2(KLogMissingParameter, &KFldKeycode);
       
   585 		SetBlockResult(EFail);
       
   586 		}
       
   587 
       
   588 	TUint	modifierMask;
       
   589 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
       
   590 		{
       
   591 		dataOk=EFalse;
       
   592 		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
       
   593 		SetBlockResult(EFail);
       
   594 		}
       
   595 
       
   596 	TUint	modifier;
       
   597 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
       
   598 		{
       
   599 		dataOk=EFalse;
       
   600 		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
       
   601 		SetBlockResult(EFail);
       
   602 		}
       
   603 
       
   604 	if ( dataOk )
       
   605 		{
       
   606 		TInt	ret=KErrNone;
       
   607 		TInt	priority;
       
   608 		if ( GetIntFromConfig(aSection, KFldPriority, priority) )
       
   609 			{
       
   610 			INFO_PRINTF1(_L("execute CaptureKey(keyCode, modifierMask, modifier, priority)"));
       
   611 			ret=iWindowGroup->CaptureKey(keyCode, modifierMask, modifier, priority);
       
   612 			}
       
   613 		else
       
   614 			{
       
   615 			INFO_PRINTF1(_L("execute CaptureKey(keyCode, modifierMask, modifier)"));
       
   616 			ret=iWindowGroup->CaptureKey(keyCode, modifierMask, modifier);
       
   617 			}
       
   618 		if ( ret<KErrNone )
       
   619 			{
       
   620 			ERR_PRINTF2(KLogError, ret);
       
   621 			SetError(ret);
       
   622 			}
       
   623 		iCaptureKeyHandle=ret;
       
   624 		}
       
   625 	}
       
   626 
       
   627 
       
   628 void CT_DataWindowGroup::DoCmdCancelCaptureKey(const TDesC& aSection)
       
   629 	{
       
   630 	// Get test data for command input parameter(s)
       
   631 	TInt	captureKey;
       
   632 	if ( !GetIntFromConfig(aSection, KFldCaptureKey, captureKey) )
       
   633 		{
       
   634 		ERR_PRINTF2(KLogMissingParameter, &KFldCaptureKey);
       
   635 		SetBlockResult(EFail);
       
   636 		}
       
   637 	else
       
   638 		{
       
   639 		INFO_PRINTF1(_L("execute CancelCaptureKey(captureKey)"));
       
   640 		if ( captureKey == -1 )
       
   641 			{
       
   642 			iWindowGroup->CancelCaptureKey(iCaptureKeyHandle);
       
   643 			}
       
   644 		else
       
   645 			{
       
   646 			iWindowGroup->CancelCaptureKey(captureKey);
       
   647 			}
       
   648 		}
       
   649 	}
       
   650 
       
   651 
       
   652 void CT_DataWindowGroup::DoCmdCaptureKeyUpAndDowns(const TDesC& aSection)
       
   653 	{
       
   654 	TBool	dataOk=ETrue;
       
   655 
       
   656 	TUint	scanCode;
       
   657 	if ( !CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldScanCode, (TStdScanCode&)scanCode) )
       
   658 		{
       
   659 		dataOk=EFalse;
       
   660 		ERR_PRINTF2(KLogMissingParameter, &KFldScanCode);
       
   661 		SetBlockResult(EFail);
       
   662 		}
       
   663 
       
   664 	TUint	modifierMask;
       
   665 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
       
   666 		{
       
   667 		dataOk=EFalse;
       
   668 		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
       
   669 		SetBlockResult(EFail);
       
   670 		}
       
   671 
       
   672 	TUint	modifier;
       
   673 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
       
   674 		{
       
   675 		dataOk=EFalse;
       
   676 		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
       
   677 		SetBlockResult(EFail);
       
   678 		}
       
   679 
       
   680 	if ( dataOk )
       
   681 		{
       
   682 		TInt	ret=KErrNone;
       
   683 		TInt	priority;
       
   684 		if ( !GetIntFromConfig(aSection, KFldPriority, priority) )
       
   685 			{
       
   686 			INFO_PRINTF1(_L("execute CaptureKeyUpAndDowns(TUint, TUint, TUint)"));
       
   687 			ret=iWindowGroup->CaptureKeyUpAndDowns(scanCode, modifierMask, modifier);
       
   688 			}
       
   689 		else
       
   690 			{
       
   691 			INFO_PRINTF1(_L("execute CaptureKeyUpAndDowns(TUint, TUint, TUint, TInt)"));
       
   692 			ret=iWindowGroup->CaptureKeyUpAndDowns(scanCode, modifierMask, modifier, priority);
       
   693 			}
       
   694 
       
   695 		if ( ret < KErrNone )
       
   696 			{
       
   697 			ERR_PRINTF2(KLogError, ret);
       
   698 			SetError(ret);
       
   699 			} 
       
   700 		else
       
   701 			{
       
   702 			iCaptureKeyHandle=ret;
       
   703 			}
       
   704 		}
       
   705 	}
       
   706 
       
   707 
       
   708 void CT_DataWindowGroup::DoCmdCancelCaptureKeyUpAndDowns(const TDesC& aSection)
       
   709 	{
       
   710 	// Get test data for command input parameter(s)
       
   711 	TInt	captureKey;
       
   712 	if ( !GetIntFromConfig(aSection, KFldCaptureKey, captureKey) )
       
   713 		{
       
   714 		ERR_PRINTF2(KLogMissingParameter, &KFldCaptureKey);
       
   715 		SetBlockResult(EFail);
       
   716 		}
       
   717 	else
       
   718 		{
       
   719 		INFO_PRINTF1(_L("execute CancelCaptureKeyUpAndDowns(captureKey)"));
       
   720 		if ( captureKey == -1 )
       
   721 			{
       
   722 			iWindowGroup->CancelCaptureKeyUpAndDowns(iCaptureKeyHandle);
       
   723 			}
       
   724 		else
       
   725 			{
       
   726 			iWindowGroup->CancelCaptureKeyUpAndDowns(captureKey);
       
   727 			}
       
   728 		}
       
   729 	}
       
   730 
       
   731 
       
   732 void CT_DataWindowGroup::DoCmdCaptureLongKey(const TDesC& aSection)
       
   733 	{
       
   734 	TBool			dataOk=ETrue;
       
   735 
       
   736 	TKeyCode	inputKeyCode;
       
   737 	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldInputKeyCode, inputKeyCode) )
       
   738 		{
       
   739 		dataOk=EFalse;
       
   740 		ERR_PRINTF2(KLogMissingParameter, &KFldInputKeyCode);
       
   741 		SetBlockResult(EFail);
       
   742 		}
       
   743 
       
   744 	TKeyCode	outputKeyCode;
       
   745 	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldOutputKeyCode, outputKeyCode) )
       
   746 		{
       
   747 		dataOk=EFalse;
       
   748 		ERR_PRINTF2(KLogMissingParameter, &KFldOutputKeyCode);
       
   749 		SetBlockResult(EFail);
       
   750 		}
       
   751 
       
   752 	TUint	modifierMask;
       
   753 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
       
   754 		{
       
   755 		dataOk=EFalse;
       
   756 		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
       
   757 		SetBlockResult(EFail);
       
   758 		}
       
   759 
       
   760 	TUint	modifier;
       
   761 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
       
   762 		{
       
   763 		dataOk=EFalse;
       
   764 		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
       
   765 		SetBlockResult(EFail);
       
   766 		}
       
   767 
       
   768 	TInt	priority;
       
   769 	if ( !GetIntFromConfig(aSection, KFldPriority, priority) )
       
   770 		{
       
   771 		dataOk=EFalse;
       
   772 		ERR_PRINTF2(KLogMissingParameter, &KFldPriority);
       
   773 		SetBlockResult(EFail);
       
   774 		}
       
   775 
       
   776 	TLongCaptureFlags	flags;
       
   777 	if ( !CT_GraphicsUtil::ReadLongCaptureFlags(*this, aSection, KFldFlags, flags) )
       
   778 		{
       
   779 		dataOk=EFalse;
       
   780 		ERR_PRINTF2(KLogMissingParameter, &KFldFlags);
       
   781 		SetBlockResult(EFail);
       
   782 		}
       
   783 
       
   784 	if ( dataOk )
       
   785 		{
       
   786 		TInt	ret=KErrNone;
       
   787 		TInt	repeatTime;
       
   788 		if ( GetIntFromConfig(aSection, KFldRepeatTime, repeatTime) )
       
   789 			{
       
   790 			TTimeIntervalMicroSeconds32	theRepeatTime(repeatTime);
       
   791 
       
   792 			// Execute command and log parameters
       
   793 			INFO_PRINTF1(_L("execute CaptureLongKey(repeatTime, inputKeyCode, iutputKeyCode, modifierMask, modifier, priority, flags)"));
       
   794 			ret=iWindowGroup->CaptureLongKey(theRepeatTime, inputKeyCode, outputKeyCode, modifierMask, modifier, priority, flags);
       
   795 			}
       
   796 		else
       
   797 			{
       
   798 			// Execute command and log parameters
       
   799 			INFO_PRINTF1(_L("execute CaptureLongKey(inputKeyCode, outputKeyCode, modifierMask, modifier, priority, flags)"));
       
   800 			ret=iWindowGroup->CaptureLongKey(inputKeyCode, outputKeyCode, modifierMask, modifier, priority, flags);
       
   801 			}
       
   802 
       
   803 		// Check the command return code, if !=KErrNone then stop this command
       
   804 		if ( ret<KErrNone )
       
   805 			{
       
   806 			ERR_PRINTF2(KLogError, ret);
       
   807 			SetError(ret);
       
   808 			}
       
   809 		iCaptureKeyHandle=ret;
       
   810 		}
       
   811 	}
       
   812 
       
   813 
       
   814 void CT_DataWindowGroup::DoCmdCancelCaptureLongKey(const TDesC& aSection)
       
   815 	{
       
   816 	// Get test data for command input parameter(s)
       
   817 	TInt	captureKey;
       
   818 	if ( !GetIntFromConfig(aSection, KFldCaptureKey, captureKey) )
       
   819 		{
       
   820 		ERR_PRINTF2(KLogMissingParameter, &KFldCaptureKey);
       
   821 		SetBlockResult(EFail);
       
   822 		}
       
   823 	else
       
   824 		{
       
   825 		INFO_PRINTF1(_L("execute CancelCaptureLongKey(captureKey)"));
       
   826 		if ( captureKey == -1 )
       
   827 			{
       
   828 			iWindowGroup->CancelCaptureLongKey(iCaptureKeyHandle);
       
   829 			}
       
   830 		else
       
   831 			{
       
   832 			iWindowGroup->CancelCaptureLongKey(captureKey);
       
   833 			}
       
   834 		}
       
   835 	}
       
   836 
       
   837 
       
   838 void CT_DataWindowGroup::DoCmdAddPriorityKey(const TDesC& aSection)
       
   839 	{
       
   840 	TBool	dataOk=ETrue;
       
   841 
       
   842 	// Get test data for command input parameter(s)
       
   843 	TKeyCode	keyCode;
       
   844 	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeycode, keyCode) )
       
   845 		{
       
   846 		dataOk=EFalse;
       
   847 		ERR_PRINTF2(KLogMissingParameter, &KFldKeycode);
       
   848 		SetBlockResult(EFail);
       
   849 		}
       
   850 
       
   851 	TUint	modifierMask;
       
   852 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
       
   853 		{
       
   854 		dataOk=EFalse;
       
   855 		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
       
   856 		SetBlockResult(EFail);
       
   857 		}
       
   858 
       
   859 	TUint	modifier;
       
   860 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
       
   861 		{
       
   862 		dataOk=EFalse;
       
   863 		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
       
   864 		SetBlockResult(EFail);
       
   865 		}
       
   866 
       
   867 	if ( dataOk )
       
   868 		{
       
   869 		// Execute command and log parameters
       
   870 		INFO_PRINTF1(_L("execute AddPriorityKey(TUint, TUint, TUint)"));
       
   871 		TInt	ret=iWindowGroup->AddPriorityKey(keyCode, modifierMask, modifier);
       
   872 
       
   873 		// Check the command return code, if <KErrNone then stop this command
       
   874 		if ( ret!=KErrNone )
       
   875 			{
       
   876 			ERR_PRINTF2(KLogError, ret);
       
   877 			SetError(ret);
       
   878 			}
       
   879 		}
       
   880 	}
       
   881 
       
   882 
       
   883 void CT_DataWindowGroup::DoCmdRemovePriorityKey(const TDesC& aSection)
       
   884 	{
       
   885 	TBool	dataOk=ETrue;
       
   886 
       
   887 	// Get test data for command input parameter(s)
       
   888 	TKeyCode	keyCode;
       
   889 	if ( !CT_GraphicsUtil::ReadKeyCode(*this, aSection, KFldKeycode, keyCode) )
       
   890 		{
       
   891 		dataOk=EFalse;
       
   892 		ERR_PRINTF2(KLogMissingParameter, &KFldKeycode);
       
   893 		SetBlockResult(EFail);
       
   894 		}
       
   895 
       
   896 	TUint	modifierMask;
       
   897 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifierMask, modifierMask) )
       
   898 		{
       
   899 		dataOk=EFalse;
       
   900 		ERR_PRINTF2(KLogMissingParameter, &KFldModifierMask);
       
   901 		SetBlockResult(EFail);
       
   902 		}
       
   903 
       
   904 	TUint	modifier;
       
   905 	if ( !CT_GraphicsUtil::ReadEventModifier(*this, aSection, KFldModifier, modifier) )
       
   906 		{
       
   907 		dataOk=EFalse;
       
   908 		ERR_PRINTF2(KLogMissingParameter, &KFldModifier);
       
   909 		SetBlockResult(EFail);
       
   910 		}
       
   911 
       
   912 	if ( dataOk )
       
   913 		{
       
   914 		// Execute command and log parameters
       
   915 		INFO_PRINTF1(_L("execute RemovePriorityKey(TUint, TUint, TUint)"));
       
   916 		iWindowGroup->RemovePriorityKey(keyCode, modifierMask, modifier);
       
   917 		}
       
   918 	}
       
   919 
       
   920 
       
   921 void CT_DataWindowGroup::DoCmdSetTextCursorL(const TDesC& aSection)
       
   922 	{
       
   923 	TBool	dataOk=ETrue;
       
   924 
       
   925 	TPtrC	datWinName;
       
   926 	RWindowBase*	win = NULL;
       
   927 	if ( !GetStringFromConfig(aSection, KFldWin, datWinName) )
       
   928 		{
       
   929 		ERR_PRINTF2(KLogMissingParameter, &KFldWin);
       
   930 		SetBlockResult(EFail);
       
   931 		dataOk=EFalse;
       
   932 		}
       
   933 	else
       
   934 		{
       
   935 		win = static_cast<RWindowBase*>(GetDataObjectL(datWinName));
       
   936 		}
       
   937 
       
   938 	TPoint	datPos;
       
   939 	if ( !GetPointFromConfig(aSection, KFldPos, datPos) )
       
   940 		{
       
   941 		ERR_PRINTF2(KLogMissingParameter, &KFldPos);
       
   942 		SetBlockResult(EFail);
       
   943 		dataOk=EFalse;
       
   944 		}
       
   945 
       
   946 	TTextCursor	datCursor;
       
   947 	if ( !CT_GraphicsUtil::GetTextCursor(*this, aSection, KFldCursor, datCursor) )
       
   948 		{
       
   949 		ERR_PRINTF2(KLogMissingParameter, &KFldCursor);
       
   950 		SetBlockResult(EFail);
       
   951 		dataOk=EFalse;
       
   952 		}
       
   953 
       
   954 	if ( dataOk )
       
   955 		{
       
   956 		// get rectangle top left x-coordinate from parameters
       
   957 		TRect	datClipRect;
       
   958 		if ( GetRectFromConfig(aSection, KFldClipRect, datClipRect) )
       
   959 			{
       
   960 			INFO_PRINTF1(_L("execute SetTextCursor(RWindowBase, const TPoint, const TTextCursor, const TRect)"));
       
   961 			iWindowGroup->SetTextCursor(*win, datPos, datCursor, datClipRect);
       
   962 			}
       
   963 		else
       
   964 			{
       
   965 			INFO_PRINTF1(_L("execute SetTextCursor(RWindowBase, const TPoint, const TTextCursor)"));
       
   966 			iWindowGroup->SetTextCursor(*win, datPos, datCursor);
       
   967 			}
       
   968 		}
       
   969 	}
       
   970 
       
   971 
       
   972 void CT_DataWindowGroup::DoCmdCancelTextCursor()
       
   973 	{
       
   974 	INFO_PRINTF1(_L("RWindowGroup::CancelTextCursor() call"));
       
   975 	iWindowGroup->CancelTextCursor();
       
   976 	}
       
   977 
       
   978 
       
   979 void CT_DataWindowGroup::DoCmdSetOwningWindowGroupL(const TDesC& aSection)
       
   980 	{
       
   981 	TInt	winGroupId=0;
       
   982 	TBool	hasWGIdentifier=ETrue;
       
   983 
       
   984 	if ( !GetIntFromConfig(aSection, KOwningWGIdentifier(), winGroupId) )
       
   985 		{
       
   986 
       
   987 		CDataWrapperBase*	wrapper=NULL;
       
   988 		TPtrC	objectName;
       
   989 		if ( GetStringFromConfig(aSection, KOwningWGIdName(), objectName) )
       
   990 			{
       
   991 			wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
       
   992 			}
       
   993 			
       
   994 		if ( wrapper!=NULL )
       
   995 			{
       
   996 			winGroupId = wrapper->GetIdentifier();
       
   997 			
       
   998 			INFO_PRINTF2(_L("get id:%d"), winGroupId);
       
   999 			}
       
  1000 		else
       
  1001 			{
       
  1002 			ERR_PRINTF2(KLogMissingParameter, &KOwningWGIdentifier);
       
  1003 			SetBlockResult(EFail);
       
  1004 			hasWGIdentifier = EFalse;
       
  1005 			}
       
  1006 		}
       
  1007 
       
  1008 	if ( !hasWGIdentifier )
       
  1009 		{
       
  1010 		ERR_PRINTF2(KLogMissingParameter, &KOwningWGIdentifier);
       
  1011 		SetBlockResult(EFail);
       
  1012 		}
       
  1013 	else
       
  1014 		{
       
  1015 		INFO_PRINTF1(_L("execute SetOwningWindowGroup(TInt)"));
       
  1016 		iWindowGroup->SetOwningWindowGroup(winGroupId);
       
  1017 		}
       
  1018 	}
       
  1019 
       
  1020 
       
  1021 void CT_DataWindowGroup::DoCmdDefaultOwningWindow()
       
  1022 	{
       
  1023 	INFO_PRINTF1(_L("execute DefaultOwningWindow()"));
       
  1024 	iWindowGroup->DefaultOwningWindow();
       
  1025 	}
       
  1026 
       
  1027 
       
  1028 void CT_DataWindowGroup::DoCmdSetName(const TDesC& aSection)
       
  1029 	{
       
  1030 	TPtrC	theNameString;
       
  1031 
       
  1032 	if ( !GetStringFromConfig(aSection, KinputWGN(), theNameString) )
       
  1033 		{
       
  1034 		ERR_PRINTF2(KLogMissingParameter, &KinputWGN);
       
  1035 		SetBlockResult(EFail);
       
  1036 		}
       
  1037 	else
       
  1038 		{
       
  1039 		INFO_PRINTF1(_L("execute SetName(const TDesC)"));
       
  1040 		TInt	err = iWindowGroup->SetName(theNameString);
       
  1041 
       
  1042 		if ( err!=KErrNone )
       
  1043 			{
       
  1044 			ERR_PRINTF2(KLogError, err);
       
  1045 			SetError(err);
       
  1046 			}
       
  1047 		}
       
  1048 	}
       
  1049 
       
  1050 void CT_DataWindowGroup::DoCmdName(const TDesC& aSection)
       
  1051 	{
       
  1052 	TBuf<KMaxTestExecuteCommandLength>	storeBuffer;
       
  1053 
       
  1054 	INFO_PRINTF1(_L("execute Name(TDes&)"));
       
  1055 	TInt	err = iWindowGroup->Name(storeBuffer);
       
  1056 
       
  1057 	if ( err!=KErrNone )
       
  1058 		{
       
  1059 		ERR_PRINTF2(KLogError, err);
       
  1060 		SetError(err);
       
  1061 		}
       
  1062 	else
       
  1063 		{
       
  1064 		INFO_PRINTF2(_L("the length of  name:%d"), storeBuffer.Length());
       
  1065 		INFO_PRINTF1(_L("the name of window group:"));
       
  1066 		INFO_PRINTF1(storeBuffer);
       
  1067 
       
  1068 		TPtrC	returnWGName;
       
  1069 		if ( !GetStringFromConfig(aSection, KexpectedReturnWGN(), returnWGName) )
       
  1070 			{
       
  1071 			ERR_PRINTF2(KLogMissingExpectedValue, &KexpectedReturnWGN());
       
  1072 			SetBlockResult(EFail);
       
  1073 			}
       
  1074 		else
       
  1075 			{
       
  1076 			if (storeBuffer!=returnWGName)
       
  1077 				{
       
  1078 				ERR_PRINTF4(KLogNotExpectedValueString, &KexpectedReturnWGN, &returnWGName, &storeBuffer);
       
  1079 				SetBlockResult(EFail);
       
  1080 				}
       
  1081 			}
       
  1082 		}
       
  1083 	}
       
  1084 
       
  1085 
       
  1086 void CT_DataWindowGroup::DoCmdIdentifier()
       
  1087 	{
       
  1088 	INFO_PRINTF1(_L("execute Identifier()"));
       
  1089 	TInt	actualWGId=iWindowGroup->Identifier();
       
  1090 	INFO_PRINTF2(_L("Identifier:%d"),actualWGId);
       
  1091 	SetIdentifier(actualWGId);
       
  1092 	}
       
  1093 
       
  1094 
       
  1095 void CT_DataWindowGroup::DoCmdDisableKeyClick(const TDesC& aSection)
       
  1096 	{
       
  1097 	// Get test data for command input parameter(s)
       
  1098 	TBool	datState;
       
  1099 	if ( !GetBoolFromConfig(aSection, KFldState, datState) )
       
  1100 		{
       
  1101 		ERR_PRINTF2(KLogMissingParameter, &KFldState);
       
  1102 		SetBlockResult(EFail);
       
  1103 		}
       
  1104 	else
       
  1105 		{
       
  1106 		// Execute command and log parameters
       
  1107 		INFO_PRINTF1(_L("execute DisableKeyClick(TBool)"));
       
  1108 		iWindowGroup->DisableKeyClick(datState);
       
  1109 		}
       
  1110 
       
  1111 	// No command return value and output parameter to display and check
       
  1112 	}
       
  1113 
       
  1114 
       
  1115 void CT_DataWindowGroup::DoCmdEnableScreenChangeEvents()
       
  1116 	{
       
  1117 	INFO_PRINTF1(_L("execute EnableScreenChangeEvents()"));
       
  1118 	TInt err = iWindowGroup->EnableScreenChangeEvents();
       
  1119 
       
  1120 	if ( err!=KErrNone )
       
  1121 		{
       
  1122 		ERR_PRINTF2(KLogError, err);
       
  1123 		SetError(err);
       
  1124 		}
       
  1125 	}
       
  1126 
       
  1127 
       
  1128 void CT_DataWindowGroup::DoCmdDisableScreenChangeEvents()
       
  1129 	{
       
  1130 	INFO_PRINTF1(_L("execute DisableScreenChangeEvents()"));
       
  1131 	iWindowGroup->DisableScreenChangeEvents();
       
  1132 	}
       
  1133 
       
  1134 
       
  1135 void CT_DataWindowGroup::DoCmdSimulatePointerEvent(const TDesC& aSection)
       
  1136 	{
       
  1137 	TBool		dataOk=ETrue;
       
  1138 	TRawEvent	event;
       
  1139 
       
  1140 	TRawEvent::TType	type=TRawEvent::ENone;
       
  1141 	if ( !CT_GraphicsUtil::ReadType(*this, aSection, KFldType(), type) )
       
  1142 		{
       
  1143 		dataOk=EFalse;
       
  1144 		ERR_PRINTF2(KLogMissingParameter, &KFldType());
       
  1145 		SetBlockResult(EFail);
       
  1146 		}
       
  1147 	else
       
  1148 		{
       
  1149 		event.Set(type);
       
  1150 		}
       
  1151 
       
  1152 	TStdScanCode	stdScanCode;
       
  1153 	if ( CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldStdScanCode(), stdScanCode) )
       
  1154 		{
       
  1155 		event.Set(type, stdScanCode);
       
  1156 		}
       
  1157 
       
  1158 	TInt	deviceNumber;
       
  1159 	if ( GetIntFromConfig(aSection, KFldDeviceNumber, deviceNumber) )
       
  1160 		{
       
  1161 		event.SetDeviceNumber(deviceNumber);
       
  1162 		}
       
  1163 
       
  1164 	TPoint	pointerPos(0,0);
       
  1165 	if ( GetPointFromConfig(aSection, KFldPos, pointerPos) )
       
  1166 		{
       
  1167 		event.Set(type, pointerPos.iX, pointerPos.iY);
       
  1168 		}
       
  1169 
       
  1170 	TBool	tip;
       
  1171 	if ( GetBoolFromConfig(aSection, KFldTip, tip) )
       
  1172 		{
       
  1173 		event.SetTip(tip);
       
  1174 		}
       
  1175 
       
  1176 	if ( dataOk )
       
  1177 		{
       
  1178 		INFO_PRINTF1(_L("execute SimulatePointerEvent(TRawEvent)"));
       
  1179 		iWindowGroup->SimulatePointerEvent(event);
       
  1180 		}
       
  1181 	}
       
  1182 
       
  1183 
       
  1184 void CT_DataWindowGroup::DoCmdSetChildGroupL(const TDesC& aSection)
       
  1185 	{
       
  1186 	TBool	dataOk = ETrue;
       
  1187 
       
  1188 	TInt	id;
       
  1189 	if ( !GetIntFromConfig(aSection, KFldID, id) )
       
  1190 		{
       
  1191 		CDataWrapperBase*	wrapper=NULL;
       
  1192 		TPtrC	objectName;
       
  1193 		if ( GetStringFromConfig(aSection, KFldIDName(), objectName) )
       
  1194 			{
       
  1195 			wrapper=static_cast<CDataWrapperBase*>(GetDataWrapperL(objectName));
       
  1196 			//handle=wrapper->GetHandle();
       
  1197 			}
       
  1198 			
       
  1199 		if ( wrapper!=NULL )
       
  1200 			{
       
  1201 			id = wrapper->GetIdentifier();
       
  1202 			
       
  1203 			INFO_PRINTF3(_L("get '%S_name' identifier = %d' to set child group"), &KFldID, id);
       
  1204 			}
       
  1205 		else
       
  1206 			{
       
  1207 			ERR_PRINTF2(KLogMissingParameter, &KFldID);
       
  1208 			SetBlockResult(EFail);
       
  1209 			dataOk = EFalse;
       
  1210 			}
       
  1211 		}
       
  1212 
       
  1213 	if ( dataOk )
       
  1214 		{
       
  1215 		INFO_PRINTF1(_L("execute SetChildGroup(TInt)"));
       
  1216 		TInt	returnCode = iWindowGroup->SetChildGroup(id);
       
  1217 
       
  1218 		if ( returnCode!=KErrNone )
       
  1219 			{
       
  1220 			ERR_PRINTF2(KLogError, returnCode);
       
  1221 			SetError(returnCode);
       
  1222 			}
       
  1223 		}
       
  1224 	}
       
  1225 
       
  1226 void CT_DataWindowGroup::DoCmdClearChildGroup()
       
  1227 	{
       
  1228 	INFO_PRINTF1(_L("execute ClearChildGroup()"));
       
  1229 	TInt	returnCode = iWindowGroup->ClearChildGroup();
       
  1230 
       
  1231 	if ( returnCode!=KErrNone )
       
  1232 		{
       
  1233 		ERR_PRINTF2(KLogError, returnCode);
       
  1234 		SetError(returnCode);
       
  1235 		}
       
  1236 	}