graphicsapitest/graphicssvs/wserv/src/T_DataWindowTreeNode.cpp
changeset 103 2717213c588a
parent 98 bf7481649c98
child 116 171fae344dd4
child 121 d72fc2aace31
child 187 9f66f99ee56f
equal deleted inserted replaced
98:bf7481649c98 103:2717213c588a
     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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "T_DataWindowTreeNode.h"
       
    19 
       
    20 
       
    21 //Parameters
       
    22 _LIT(KObjectName,							"objectName");
       
    23 _LIT(KExpected,								"expected");
       
    24 _LIT(KInputWindowPosition,					"inputWindowPosition");
       
    25 _LIT(KInputWindowPriority,					"inputWindowPriority");
       
    26 _LIT(KInputCursorNumber,					"inputCursorNumber");
       
    27 _LIT(KInputEventControl,					"inputEventControl");
       
    28 _LIT(KInputEventModifier,					"inputEventModifier");
       
    29 _LIT(KInputNonFading,						"inputNonFading");
       
    30 _LIT(KInputFaded,							"inputFaded");
       
    31 _LIT(KInputFadeControl,						"inputFadeControl");
       
    32 _LIT(KInputBlackMap,						"inputBlackMap");
       
    33 _LIT(KInputWhiteMap,						"inputWhiteMap");
       
    34 
       
    35 _LIT(KFldPointerCursor,                     "pointerCursor");
       
    36 //Commands
       
    37 _LIT(KCmdClose,                         	"Close");
       
    38 _LIT(KCmdDestroy,                       	"Destroy");
       
    39 _LIT(KCmdParent,                        	"Parent");
       
    40 _LIT(KCmdPrevSibling,                   	"PrevSibling");
       
    41 _LIT(KCmdNextSibling,                   	"NextSibling");
       
    42 _LIT(KCmdChild,                         	"Child");
       
    43 _LIT(KCmdOrdinalPriority,               	"OrdinalPriority");
       
    44 _LIT(KCmdOrdinalPosition,               	"OrdinalPosition");
       
    45 _LIT(KCmdFullOrdinalPosition,           	"FullOrdinalPosition");
       
    46 _LIT(KCmdSetOrdinalPosition,            	"SetOrdinalPosition");
       
    47 _LIT(KCmdWindowGroupId,                 	"WindowGroupId");
       
    48 _LIT(KCmdSetPointerCursor,              	"SetPointerCursor");
       
    49 _LIT(KCmdSetCustomPointerCursor,        	"SetCustomPointerCursor");
       
    50 _LIT(KCmdEnableOnEvents,                	"EnableOnEvents");
       
    51 _LIT(KCmdDisableOnEvents,               	"DisableOnEvents");
       
    52 _LIT(KCmdEnableGroupChangeEvents,       	"EnableGroupChangeEvents");
       
    53 _LIT(KCmdDisableGroupChangeEvents,      	"DisableGroupChangeEvents");
       
    54 _LIT(KCmdEnableFocusChangeEvents,       	"EnableFocusChangeEvents");
       
    55 _LIT(KCmdDisableFocusChangeEvents,      	"DisableFocusChangeEvents");
       
    56 _LIT(KCmdEnableGroupListChangeEvents,   	"EnableGroupListChangeEvents");
       
    57 _LIT(KCmdDisableGroupListChangeEvents,  	"DisableGroupListChangeEvents");
       
    58 _LIT(KCmdEnableVisibilityChangeEvents,  	"EnableVisibilityChangeEvents");
       
    59 _LIT(KCmdDisableVisibilityChangeEvents, 	"DisableVisibilityChangeEvents");
       
    60 _LIT(KCmdEnableErrorMessages,           	"EnableErrorMessages");
       
    61 _LIT(KCmdDisableErrorMessages,          	"DisableErrorMessages");
       
    62 _LIT(KCmdEnableModifierChangedEvents,   	"EnableModifierChangedEvents");
       
    63 _LIT(KCmdDisableModifierChangedEvents,  	"DisableModifierChangedEvents");
       
    64 _LIT(KCmdSetNonFading,                  	"SetNonFading");
       
    65 _LIT(KCmdSetFaded,                      	"SetFaded");
       
    66 _LIT(KCmdClearPointerCursor,            	"ClearPointerCursor");
       
    67 
       
    68 /*@}*/
       
    69 
       
    70 //////////////////////////////////////////////////////////////////////
       
    71 // Construction/Destruction
       
    72 //////////////////////////////////////////////////////////////////////
       
    73 
       
    74 CT_DataWindowTreeNode::CT_DataWindowTreeNode()
       
    75 :    CDataWrapperBase()
       
    76 	{
       
    77 	}
       
    78 
       
    79 MWsClientClass* CT_DataWindowTreeNode::GetClientClass() const
       
    80 	{
       
    81 	return GetWindowTreeNode();
       
    82 	}
       
    83 
       
    84 /**
       
    85 * Process a command read from the ini file
       
    86 *
       
    87 * @param aCommand			the command to process
       
    88 * @param aSection			the entry in the ini file requiring the command to be processed
       
    89 * @param aAsyncErrorIndex	index of command. used for async calls
       
    90 *
       
    91 * @return ETrue if the command is processed
       
    92 */
       
    93 TBool CT_DataWindowTreeNode::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
       
    94 	{
       
    95 	TBool    ret = ETrue;
       
    96 
       
    97 	if ( aCommand==KCmdClose )
       
    98 		{
       
    99 		DoCmdClose();
       
   100 		}
       
   101 	else if ( aCommand==KCmdDestroy )
       
   102 		{
       
   103 		DoCmdDestroyL();
       
   104 		}
       
   105 	else if ( aCommand==KCmdParent )
       
   106 		{
       
   107 		DoCmdParent(aSection);
       
   108 		}
       
   109 	else if ( aCommand==KCmdPrevSibling )
       
   110 		{
       
   111 		DoCmdPrevSibling(aSection);
       
   112 		}
       
   113 	else if ( aCommand==KCmdNextSibling )
       
   114 		{
       
   115 		DoCmdNextSibling(aSection);
       
   116 		}
       
   117 	else if ( aCommand==KCmdChild )
       
   118 		{
       
   119 		DoCmdChild(aSection);
       
   120 		}
       
   121 	else if ( aCommand==KCmdOrdinalPriority )
       
   122 		{
       
   123 		DoCmdOrdinalPriority(aSection);
       
   124 		}
       
   125 	else if ( aCommand==KCmdOrdinalPosition )
       
   126 		{
       
   127 		DoCmdOrdinalPosition(aSection);
       
   128 		}
       
   129 	else if ( aCommand==KCmdFullOrdinalPosition )
       
   130 		{
       
   131 		DoCmdFullOrdinalPosition(aSection);
       
   132 		}
       
   133 	else if ( aCommand==KCmdSetOrdinalPosition )
       
   134 		{
       
   135 		DoCmdSetOrdinalPosition(aSection);
       
   136 		}
       
   137 	else if ( aCommand==KCmdWindowGroupId )
       
   138 		{
       
   139 		DoCmdWindowGroupId();
       
   140 		}
       
   141 	else if ( aCommand==KCmdSetPointerCursor )
       
   142 		{
       
   143 		DoCmdSetPointerCursor(aSection);
       
   144 		}
       
   145 	else if (	aCommand==KCmdSetCustomPointerCursor )
       
   146 		{
       
   147 		DoCmdSetCustomPointerCursorL(aSection);
       
   148 		}
       
   149 	else if ( aCommand==KCmdEnableOnEvents )
       
   150 		{
       
   151 		DoCmdEnableOnEvents(aSection);
       
   152 		}
       
   153 	else if ( aCommand==KCmdDisableOnEvents )
       
   154 		{
       
   155 		DoCmdDisableOnEvents();
       
   156 		}
       
   157 	else if ( aCommand==KCmdEnableGroupChangeEvents )
       
   158 		{
       
   159 		DoCmdEnableGroupChangeEvents();
       
   160 		}
       
   161 	else if ( aCommand==KCmdDisableGroupChangeEvents )
       
   162 		{
       
   163 		DoCmdDisableGroupChangeEvents();
       
   164 		}
       
   165 	else if ( aCommand==KCmdEnableFocusChangeEvents )
       
   166 		{
       
   167 		DoCmdEnableFocusChangeEvents();
       
   168 		}
       
   169 	else if ( aCommand==KCmdDisableFocusChangeEvents )
       
   170 		{
       
   171 		DoCmdDisableFocusChangeEvents();
       
   172 		}
       
   173 	else if ( aCommand==KCmdEnableGroupListChangeEvents )
       
   174 		{
       
   175 		DoCmdEnableGroupListChangeEvents();
       
   176 		}
       
   177 	else if ( aCommand==KCmdDisableGroupListChangeEvents )
       
   178 		{
       
   179 		DoCmdDisableGroupListChangeEvents();
       
   180 		}
       
   181 	else if ( aCommand==KCmdEnableVisibilityChangeEvents )
       
   182 		{
       
   183 		DoCmdEnableVisibilityChangeEvents();
       
   184 		}
       
   185 	else if ( aCommand==KCmdDisableVisibilityChangeEvents )
       
   186 		{
       
   187 		DoCmdDisableVisibilityChangeEvents();
       
   188 		}
       
   189 	else if	( aCommand==KCmdEnableErrorMessages	)
       
   190 		{
       
   191 		DoCmdEnableErrorMessages(aSection);
       
   192 		}
       
   193 	else if ( aCommand==KCmdDisableErrorMessages )
       
   194 		{
       
   195 		DoCmdDisableErrorMessages();
       
   196 		}
       
   197 	else if ( aCommand==KCmdEnableModifierChangedEvents )
       
   198 		{
       
   199 		DoCmdEnableModifierChangedEvents(aSection);
       
   200 		}
       
   201 	else if ( aCommand==KCmdDisableModifierChangedEvents )
       
   202 		{
       
   203 		DoCmdDisableModifierChangedEvents();
       
   204 		}
       
   205 	else if ( aCommand==KCmdSetNonFading )
       
   206 		{
       
   207 		DoCmdSetNonFading(aSection);
       
   208 		}
       
   209 	else if ( aCommand==KCmdSetFaded )
       
   210 		{
       
   211 		DoCmdSetFaded(aSection);
       
   212 		}
       
   213 	else if ( aCommand==KCmdClearPointerCursor )
       
   214 		{
       
   215 		DoCmdClearPointerCursor();
       
   216 		}
       
   217 	else
       
   218 		{
       
   219 		ret=CT_DataWsClientClass::DoCommandL(*this, aCommand, aSection, aAsyncErrorIndex);
       
   220 		}
       
   221 
       
   222 	return ret;
       
   223 	}
       
   224 
       
   225 void CT_DataWindowTreeNode::DoCmdClose()
       
   226 	{
       
   227 	GetWindowTreeNode()->Close();
       
   228 	INFO_PRINTF1(_L("RWindowTreeNode::Close"));
       
   229 	}
       
   230 
       
   231 void CT_DataWindowTreeNode::DoCmdDestroyL()
       
   232 	{
       
   233 	RWindowTreeNode*	node=GetWindowTreeNode();
       
   234 
       
   235 	//	We disown the object as Destroy() also deletes it
       
   236 	DisownObjectL();
       
   237 	INFO_PRINTF1(_L("RWindowTreeNode::Destroy"));
       
   238 	node->Destroy();
       
   239 	}
       
   240 
       
   241 void CT_DataWindowTreeNode::DoCmdParent(const TDesC& aSection)
       
   242 	{
       
   243 	TUint32	actual = GetWindowTreeNode()->Parent();
       
   244 	INFO_PRINTF2(_L("RWindowTreeNode::Parent = %d"), actual);
       
   245 
       
   246 	TInt	expected = 0;
       
   247 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   248 		{
       
   249 		if ( actual!=(TUint32)expected )
       
   250 			{
       
   251 			ERR_PRINTF1(_L("Parent is	not	as expected!"));
       
   252 			SetBlockResult(EFail);
       
   253 			}
       
   254 		}
       
   255 	else
       
   256 		{
       
   257 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   258 		SetBlockResult(EFail);
       
   259 		}
       
   260 	}
       
   261 
       
   262 
       
   263 void CT_DataWindowTreeNode::DoCmdPrevSibling(const TDesC& aSection)
       
   264 	{
       
   265 	TUint32	actual = GetWindowTreeNode()->PrevSibling();
       
   266 	INFO_PRINTF2(_L("RWindowTreeNode::PrevSibling	= %d"),	actual);
       
   267 
       
   268 	TInt	expected = 0;
       
   269 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   270 		{
       
   271 		if ( actual!=(TUint32)expected )
       
   272 			{
       
   273 			ERR_PRINTF1(_L("PrevSibling is not as	expected!"));
       
   274 			SetBlockResult(EFail);
       
   275 			}
       
   276 		}
       
   277 	else
       
   278 		{
       
   279 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   280 		SetBlockResult(EFail);
       
   281 		}
       
   282 	}
       
   283 
       
   284 
       
   285 void CT_DataWindowTreeNode::DoCmdNextSibling(const TDesC& aSection)
       
   286 	{
       
   287 	TUint32	actual = GetWindowTreeNode()->NextSibling();
       
   288 	INFO_PRINTF2(_L("RWindowTreeNode::NextSibling	= %d"),	actual);
       
   289 
       
   290 	TInt	expected = 0;
       
   291 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   292 		{
       
   293 		if ( actual!=(TUint32)expected )
       
   294 			{
       
   295 			ERR_PRINTF1(_L("NextSibling is not as	expected!"));
       
   296 			SetBlockResult(EFail);
       
   297 			}
       
   298 		}
       
   299 	else
       
   300 		{
       
   301 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   302 		SetBlockResult(EFail);
       
   303 		}
       
   304 	}
       
   305 
       
   306 
       
   307 void CT_DataWindowTreeNode::DoCmdChild(const TDesC& aSection)
       
   308 	{
       
   309 	TUint32	actual = GetWindowTreeNode()->Child();
       
   310 	INFO_PRINTF2(_L("RWindowTreeNode::Child =	%d"), actual);
       
   311 
       
   312 	TInt	expected = 0;
       
   313 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   314 		{
       
   315 		if ( actual!=(TUint32)expected )
       
   316 			{
       
   317 			ERR_PRINTF1(_L("Child	is not as expected!"));
       
   318 			SetBlockResult(EFail);
       
   319 			}
       
   320 		}
       
   321 	else
       
   322 		{
       
   323 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   324 		SetBlockResult(EFail);
       
   325 		}
       
   326 	}
       
   327 
       
   328 
       
   329 void CT_DataWindowTreeNode::DoCmdOrdinalPriority(const TDesC& aSection)
       
   330 	{
       
   331 	TInt		actual = GetWindowTreeNode()->OrdinalPriority();
       
   332 	INFO_PRINTF2(_L("RWindowTreeNode::OrdinalPriority	= %d"),	actual);
       
   333 
       
   334 	TInt	expected = 0;
       
   335 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   336 		{
       
   337 		if(	actual != expected )
       
   338 			{
       
   339 			ERR_PRINTF1(_L("OrdinalPriority is not as	expected!"));
       
   340 			SetBlockResult(EFail);
       
   341 			}
       
   342 		}
       
   343 	else
       
   344 		{
       
   345 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   346 		SetBlockResult(EFail);
       
   347 		}
       
   348 	}
       
   349 
       
   350 
       
   351 void CT_DataWindowTreeNode::DoCmdOrdinalPosition(const TDesC& aSection)
       
   352 	{
       
   353 	TInt		actual = GetWindowTreeNode()->OrdinalPosition();
       
   354 	INFO_PRINTF2(_L("RWindowTreeNode::OrdinalPosition	= %d"),	actual);
       
   355 
       
   356 	TInt	expected = 0;
       
   357 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   358 		{
       
   359 		if(	actual != expected )
       
   360 			{
       
   361 			ERR_PRINTF1(_L("OrdinalPosition is not as	expected!"));
       
   362 			SetBlockResult(EFail);
       
   363 			}
       
   364 		}
       
   365 	else
       
   366 		{
       
   367 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   368 		SetBlockResult(EFail);
       
   369 		}
       
   370 	}
       
   371 
       
   372 
       
   373 void CT_DataWindowTreeNode::DoCmdFullOrdinalPosition(const TDesC& aSection)
       
   374 	{
       
   375 	TInt		actual = GetWindowTreeNode()->FullOrdinalPosition();
       
   376 	INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPosition	= %d"),	actual);
       
   377 
       
   378 	TInt	expected = 0;
       
   379 	if(	GetIntFromConfig(aSection, KExpected(), expected))
       
   380 		{
       
   381 		if(	actual != expected )
       
   382 			{
       
   383 			ERR_PRINTF1(_L("FullOrdinalPosition is not as	expected!"));
       
   384 			SetBlockResult(EFail);
       
   385 			}
       
   386 		}
       
   387 	else
       
   388 		{
       
   389 		ERR_PRINTF2(_L("Missing parameter	%S"), &KExpected());
       
   390 		SetBlockResult(EFail);
       
   391 		}
       
   392 	}
       
   393 
       
   394 
       
   395 void CT_DataWindowTreeNode::DoCmdSetOrdinalPosition(const TDesC& aSection)
       
   396 	{
       
   397 	TInt	inputWindowPosition=0;
       
   398 	if(	GetIntFromConfig(aSection, KInputWindowPosition(), inputWindowPosition))
       
   399 		{
       
   400 		TInt	inputWindowPriority=0;
       
   401 		if(	GetIntFromConfig(aSection, KInputWindowPriority(), inputWindowPriority))
       
   402 			{
       
   403 			GetWindowTreeNode()->SetOrdinalPosition(inputWindowPosition, inputWindowPriority);
       
   404 			INFO_PRINTF1(_L("RWindowTreeNode::SetOrdinalPosition (Priority)"));
       
   405 			}
       
   406 		else
       
   407 			{
       
   408 			GetWindowTreeNode()->SetOrdinalPosition(inputWindowPosition);
       
   409 			INFO_PRINTF1(_L("RWindowTreeNode::SetOrdinalPosition"));
       
   410 			}
       
   411 		}
       
   412 	else
       
   413 		{
       
   414 		ERR_PRINTF2(_L("Missing parameter	%S"), &KInputWindowPosition());
       
   415 		SetBlockResult(EFail);
       
   416 		}
       
   417 	}
       
   418 
       
   419 
       
   420 void CT_DataWindowTreeNode::DoCmdWindowGroupId()
       
   421 	{
       
   422 	TInt	actual = GetWindowTreeNode()->WindowGroupId();
       
   423 	INFO_PRINTF2(_L("RWindowTreeNode::WindowGroupId =	%d"), actual);
       
   424 	SetIdentifier(actual);
       
   425 	}
       
   426 
       
   427 
       
   428 void CT_DataWindowTreeNode::DoCmdSetPointerCursor(const TDesC& aSection)
       
   429 	{
       
   430 	TPointerCursorMode	inputCursorNumber=EPointerCursorNormal;
       
   431  	if ( CT_GraphicsUtil::ReadPointerCursorMode(*this, aSection, KInputCursorNumber(), inputCursorNumber) )
       
   432 		{
       
   433 		TInt	err=GetWindowTreeNode()->SetPointerCursor(inputCursorNumber);
       
   434 		if ( err!=KErrNone )
       
   435 			{
       
   436 			ERR_PRINTF2(_L("**** SetPointerCursor failed with error	%d"),	err);
       
   437 			SetError(err);
       
   438 			}
       
   439 
       
   440 		INFO_PRINTF1(_L("RWindowTreeNode::SetPointerCursor"));
       
   441 		}
       
   442 	else
       
   443 		{
       
   444 		ERR_PRINTF2(_L("Missing parameter	%S"), &KInputCursorNumber());
       
   445 		SetBlockResult(EFail);
       
   446 		}
       
   447 	}
       
   448 
       
   449 
       
   450 void CT_DataWindowTreeNode::DoCmdSetCustomPointerCursorL(const TDesC& aSection)
       
   451 	{
       
   452 	TPtrC	objectName;
       
   453 	if( GetStringFromConfig(aSection, KObjectName(), objectName) )
       
   454 		{
       
   455 		RWsSession*			wsSession = static_cast<RWsSession*>(GetDataObjectL(objectName));
       
   456 		RWsPointerCursor 	pointerCursor(*wsSession);
       
   457 		User::LeaveIfError(pointerCursor.Construct(0));
       
   458 		CleanupClosePushL(pointerCursor);
       
   459 
       
   460 		INFO_PRINTF1(_L("RWindowTreeNode::SetCustomPointerCursor"));
       
   461 		GetWindowTreeNode()->SetCustomPointerCursor(pointerCursor);
       
   462 
       
   463 		CleanupStack::PopAndDestroy(&pointerCursor);
       
   464 		}
       
   465 	else
       
   466 		{
       
   467 		TPtrC pointerCursorName;
       
   468 	
       
   469 		if( GetStringFromConfig(aSection, KFldPointerCursor(), pointerCursorName) )
       
   470 			{
       
   471 			RWsPointerCursor*			pointerCursor = static_cast<RWsPointerCursor*>(GetDataObjectL(pointerCursorName));
       
   472 
       
   473 			INFO_PRINTF1(_L("RWindowTreeNode::SetCustomPointerCursor"));
       
   474 			GetWindowTreeNode()->SetCustomPointerCursor(*pointerCursor);
       
   475 			}
       
   476 		
       
   477 		else
       
   478 			{
       
   479 			ERR_PRINTF3(_L("Missing parameter %S or %S"), &KFldPointerCursor(),&KObjectName());
       
   480 			SetBlockResult(EFail);
       
   481 			}
       
   482 		}
       
   483 	
       
   484 	}
       
   485 
       
   486 
       
   487 void CT_DataWindowTreeNode::DoCmdEnableOnEvents(const TDesC& aSection)
       
   488 	{
       
   489 	TEventControl	eventControl=EEventControlOnlyWithKeyboardFocus;
       
   490 	CT_GraphicsUtil::ReadEventControl(*this, aSection, KInputEventControl(), eventControl);
       
   491 
       
   492 	INFO_PRINTF1(_L("RWindowTreeNode::EnableOnEvents"));
       
   493 	TInt	err=GetWindowTreeNode()->EnableOnEvents(eventControl);
       
   494 	if ( err!=KErrNone )
       
   495 		{
       
   496 		ERR_PRINTF2(_L("**** EnableOnEvents failed with error %d"), err);
       
   497 		SetError(err);
       
   498 		}
       
   499 	}
       
   500 
       
   501 
       
   502 void CT_DataWindowTreeNode::DoCmdDisableOnEvents()
       
   503 	{
       
   504 	INFO_PRINTF1(_L("RWindowTreeNode::DisableOnEvents"));
       
   505 	GetWindowTreeNode()->DisableOnEvents();
       
   506 	}
       
   507 
       
   508 
       
   509 void CT_DataWindowTreeNode::DoCmdEnableGroupChangeEvents()
       
   510 	{
       
   511 	INFO_PRINTF1(_L("RWindowTreeNode::EnableGroupChangeEvents"));
       
   512 	TInt	err = GetWindowTreeNode()->EnableGroupChangeEvents();
       
   513 	if ( err!=KErrNone )
       
   514 		{
       
   515 		ERR_PRINTF2(_L("**** EnableGroupChangeEvents failed with error %d"),	err);
       
   516 		SetError(err);
       
   517 		}
       
   518 	}
       
   519 
       
   520 
       
   521 void CT_DataWindowTreeNode::DoCmdDisableGroupChangeEvents()
       
   522 	{
       
   523 	INFO_PRINTF1(_L("RWindowTreeNode::DisableGroupChangeEvents"));
       
   524 	GetWindowTreeNode()->DisableGroupChangeEvents();
       
   525 	}
       
   526 
       
   527 
       
   528 void CT_DataWindowTreeNode::DoCmdEnableFocusChangeEvents()
       
   529 	{
       
   530 	INFO_PRINTF1(_L("RWindowTreeNode::EnableFocusChangeEvents"));
       
   531 	TInt	err = GetWindowTreeNode()->EnableFocusChangeEvents();
       
   532 	if ( err!=KErrNone )
       
   533 		{
       
   534 		ERR_PRINTF2(_L("**** EnableFocusChangeEvents failed with error %d"),	err);
       
   535 		SetError(err);
       
   536 		}
       
   537 	}
       
   538 
       
   539 
       
   540 void CT_DataWindowTreeNode::DoCmdDisableFocusChangeEvents()
       
   541 	{
       
   542 	INFO_PRINTF1(_L("RWindowTreeNode::DisableFocusChangeEvents"));
       
   543 	GetWindowTreeNode()->DisableFocusChangeEvents();
       
   544 	}
       
   545 
       
   546 
       
   547 void CT_DataWindowTreeNode::DoCmdEnableGroupListChangeEvents()
       
   548 	{
       
   549 	INFO_PRINTF1(_L("RWindowTreeNode::EnableGroupListChangeEvents"));
       
   550 	TInt	err = GetWindowTreeNode()->EnableGroupListChangeEvents();
       
   551 	if ( err!=KErrNone )
       
   552 		{
       
   553 		ERR_PRINTF2(_L("**** EnableGroupListChangeEvents failed with error %d"),	err);
       
   554 		SetError(err);
       
   555 		}
       
   556 	}
       
   557 
       
   558 
       
   559 void CT_DataWindowTreeNode::DoCmdDisableGroupListChangeEvents()
       
   560 	{
       
   561 	INFO_PRINTF1(_L("RWindowTreeNode::DisableGroupListChangeEvents"));
       
   562 	GetWindowTreeNode()->DisableGroupListChangeEvents();
       
   563 	}
       
   564 
       
   565 
       
   566 void CT_DataWindowTreeNode::DoCmdEnableVisibilityChangeEvents()
       
   567 	{
       
   568 	INFO_PRINTF1(_L("RWindowTreeNode::EnableVisibilityChangeEvents"));
       
   569 	TInt	err = GetWindowTreeNode()->EnableVisibilityChangeEvents();
       
   570 	if ( err!=KErrNone )
       
   571 		{
       
   572 		ERR_PRINTF2(_L("**** EnableVisibilityChangeEvents failed with error %d"),	err);
       
   573 		SetError(err);
       
   574 		}
       
   575 	}
       
   576 
       
   577 
       
   578 void CT_DataWindowTreeNode::DoCmdDisableVisibilityChangeEvents()
       
   579 	{
       
   580 	INFO_PRINTF1(_L("RWindowTreeNode::DisableVisibilityChangeEvents"));
       
   581 	GetWindowTreeNode()->DisableVisibilityChangeEvents();
       
   582 	}
       
   583 
       
   584 
       
   585 void CT_DataWindowTreeNode::DoCmdEnableErrorMessages(const TDesC& aSection)
       
   586 	{
       
   587 	TEventControl	eventControl=EEventControlOnlyWithKeyboardFocus;
       
   588 	CT_GraphicsUtil::ReadEventControl(*this, aSection, KInputEventControl(), eventControl);
       
   589 
       
   590 	INFO_PRINTF1(_L("RWindowTreeNode::EnableErrorMessages"));
       
   591 	TInt	err=GetWindowTreeNode()->EnableErrorMessages(eventControl);
       
   592 	if ( err!=KErrNone )
       
   593 		{
       
   594 		ERR_PRINTF2(_L("**** EnableErrorMessages failed with error	%d"),	err);
       
   595 		SetError(err);
       
   596 		}
       
   597 	}
       
   598 
       
   599 
       
   600 void CT_DataWindowTreeNode::DoCmdDisableErrorMessages()
       
   601 	{
       
   602 	INFO_PRINTF1(_L("RWindowTreeNode::DisableErrorMessages"));
       
   603 	GetWindowTreeNode()->DisableErrorMessages();
       
   604 	}
       
   605 
       
   606 
       
   607 void CT_DataWindowTreeNode::DoCmdEnableModifierChangedEvents(const TDesC& aSection)
       
   608 	{
       
   609 	TEventModifier	eventModifier = EModifierAutorepeatable;
       
   610 	CT_GraphicsUtil::ReadEventModifier(*this, aSection, KInputEventModifier(), eventModifier);
       
   611 
       
   612 	TEventControl	eventControl = EEventControlOnlyWithKeyboardFocus;
       
   613 	CT_GraphicsUtil::ReadEventControl(*this, aSection, KInputEventControl(), eventControl);
       
   614 
       
   615 	INFO_PRINTF1(_L("RWindowTreeNode::EnableModifierChangedEvents"));
       
   616 	TInt	err=GetWindowTreeNode()->EnableModifierChangedEvents(eventModifier, eventControl);
       
   617 	if ( err!=KErrNone )
       
   618 		{
       
   619 		ERR_PRINTF2(_L("**** EnableModifierChangedEvents failed with error	%d"),	err);
       
   620 		SetError(err);
       
   621 		}
       
   622 	}
       
   623 
       
   624 
       
   625 void CT_DataWindowTreeNode::DoCmdDisableModifierChangedEvents()
       
   626 	{
       
   627 	INFO_PRINTF1(_L("RWindowTreeNode::DisableModifierChangedEvents"));
       
   628 	GetWindowTreeNode()->DisableModifierChangedEvents();
       
   629 	}
       
   630 
       
   631 
       
   632 void CT_DataWindowTreeNode::DoCmdSetNonFading(const TDesC& aSection)
       
   633 	{
       
   634 	TBool	inputNonFading=ETrue;
       
   635 	if(	GetBoolFromConfig(aSection, KInputNonFading(), inputNonFading))
       
   636 		{
       
   637 		INFO_PRINTF1(_L("RWindowTreeNode::SetNonFading"));
       
   638 		GetWindowTreeNode()->SetNonFading(inputNonFading);
       
   639 		}
       
   640 	else
       
   641 		{
       
   642 		ERR_PRINTF2(_L("Missing parameter %S"), &KInputNonFading());
       
   643 		SetBlockResult(EFail);
       
   644 		}
       
   645 	}
       
   646 
       
   647 
       
   648 void CT_DataWindowTreeNode::DoCmdSetFaded(const TDesC& aSection)
       
   649 	{
       
   650 	TBool	inputFaded=ETrue;
       
   651 	if( !GetBoolFromConfig(aSection, KInputFaded(), inputFaded))
       
   652 		{
       
   653 		ERR_PRINTF2(_L("Missing parameter %S"), &KInputFaded());
       
   654 		SetBlockResult(EFail);
       
   655 		}
       
   656 	else
       
   657 		{
       
   658 		RWindowTreeNode::TFadeControl	fadeControl=RWindowTreeNode::EFadeIncludeChildren;
       
   659 		CT_GraphicsUtil::ReadFadeControl(*this, aSection, KInputFadeControl(), fadeControl);
       
   660 
       
   661 		TInt	inputBlackMap=0;
       
   662 		TInt	inputWhiteMap=255;
       
   663 		if( GetIntFromConfig(aSection, KInputBlackMap(), inputBlackMap) &&
       
   664 			GetIntFromConfig(aSection, KInputWhiteMap(), inputWhiteMap) )
       
   665 			{
       
   666 			INFO_PRINTF1(_L("RWindowTreeNode::SetFaded (Map Fading)"));
       
   667 			GetWindowTreeNode()->SetFaded(inputFaded, fadeControl, (TUint8) inputBlackMap, (TUint8) inputWhiteMap);
       
   668 			}
       
   669 		else
       
   670 			{
       
   671 			INFO_PRINTF1(_L("RWindowTreeNode::SetFaded"));
       
   672 			GetWindowTreeNode()->SetFaded(inputFaded, fadeControl);
       
   673 			}
       
   674 		}
       
   675 	}
       
   676 
       
   677 
       
   678 void CT_DataWindowTreeNode::DoCmdClearPointerCursor()
       
   679 	{
       
   680 	INFO_PRINTF1(_L("RWindowTreeNode::ClearPointerCursor"));
       
   681 	GetWindowTreeNode()->ClearPointerCursor();
       
   682 	}