customization/tsrc/tarmcustomization/src/ThemesTestBlocks.cpp
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2002 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: Implementation of customization components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32svr.h>
       
    22 #include <StifItemParser.h>
       
    23 #include <Stiftestinterface.h>
       
    24 #include "ThemesTest.h"
       
    25 #include "TestDmCallback.h"
       
    26 #include "TestDmDDFObject.h"
       
    27 #include "FileCoderB64.h"
       
    28 #include "TestParams.h"
       
    29 #include "policyengineclient.h"
       
    30 //#include "TerminalControlClient.h"
       
    31 //#include "TerminalControl3rdPartyAPI.h"
       
    32 
       
    33 #include "nsmldmuri.h"
       
    34 //#include "rfsClient.h"
       
    35 
       
    36 #include <CentralRepository.h>
       
    37 //#include "DMUtilClient.h"
       
    38 
       
    39 #include "nsmlprivateapi.h"
       
    40 
       
    41 
       
    42 // ============================ MEMBER FUNCTIONS ===============================
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CThemesTest::Delete
       
    46 // Delete here all resources allocated and opened from test methods. 
       
    47 // Called from destructor. 
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 void CThemesTest::Delete() 
       
    51     {
       
    52     
       
    53     }
       
    54     
       
    55 // -----------------------------------------------------------------------------
       
    56 // CThemesTest::RunMethodL
       
    57 // Run specified method. Contains also table of test mothods and their names.
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 TInt CThemesTest::RunMethodL( 
       
    61     CStifItemParser& aItem ) 
       
    62     {
       
    63    
       
    64     static TStifFunctionInfo const KFunctions[] =
       
    65         {  
       
    66         // Copy this line for every implemented function.
       
    67         // First string is the function name used in TestScripter script file.
       
    68         // Second is the actual implementation member function. 
       
    69         ENTRY( "Example", CThemesTest::ExampleL ),
       
    70         ENTRY( "Seconda", CThemesTest::SecondaL ),
       
    71         ENTRY( "Install", CThemesTest::InstallL ),
       
    72 
       
    73         ENTRY( "LoadL",			CThemesTest::LoadL ),
       
    74         ENTRY( "AddDDFCheckL",	CThemesTest::AddDDFCheckL ),
       
    75 
       
    76         ENTRY( "DDFVersionL",	CThemesTest::DDFVersionL ),
       
    77 		ENTRY( "DDFStructureL",	CThemesTest::DDFStructureL ),
       
    78 
       
    79 		ENTRY( "UpdateLeafObjectL",	CThemesTest::UpdateLeafObjectL ),
       
    80 		ENTRY( "UpdateLeafObjectStreamL",	CThemesTest::UpdateLeafObjectStreamL ),
       
    81 		ENTRY( "DeleteObjectL",	CThemesTest::DeleteObjectL ),
       
    82 		ENTRY( "FetchLeafObjectL",	CThemesTest::FetchLeafObjectL ),
       
    83 		ENTRY( "FetchLeafObjectSizeL",	CThemesTest::FetchLeafObjectSizeL ),
       
    84 		ENTRY( "ChildURIListL",	CThemesTest::ChildURIListL ),
       
    85 
       
    86 		ENTRY( "AddNodeObjectL",	CThemesTest::AddNodeObjectL ),
       
    87 		ENTRY( "ExecuteCommandL",	CThemesTest::ExecuteCommandL ),
       
    88 		ENTRY( "ExecuteCommandStreamL",	CThemesTest::ExecuteCommandStreamL ),
       
    89 		ENTRY( "CopyCommandL",	CThemesTest::CopyCommandL ),
       
    90 		ENTRY( "StartAtomicL",	CThemesTest::StartAtomicL ),
       
    91 		ENTRY( "CommitAtomicL",	CThemesTest::CommitAtomicL ),
       
    92 		ENTRY( "RollbackAtomicL",	CThemesTest::RollbackAtomicL ),
       
    93 		ENTRY( "StreamingSupportL",	CThemesTest::StreamingSupportL ),
       
    94 		ENTRY( "StreamCommittedL",	CThemesTest::StreamCommittedL ),
       
    95 		ENTRY( "CompleteOutstandingCmdsL",	CThemesTest::CompleteOutstandingCmdsL ),
       
    96       //all are related to TC module..So commented
       
    97 		/*ENTRY( "RRRun", CThemesTest::RRRunL ),
       
    98 		ENTRY( "CreateFile",	CThemesTest::CreateFileL ),
       
    99 		ENTRY( "RFSCommand",	CThemesTest::RFSCommandL ),		
       
   100 		ENTRY( "LoadPolicy",	CThemesTest::LoadPolicyL ),
       
   101 		ENTRY( "SetCertificate",	CThemesTest::SetCertificateL ),
       
   102 		ENTRY( "ConnectToPolicyServer",	CThemesTest::ConnectToPolicyServerL ),
       
   103 		ENTRY( "ConnectToDMUTIL",	CThemesTest::ConnectToDMUTILL ),
       
   104 		ENTRY( "ThirdPartyCommand",	CThemesTest::ThirdPartyCommandL), */
       
   105         };
       
   106 
       
   107     const TInt count = sizeof( KFunctions ) / 
       
   108                         sizeof( TStifFunctionInfo );
       
   109 
       
   110     return RunInternalL( KFunctions, count, aItem );
       
   111 
       
   112     }    
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CThemesTest::ExampleL
       
   116 // Example test method function.
       
   117 // (other items were commented in a header).
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 TInt CThemesTest::ExampleL( CStifItemParser& aItem )
       
   121     {
       
   122     
       
   123     // Print to UI
       
   124     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("In Example") );
       
   125     // Print to log file
       
   126     iLog->Log(_L("In Example"));
       
   127 
       
   128     TInt i = 0;
       
   129     TPtrC string;
       
   130     while ( aItem.GetNextString ( string ) == KErrNone )
       
   131         {
       
   132         TestModuleIf().Printf( i, _L("ThemesTest"), 
       
   133                                 _L("Param[%i]: %S"), i, &string );
       
   134         i++;
       
   135         }
       
   136 
       
   137     return KErrNone;
       
   138     
       
   139     }
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // CThemesTest::SecondaL
       
   143 // Seconda test method function.
       
   144 // -----------------------------------------------------------------------------
       
   145 //
       
   146 TInt CThemesTest::SecondaL( CStifItemParser& aItem )
       
   147     {
       
   148     
       
   149     // Print to UI
       
   150     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("In Seconda") );
       
   151     // Print to log file
       
   152     iLog->Log(_L("In Seconda"));
       
   153 
       
   154     TInt i = 0;
       
   155     TPtrC string;
       
   156     while ( aItem.GetNextString ( string ) == KErrNone )
       
   157         {
       
   158         TestModuleIf().Printf( i, _L("ThemesTest"), 
       
   159                                 _L("Param[%i]: %S"), i, &string );
       
   160         i++;
       
   161         }
       
   162         
       
   163         
       
   164 	// Here it starts
       
   165 	
       
   166 	const TUint KThemesAdapterImplUid = 0x0FDDEF05;
       
   167 
       
   168 	TUid iuid = 
       
   169 		{
       
   170 		KThemesAdapterImplUid
       
   171 		};
       
   172 		
       
   173 /*	Cpmatest *cb = Cpmatest::NewL( iLog );
       
   174 	CleanupStack::PushL( cb );	// 1
       
   175 */	
       
   176 	//CSmlDmAdapter *adapter = CSmlDmAdapter::NewL( implInfo->ImplementationUid(), *this );
       
   177 //	CSmlDmAdapter *adapter = CSmlDmAdapter::NewL( iuid, *this );
       
   178 	CTestDmCallback *callback = CTestDmCallback::NewL( iLog );
       
   179 	CleanupStack::PushL( callback );
       
   180 	
       
   181 	CSmlDmAdapter *adapter = CSmlDmAdapter::NewL( iuid, *callback );
       
   182 	CleanupStack::PushL( adapter );
       
   183 	
       
   184 	CBufBase* version = CBufFlat::NewL( 16 );
       
   185 	CleanupStack::PushL( version );
       
   186 
       
   187 	adapter->DDFVersionL( *version );
       
   188 	iLog->Log( _L("Version is")) ;
       
   189 	iLog->Log( version->Ptr(0) ) ;
       
   190 
       
   191 
       
   192 	CTestDmDDFObject* ddfRoot = CTestDmDDFObject::NewLC( iLog ); //, aNodeName );
       
   193 	ddfRoot->SetNameL( _L8( "/" ) );
       
   194 
       
   195 	adapter->DDFStructureL( *ddfRoot );
       
   196 	
       
   197 	ddfRoot->DumpL( _L8(""), EFalse );
       
   198 	
       
   199 	ddfRoot->DumpL( _L8("") );
       
   200 	
       
   201 	CleanupStack::PopAndDestroy( ddfRoot );
       
   202 	ddfRoot = 0;
       
   203 	CleanupStack::PopAndDestroy( version );
       
   204 	version = 0;
       
   205 
       
   206 	CleanupStack::PopAndDestroy( adapter );
       
   207 	adapter = 0;
       
   208 	
       
   209 	CleanupStack::PopAndDestroy( callback );
       
   210 	callback = 0;
       
   211 
       
   212 	
       
   213 /*
       
   214 MSmlDmDDFObject& CTestDmDDFObject::AddChildObjectGroupL()
       
   215 	{
       
   216 	iLog->Log( _L( "AddChildObjectGroupL, ''" ) );
       
   217 	CTestDmDDFObject* child = CTestDmDDFObject::NewLC( iLog ); //, KNullDesC );
       
   218 	child->SetAsObjectGroup();
       
   219 	iChildren.AppendL( child );
       
   220 	CleanupStack::Pop( child ); // Don't destroy
       
   221 	return *child;
       
   222 	}
       
   223 */
       
   224 
       
   225 /*
       
   226 	HBufC8 *addnodename = HBufC8::NewLC( nodename.Length() + 1 + KPolicyNode().Length() ) ;
       
   227 	addnodename->Des().Copy( KPolicyNode );
       
   228 	addnodename->Des().Append( nodename ) ;
       
   229 	adapter->AddNodeObjectL( *addnodename, KNullDesC8, 2);
       
   230 	if ( iStatus == MSmlDmAdapter::EOk )
       
   231 		{
       
   232 		
       
   233 		RFs fs ;
       
   234 		LEAVE_IF_ERROR( fs.Connect(), _L( "Could not connect fileserver: %d"  ) );
       
   235 		
       
   236 		CleanupClosePushL( fs );
       
   237 		RFile file ;
       
   238 		LEAVE_IF_ERROR( file.Open(fs,datafile,EFileRead), _L( "Could not open file: %d" ) );
       
   239 		
       
   240 		CleanupClosePushL( file );
       
   241 		TInt dataSize ;
       
   242 		LEAVE_IF_ERROR( file.Size( dataSize ), _L( "Could not get file size: %d" ) );
       
   243 		HBufC8 *nodedata = HBufC8::NewLC ( dataSize );
       
   244 		TPtr8 nodedataptr( nodedata->Des() );
       
   245 		LEAVE_IF_ERROR( file.Read( nodedataptr ), _L( "Could not read file: %d" ) );
       
   246 		HBufC8 *datanode = HBufC8::NewLC( addnodename->Des().Length() + KDataLeafEnd().Length() );
       
   247 		datanode->Des().Copy( *addnodename );
       
   248 		datanode->Des().Append( KDataLeafEnd() );
       
   249 		
       
   250 		adapter->UpdateLeafObjectL(*datanode, KNullDesC8(), nodedataptr, KPolicyMimeType(), 3);
       
   251 		if ( iStatus == MSmlDmAdapter::EOk )
       
   252 			{
       
   253 			
       
   254 			}
       
   255 		else
       
   256 			{
       
   257 			iLog->Log( _L("Add Test Adding Policy data failed! %d" ), iStatus );	
       
   258 			ret = KErrGeneral;
       
   259 			}
       
   260 		
       
   261 		CleanupStack::PopAndDestroy( datanode );
       
   262 		CleanupStack::PopAndDestroy( nodedata );
       
   263 		CleanupStack::PopAndDestroy( ); // file
       
   264 		CleanupStack::PopAndDestroy(  ); // fs
       
   265 		}
       
   266 	else
       
   267 		{
       
   268 		iLog->Log( _L("Add Test Adding Policy node! %d" ), iStatus );	
       
   269 		ret = KErrGeneral ;
       
   270 		}
       
   271 		
       
   272 	CleanupStack::PopAndDestroy( addnodename );
       
   273 	CleanupStack::PopAndDestroy( version );
       
   274 	CleanupStack::PopAndDestroy( adapter );
       
   275 //	CleanupStack::PopAndDestroy( cb );
       
   276 */
       
   277 
       
   278 
       
   279 	iLog->Log( _L("Seconda test complete with status %d" ), 0 ); //sf-ret );	
       
   280 	        
       
   281 
       
   282     return KErrNone;
       
   283     }
       
   284     
       
   285 // -----------------------------------------------------------------------------
       
   286 // CThemesTest::InstallL
       
   287 // Install test method function.
       
   288 // -----------------------------------------------------------------------------
       
   289 //
       
   290 TInt CThemesTest::InstallL( CStifItemParser& aItem )
       
   291     {
       
   292     
       
   293     // Print to UI
       
   294     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("In Install") );
       
   295     // Print to log file
       
   296     iLog->Log(_L("In Install"));
       
   297 
       
   298     TInt i = 0;
       
   299     TPtrC string;
       
   300     while ( aItem.GetNextString ( string ) == KErrNone )
       
   301         {
       
   302         TestModuleIf().Printf( i, _L("ThemesTest"), 
       
   303                                 _L("Param[%i]: %S"), i, &string );
       
   304         i++;
       
   305         }
       
   306         
       
   307 
       
   308 
       
   309 // Command  Leaf DataType Data
       
   310 // G = Get
       
   311 // E = Exec
       
   312 // R = Replace
       
   313 //          /Customization/Themes
       
   314 //               T = Text
       
   315 //               F = File
       
   316 //                        "Text with spaces included"
       
   317 //                        FileName.Ext
       
   318 
       
   319 	// Here it starts
       
   320 
       
   321 	const TUint KThemesAdapterImplUid = 0x0FDDEF05;
       
   322 
       
   323 	TUid iuid = 
       
   324 		{
       
   325 		KThemesAdapterImplUid
       
   326 		};
       
   327 		
       
   328 /*	Cpmatest *cb = Cpmatest::NewL( iLog );
       
   329 	CleanupStack::PushL( cb );	// 1
       
   330 */	
       
   331 	//CSmlDmAdapter *adapter = CSmlDmAdapter::NewL( implInfo->ImplementationUid(), *this );
       
   332 //	CSmlDmAdapter *adapter = CSmlDmAdapter::NewL( iuid, *this );
       
   333 	CTestDmCallback *callback = CTestDmCallback::NewL( iLog );
       
   334 	CleanupStack::PushL( callback );
       
   335 
       
   336 	CSmlDmAdapter *adapter = CSmlDmAdapter::NewL( iuid, *callback );
       
   337 	CleanupStack::PushL( adapter );
       
   338 	
       
   339 	CBufFlat* data = CBufFlat::NewL( 16 );
       
   340 	CleanupStack::PushL( data );
       
   341 
       
   342 	adapter->DDFVersionL( *data );
       
   343 	iLog->Log( _L("Version is")) ;
       
   344 	iLog->Log( data->Ptr(0) ) ;
       
   345 
       
   346 
       
   347 	CTestDmDDFObject* ddfRoot = CTestDmDDFObject::NewLC( iLog ); //, aNodeName );
       
   348 	ddfRoot->SetNameL( _L8( "/" ) );
       
   349 
       
   350 	adapter->DDFStructureL( *ddfRoot );
       
   351 	ddfRoot->DumpL( _L8(""), EFalse );
       
   352 	
       
   353 	CleanupStack::PopAndDestroy( ddfRoot );
       
   354 	ddfRoot = 0;
       
   355 	
       
   356 // Read file to data buffer and execute DM Adapter command
       
   357 
       
   358 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       
   359 
       
   360 	_LIT8( KThemeFilename, "c:\\jiihaa.sis" );
       
   361 
       
   362 //sf-	CBufBase* object = CBufFlat::NewL( 1000 );
       
   363 //sf-	CleanupStack::PushL( object );
       
   364 
       
   365 	TFileCoderB64 coder;
       
   366 	User::LeaveIfError( coder.EncodeL( KThemeFilename, *data ) );
       
   367 
       
   368 	/**
       
   369 	The function implements execute command. The information about the success
       
   370 	of the command should be returned by calling SetStatusL function of
       
   371 	MSmlDmCallback callback interface. This makes it possible to buffer the
       
   372 	commands.
       
   373 	However, all the status codes for buffered commands must be returned at
       
   374 	the latest when the CompleteOutstandingCmdsL() of adapter is called.
       
   375 	@param aURI			URI of the command
       
   376 	@param aLUID			LUID of the object (if the adapter have earlier
       
   377 							returned LUID to the DM Module).   
       
   378 	@param aArgument		Argument for the command
       
   379 	@param aType			MIME type of the object 
       
   380 	@param aStatusRef		Reference to correct command, i.e. this reference
       
   381 							must be used when calling the SetStatusL of this
       
   382 							command.
       
   383 	@publishedPartner
       
   384 	@prototype
       
   385 	*/
       
   386 //	virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID,
       
   387 //							      const TDesC8& aArgument, const TDesC8& aType,
       
   388 //								  TInt aStatusRef ) = 0;
       
   389 
       
   390 	adapter->ExecuteCommandL( _L8("/Customization/Themes/InstallTheme"),
       
   391 							  _L8(""), //callback->FindLUID(aURI)
       
   392 							  data->Ptr(0),
       
   393 							  _L8("text"),
       
   394 							  callback->GetNewStatusRefL() );
       
   395 
       
   396 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       
   397 
       
   398 
       
   399 
       
   400 	CleanupStack::PopAndDestroy( data );
       
   401 	data = 0;
       
   402 
       
   403 	CleanupStack::PopAndDestroy( adapter );
       
   404 	adapter = 0;
       
   405 	
       
   406 	CleanupStack::PopAndDestroy( callback );
       
   407 	callback = 0;
       
   408 
       
   409 	
       
   410 
       
   411 
       
   412 	iLog->Log( _L("Install test complete with status %d" ), 0 ); //sf-ret );
       
   413 
       
   414     return KErrNone;
       
   415     }
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 // CThemesTest::LoadL
       
   419 // Load adapter to be tested.
       
   420 // -----------------------------------------------------------------------------
       
   421 //
       
   422 TInt CThemesTest::LoadL( CStifItemParser& aItem )
       
   423 	{
       
   424     // Print to UI
       
   425     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("LoadL") );
       
   426     // Print to log file
       
   427     iLog->Log(_L("CThemesTest::LoadL()"));
       
   428 
       
   429 	TInt ret = KErrNone;
       
   430     TUint uid = 0;
       
   431 
       
   432 	ret = aItem.GetNextInt( uid, EHex );
       
   433 
       
   434 //sf-	if (ret != KErrNone)
       
   435 //sf-		{
       
   436 //sf-//		ret = KErrGeneral ;
       
   437 //sf-		return ret;
       
   438 //sf-		}
       
   439 
       
   440 	// Here it starts
       
   441 	if (ret == KErrNone)
       
   442 		{
       
   443 		TUid iuid = 
       
   444 			{
       
   445 			uid
       
   446 			};
       
   447 
       
   448         iLog->Log(_L("CThemesTest::LoadL() next: iCallback = CTestDmCallback::NewL( iLog );"));
       
   449 		iCallback = CTestDmCallback::NewL( iLog );
       
   450 		
       
   451         iLog->Log(_L("CThemesTest::LoadL() next: iAdapter = CSmlDmAdapter::NewL( iuid, *iCallback );"));
       
   452 		iAdapter = CSmlDmAdapter::NewL( iuid, *iCallback );
       
   453 
       
   454         iLog->Log(_L("CThemesTest::LoadL() Adapter loaded OK."));
       
   455 		}
       
   456 	else
       
   457 	    {
       
   458         iLog->Log(_L("CThemesTest::LoadL() Invalid UID in test script, check LoadL parameter."));
       
   459 	    }
       
   460 
       
   461 	return ret;
       
   462 	}
       
   463 
       
   464 // -----------------------------------------------------------------------------
       
   465 // CThemesTest::AddDDFCheckL
       
   466 // Load adapter to be tested.
       
   467 // -----------------------------------------------------------------------------
       
   468 //
       
   469 TInt CThemesTest::AddDDFCheckL( CStifItemParser& aItem )
       
   470 	{
       
   471     // Print to UI
       
   472     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("AddDDFCheckL") );
       
   473     // Print to log file
       
   474     iLog->Log(_L("CThemesTest::AddDDFCheckL()"));
       
   475 
       
   476 	TInt ret = KErrNone;
       
   477 
       
   478 	CDDFTestParams *ddfParams = CDDFTestParams::NewL( iLog, aItem );
       
   479 	AddDDFParamsL( ddfParams );
       
   480 
       
   481 	return ret;
       
   482 	}
       
   483 
       
   484 // -----------------------------------------------------------------------------
       
   485 // CThemesTest::DDFVersionL
       
   486 // 
       
   487 // -----------------------------------------------------------------------------
       
   488 //
       
   489 TInt CThemesTest::DDFVersionL( CStifItemParser& aItem )
       
   490 	{
       
   491     // Print to UI
       
   492     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("DDFVersionL") );
       
   493     // Print to log file
       
   494     iLog->Log(_L("CThemesTest::DDFVersionL()"));
       
   495 
       
   496 //	void DDFVersionL( CBufBase& aVersion );
       
   497 	TInt ret = KErrNone;
       
   498 
       
   499 	CTestParams *params = CTestParams::NewLC( iLog, aItem );
       
   500 
       
   501 /*	
       
   502 URI=
       
   503 
       
   504 File=
       
   505 Text=
       
   506 
       
   507 IT= Input (text)
       
   508 IF= Input File (filename)
       
   509 OF= Output File
       
   510 
       
   511 ET= Expected result (text)
       
   512 EF= Expected file (filename)
       
   513 */
       
   514 
       
   515 	CBufFlat *version = CBufFlat::NewL( 16 );
       
   516 	CleanupStack::PushL( version );
       
   517 	iAdapter->DDFVersionL( *version );
       
   518 
       
   519 	ret = params->CheckDataL( *version );
       
   520 	
       
   521 	CleanupStack::PopAndDestroy( version );
       
   522 	CleanupStack::PopAndDestroy( params );
       
   523 
       
   524 	return ret;
       
   525 	}
       
   526 
       
   527 // -----------------------------------------------------------------------------
       
   528 // CThemesTest::DDFStructureL
       
   529 // 
       
   530 // -----------------------------------------------------------------------------
       
   531 //
       
   532 TInt CThemesTest::DDFStructureL( CStifItemParser& /*aItem*/ )
       
   533 	{
       
   534     // Print to UI
       
   535     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("DDFStructureL") );
       
   536     // Print to log file
       
   537     iLog->Log(_L("CThemesTest::DDFStructureL()"));
       
   538 
       
   539 	TInt ret = KErrNone;
       
   540 
       
   541 //	void DDFStructureL( MSmlDmDDFObject& aDDF );
       
   542 	CTestDmDDFObject* ddfRoot = CTestDmDDFObject::NewLC( iLog ); //, aNodeName );
       
   543 	ddfRoot->SetNameL( _L8( "/" ) );
       
   544 
       
   545 	iAdapter->DDFStructureL( *ddfRoot );
       
   546 	ddfRoot->DumpL( _L8(""), EFalse );
       
   547 
       
   548 	ret = CheckDDFL( ddfRoot );
       
   549 
       
   550 	CleanupStack::PopAndDestroy( ddfRoot );
       
   551 	ddfRoot = 0;
       
   552 
       
   553 	return ret;
       
   554 	}
       
   555 
       
   556 	
       
   557 // -----------------------------------------------------------------------------
       
   558 // CThemesTest::UpdateLeafObjectL
       
   559 // 
       
   560 // -----------------------------------------------------------------------------
       
   561 //
       
   562 TInt CThemesTest::UpdateLeafObjectL( CStifItemParser& aItem )
       
   563 	{
       
   564     // Print to UI
       
   565     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("UpdateLeafObjectL") );
       
   566     // Print to log file
       
   567     iLog->Log(_L("CThemesTest::UpdateLeafObjectL()"));
       
   568 
       
   569 	TInt ret = KErrNone;
       
   570 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   571 	AddParamsL( params );
       
   572 
       
   573 	TPtrC8 uri( params->Uri() );
       
   574 	TPtrC8 object( params->Data() );
       
   575 	TPtrC8 type( params->DataType() );
       
   576 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   577 	CleanupStack::PushL( luid );
       
   578 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   579 //	TInt resultsRef = iCallback->GetNewResultsRefL( );
       
   580 
       
   581 	params->SetStatusRef( statusRef);
       
   582 //	params->SetResultsRef( resultsRef);
       
   583 
       
   584 	iAdapter->UpdateLeafObjectL( uri, *luid, object, type, statusRef );
       
   585 
       
   586 	ret = params->CheckL( iCallback );
       
   587 
       
   588 	// Cleanup
       
   589 	CleanupStack::PopAndDestroy( luid );
       
   590 	
       
   591 	return ret;
       
   592 	}
       
   593 
       
   594 // -----------------------------------------------------------------------------
       
   595 // CThemesTest::UpdateLeafObjectStreamL
       
   596 // 
       
   597 // -----------------------------------------------------------------------------
       
   598 //
       
   599 TInt CThemesTest::UpdateLeafObjectStreamL( CStifItemParser& /*aItem*/ )
       
   600 	{
       
   601     // Print to UI
       
   602     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("UpdateLeafObjectStreamL") );
       
   603     // Print to log file
       
   604     iLog->Log(_L("CThemesTest::UpdateLeafObjectStreamL()"));
       
   605 
       
   606 //	void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef );
       
   607 
       
   608 	TInt ret = KErrNotSupported;
       
   609 	return ret;
       
   610 	}
       
   611 
       
   612 // -----------------------------------------------------------------------------
       
   613 // CThemesTest::DeleteObjectL
       
   614 // 
       
   615 // -----------------------------------------------------------------------------
       
   616 //
       
   617 TInt CThemesTest::DeleteObjectL( CStifItemParser& aItem )
       
   618 	{
       
   619     // Print to UI
       
   620     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("DeleteObjectL") );
       
   621     // Print to log file
       
   622     iLog->Log(_L("CThemesTest::DeleteObjectL()"));
       
   623 
       
   624 	TInt ret = KErrNone;
       
   625 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   626 	AddParamsL( params );
       
   627 
       
   628 	TPtrC8 uri( params->Uri() );
       
   629 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   630 	CleanupStack::PushL( luid );
       
   631 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   632 
       
   633 //	void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef );
       
   634 	iAdapter->DeleteObjectL( uri, *luid, statusRef );
       
   635 
       
   636 	params->SetStatusRef( statusRef);
       
   637 	ret = params->CheckL( iCallback );
       
   638 
       
   639 	// Cleanup
       
   640 	CleanupStack::PopAndDestroy( luid );
       
   641 	return ret;
       
   642 	}
       
   643 
       
   644 // -----------------------------------------------------------------------------
       
   645 // CThemesTest::FetchLeafObjectL
       
   646 // 
       
   647 // -----------------------------------------------------------------------------
       
   648 //
       
   649 TInt CThemesTest::FetchLeafObjectL( CStifItemParser& aItem )
       
   650 	{
       
   651     // Print to UI
       
   652     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("FetchLeafObjectL") );
       
   653     // Print to log file
       
   654     iLog->Log(_L("CThemesTest::FetchLeafObjectL()"));
       
   655 
       
   656 	TInt ret = KErrNone;
       
   657 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   658 	AddParamsL( params );
       
   659 
       
   660 	TPtrC8 uri( params->Uri() );
       
   661 	TPtrC8 type( params->DataType() );
       
   662 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   663 	CleanupStack::PushL( luid );
       
   664 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   665 	TInt resultsRef = iCallback->GetNewResultsRefL( );
       
   666 
       
   667 	params->SetStatusRef( statusRef);
       
   668 	params->SetResultsRef( resultsRef);
       
   669 
       
   670 //	void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef );
       
   671 	iAdapter->FetchLeafObjectL( uri, *luid, type, resultsRef, statusRef );
       
   672 
       
   673 	ret = params->CheckL( iCallback );
       
   674 
       
   675 	// Cleanup
       
   676 	CleanupStack::PopAndDestroy( luid );
       
   677 	return ret;
       
   678 	}
       
   679 
       
   680 // -----------------------------------------------------------------------------
       
   681 // CThemesTest::FetchLeafObjectSizeL
       
   682 // 
       
   683 // -----------------------------------------------------------------------------
       
   684 //
       
   685 TInt CThemesTest::FetchLeafObjectSizeL( CStifItemParser& aItem )
       
   686 	{
       
   687     // Print to UI
       
   688     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("FetchLeafObjectSizeL") );
       
   689     // Print to log file
       
   690     iLog->Log(_L("CThemesTest::FetchLeafObjectSizeL()"));
       
   691 
       
   692 	TInt ret = KErrNone;
       
   693 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   694 	AddParamsL( params );
       
   695 
       
   696 	TPtrC8 uri( params->Uri() );
       
   697 //	TPtrC8 object( params->Data() );
       
   698 	TPtrC8 type( params->DataType() );
       
   699 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   700 	CleanupStack::PushL( luid );
       
   701 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   702 	TInt resultsRef = iCallback->GetNewResultsRefL( );
       
   703 
       
   704 	params->SetStatusRef( statusRef);
       
   705 	params->SetResultsRef( resultsRef);
       
   706 
       
   707 //	void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef );
       
   708 	iAdapter->FetchLeafObjectSizeL( uri, *luid, type, resultsRef, statusRef );
       
   709 
       
   710 	ret = params->CheckL( iCallback );
       
   711 
       
   712 	// Cleanup
       
   713 	CleanupStack::PopAndDestroy( luid );
       
   714 	return ret;
       
   715 	}
       
   716 
       
   717 // -----------------------------------------------------------------------------
       
   718 // CThemesTest::ChildURIListL
       
   719 // 
       
   720 // -----------------------------------------------------------------------------
       
   721 //
       
   722 TInt CThemesTest::ChildURIListL( CStifItemParser& aItem )
       
   723 	{
       
   724     // Print to UI
       
   725     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("ChildURIListL") );
       
   726     // Print to log file
       
   727     iLog->Log(_L("CThemesTest::ChildURIListL()"));
       
   728 
       
   729 	TInt ret = KErrNone;
       
   730 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   731 	AddParamsL( params );
       
   732 
       
   733 	TPtrC8 uri( params->Uri() );
       
   734 //sf-	TPtrC8 object( params->Data() );
       
   735 	TPtrC8 type( params->DataType() );
       
   736 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   737 	CleanupStack::PushL( luid );
       
   738 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   739 	TInt resultsRef = iCallback->GetNewResultsRefL( );
       
   740 
       
   741 	params->SetStatusRef( statusRef);
       
   742 	params->SetResultsRef( resultsRef);
       
   743 
       
   744 //	CreatePreviousURISegmentList( );
       
   745 	CArrayFixFlat<TSmlDmMappingInfo>* uriSegmentList = new (ELeave) CArrayFixFlat<TSmlDmMappingInfo>( 10 );
       
   746 	CleanupStack::PushL( uriSegmentList );
       
   747 
       
   748 	TPtrC8 oldUriSegs = params->Data();
       
   749 	TInt i;
       
   750 	TInt count = 0;
       
   751 	if (oldUriSegs.Length() > 0)
       
   752 		{
       
   753 		count = NSmlDmURI::NumOfURISegs( oldUriSegs );;
       
   754 		}
       
   755 
       
   756 	for (i = 0 ; i < count ; i++)
       
   757 		{
       
   758 		TPtrC8 tmpSeg = NSmlDmURI::URISeg( oldUriSegs, i + 1 );
       
   759 //		TBuf8< uri.Length() + 1 + KSmlMaxURISegLen > tmpUri;
       
   760 		TBuf8< 256 > tmpUri;
       
   761 		tmpUri = uri;
       
   762 		tmpUri.Append( _L8("/") );
       
   763 		tmpUri.Append( tmpSeg );
       
   764 		TPtrC8 tmpLuid = iCallback->GetLuidL( tmpUri );
       
   765 
       
   766 		TSmlDmMappingInfo t; // = { seg, tmpLuid };
       
   767 		t.iURISeg = tmpSeg;
       
   768 		t.iURISegLUID.Set( tmpLuid );
       
   769 
       
   770 		uriSegmentList->AppendL( t );
       
   771 		}
       
   772 
       
   773 //	void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef );
       
   774 	iAdapter->ChildURIListL( uri, *luid, *uriSegmentList, resultsRef, statusRef );
       
   775 
       
   776 	ret = params->CheckL( iCallback );
       
   777 
       
   778 	// Cleanup
       
   779 	CleanupStack::PopAndDestroy( uriSegmentList );
       
   780 	CleanupStack::PopAndDestroy( luid );
       
   781 	return ret;
       
   782 	}
       
   783 
       
   784 	
       
   785 // -----------------------------------------------------------------------------
       
   786 // CThemesTest::AddNodeObjectL
       
   787 // 
       
   788 // -----------------------------------------------------------------------------
       
   789 //
       
   790 TInt CThemesTest::AddNodeObjectL( CStifItemParser& aItem )
       
   791 	{
       
   792     // Print to UI
       
   793     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("AddNodeObjectL") );
       
   794     // Print to log file
       
   795     iLog->Log(_L("CThemesTest::AddNodeObjectL()"));
       
   796 
       
   797 	TInt ret = KErrNone;
       
   798 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   799 	AddParamsL( params );
       
   800 
       
   801 	TPtrC8 uri( params->Uri() );
       
   802 	TPtrC8 parentUri = NSmlDmURI::ParentURI( uri );
       
   803 	TPtrC8 parentLuid = iCallback->GetLuidL( parentUri );
       
   804 
       
   805 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   806 
       
   807 	params->SetStatusRef( statusRef);
       
   808 
       
   809 //	void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, TInt aStatusRef );
       
   810 	iAdapter->AddNodeObjectL( uri, parentLuid, statusRef );
       
   811 
       
   812 	ret = params->CheckL( iCallback );
       
   813 
       
   814 	// Cleanup
       
   815 
       
   816 	return ret;
       
   817 	}
       
   818 
       
   819 // -----------------------------------------------------------------------------
       
   820 // CThemesTest::ExecuteCommandL
       
   821 // 
       
   822 // -----------------------------------------------------------------------------
       
   823 //
       
   824 TInt CThemesTest::ExecuteCommandL( CStifItemParser& aItem )
       
   825 	{
       
   826     // Print to UI
       
   827     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("ExecuteCommandL") );
       
   828     // Print to log file
       
   829     iLog->Log(_L("CThemesTest::ExecuteCommandL()"));
       
   830 
       
   831 	TInt ret = KErrNone;
       
   832 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   833 	AddParamsL( params );
       
   834 
       
   835 	TPtrC8 uri( params->Uri() );
       
   836 	TPtrC8 argument( params->Data() );
       
   837 	TPtrC8 type( params->DataType() );
       
   838 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   839 	CleanupStack::PushL( luid );
       
   840 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   841 
       
   842 	params->SetStatusRef( statusRef);
       
   843 
       
   844 //	void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aArgument, const TDesC8& aType, TInt aStatusRef );
       
   845 	iAdapter->ExecuteCommandL( uri, *luid, argument, type, statusRef );
       
   846 
       
   847 	ret = params->CheckL( iCallback );
       
   848 
       
   849 	// Cleanup
       
   850 	CleanupStack::PopAndDestroy( luid );
       
   851 	return ret;
       
   852 	}
       
   853 
       
   854 // -----------------------------------------------------------------------------
       
   855 // CThemesTest::ExecuteCommandStreamL
       
   856 // 
       
   857 // -----------------------------------------------------------------------------
       
   858 //
       
   859 TInt CThemesTest::ExecuteCommandStreamL( CStifItemParser& /*aItem*/ )
       
   860 	{
       
   861     // Print to UI
       
   862     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("ExecuteCommandStreamL") );
       
   863     // Print to log file
       
   864     iLog->Log(_L("CThemesTest::ExecuteCommandStreamL()"));
       
   865 
       
   866 //	void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef );
       
   867 
       
   868 	TInt ret = KErrNotSupported;
       
   869 	return ret;
       
   870 	}
       
   871 
       
   872 // -----------------------------------------------------------------------------
       
   873 // CThemesTest::CopyCommandL
       
   874 // 
       
   875 // -----------------------------------------------------------------------------
       
   876 //
       
   877 TInt CThemesTest::CopyCommandL( CStifItemParser& aItem )
       
   878 	{
       
   879     // Print to UI
       
   880     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("CopyCommandL") );
       
   881     // Print to log file
       
   882     iLog->Log(_L("CThemesTest::CopyCommandL()"));
       
   883 
       
   884 	TInt ret = KErrNone;
       
   885 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   886 	AddParamsL( params );
       
   887 
       
   888 	TPtrC8 uri( params->Uri() );
       
   889 	TPtrC8 target( params->Data() );
       
   890 	TPtrC8 type( params->DataType() );
       
   891 	HBufC8* luid = iCallback->GetLuidAllocL( uri );
       
   892 	CleanupStack::PushL( luid );
       
   893 	TInt statusRef = iCallback->GetNewStatusRefL( );
       
   894 
       
   895 	params->SetStatusRef( statusRef );
       
   896 
       
   897 	TInt pos = target.Locate( ':' );
       
   898 	if (pos < 0)
       
   899 		{
       
   900 		pos = target.Length();
       
   901 		}
       
   902 	TPtrC8 targetUri = target.Left( pos );
       
   903 	
       
   904 	if (pos < target.Length())
       
   905 		{
       
   906 		pos++;
       
   907 		}
       
   908 	TPtrC8 targetLuid = target.Right( target.Length() - pos );
       
   909 
       
   910 //	void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, const TDesC8& aSourceURI, const TDesC8& aSourceLUID, const TDesC8& aType, TInt aStatusRef );
       
   911 	iAdapter->CopyCommandL( targetUri, targetLuid, uri, *luid, type, statusRef );
       
   912 
       
   913 	ret = params->CheckL( iCallback );
       
   914 
       
   915 	// Cleanup
       
   916 	CleanupStack::PopAndDestroy( luid );
       
   917 	return ret;
       
   918 	}
       
   919 
       
   920 // -----------------------------------------------------------------------------
       
   921 // CThemesTest::StartAtomicL
       
   922 // 
       
   923 // -----------------------------------------------------------------------------
       
   924 //
       
   925 TInt CThemesTest::StartAtomicL( CStifItemParser& /*aItem*/ )
       
   926 	{
       
   927     // Print to UI
       
   928     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("StartAtomicL") );
       
   929     // Print to log file
       
   930     iLog->Log(_L("CThemesTest::StartAtomicL()"));
       
   931 
       
   932 	TInt ret = KErrNone;
       
   933 //sf-	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   934 //sf-	AddParamsL( params );
       
   935 
       
   936 //	void StartAtomicL();
       
   937 	iAdapter->StartAtomicL();
       
   938 
       
   939 	// Cleanup
       
   940 	return ret;
       
   941 	}
       
   942 
       
   943 // -----------------------------------------------------------------------------
       
   944 // CThemesTest::CommitAtomicL
       
   945 // 
       
   946 // -----------------------------------------------------------------------------
       
   947 //
       
   948 TInt CThemesTest::CommitAtomicL( CStifItemParser& /*aItem*/ )
       
   949 	{
       
   950     // Print to UI
       
   951     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("CommitAtomicL") );
       
   952     // Print to log file
       
   953     iLog->Log(_L("CThemesTest::CommitAtomicL()"));
       
   954 
       
   955 	TInt ret = KErrNone;
       
   956 //sf-	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   957 //sf-	AddParamsL( params );
       
   958 
       
   959 //	void CommitAtomicL();
       
   960 	iAdapter->CommitAtomicL();
       
   961 
       
   962 	// Cleanup
       
   963 	return ret;
       
   964 	}
       
   965 
       
   966 // -----------------------------------------------------------------------------
       
   967 // CThemesTest::RollbackAtomicL
       
   968 // 
       
   969 // -----------------------------------------------------------------------------
       
   970 //
       
   971 TInt CThemesTest::RollbackAtomicL( CStifItemParser& /*aItem*/ )
       
   972 	{
       
   973     // Print to UI
       
   974     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("RollbackAtomicL") );
       
   975     // Print to log file
       
   976     iLog->Log(_L("CThemesTest::RollbackAtomicL()"));
       
   977 
       
   978 	TInt ret = KErrNone;
       
   979 //sf-	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
   980 //sf-	AddParamsL( params );
       
   981 
       
   982 //	void RollbackAtomicL();
       
   983 	iAdapter->RollbackAtomicL();
       
   984 
       
   985 	// Cleanup
       
   986 	return ret;
       
   987 	}
       
   988 
       
   989 // -----------------------------------------------------------------------------
       
   990 // CThemesTest::StreamingSupportL
       
   991 // 
       
   992 // -----------------------------------------------------------------------------
       
   993 //
       
   994 TInt CThemesTest::StreamingSupportL( CStifItemParser& aItem )
       
   995 	{
       
   996     // Print to UI
       
   997     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("StreamingSupportL") );
       
   998     // Print to log file
       
   999     iLog->Log(_L("CThemesTest::StreamingSupportL()"));
       
  1000 
       
  1001 	TInt ret = KErrNone;
       
  1002 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1003 	AddParamsL( params );
       
  1004 
       
  1005 	TInt itemSize = 0;
       
  1006 	TBool status = iAdapter->StreamingSupport( itemSize );
       
  1007 
       
  1008 	TBuf8<10> statusStr;
       
  1009 	TBuf8<20> itemSizeStr;
       
  1010 	
       
  1011 	statusStr.Format( _L8("%d"), status );
       
  1012 	itemSizeStr.Format( _L8("%d"), itemSize );
       
  1013 	ret = params->CheckStatusL( status );
       
  1014 	ret = params->CheckDataL( itemSizeStr );
       
  1015 
       
  1016 	// Cleanup
       
  1017 	return ret;
       
  1018 	}
       
  1019 
       
  1020 // -----------------------------------------------------------------------------
       
  1021 // CThemesTest::StreamCommittedL
       
  1022 // 
       
  1023 // -----------------------------------------------------------------------------
       
  1024 //
       
  1025 TInt CThemesTest::StreamCommittedL( CStifItemParser& /*aItem*/ )
       
  1026 	{
       
  1027     // Print to UI
       
  1028     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("StreamCommittedL") );
       
  1029     // Print to log file
       
  1030     iLog->Log(_L("CThemesTest::StreamCommittedL()"));
       
  1031 
       
  1032 	TInt ret = KErrNone;
       
  1033 //sf-	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1034 //sf-	AddParamsL( params );
       
  1035 
       
  1036 //	void StreamCommittedL();
       
  1037 	iAdapter->StreamCommittedL();
       
  1038 
       
  1039 	// Cleanup
       
  1040 	return ret;
       
  1041 	}
       
  1042 
       
  1043 // -----------------------------------------------------------------------------
       
  1044 // CThemesTest::CompleteOutstandingCmdsL
       
  1045 // 
       
  1046 // -----------------------------------------------------------------------------
       
  1047 //
       
  1048 TInt CThemesTest::CompleteOutstandingCmdsL( CStifItemParser& /*aItem*/ )
       
  1049 	{
       
  1050     // Print to UI
       
  1051     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("CompleteOutstandingCmdsL") );
       
  1052     // Print to log file
       
  1053     iLog->Log(_L("CThemesTest::CompleteOutstandingCmdsL()"));
       
  1054 
       
  1055 	TInt ret = KErrNone;
       
  1056 //sf-	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1057 //sf-	AddParamsL( params );
       
  1058 
       
  1059 //	void CompleteOutstandingCmdsL();
       
  1060 	iAdapter->CompleteOutstandingCmdsL();
       
  1061 
       
  1062 	ret = CheckAllL( );
       
  1063 
       
  1064 	// Cleanup
       
  1065 	return ret;
       
  1066 	}
       
  1067 #if 0
       
  1068 // -----------------------------------------------------------------------------
       
  1069 // CThemesTest::CreateFileL
       
  1070 // 
       
  1071 // -----------------------------------------------------------------------------
       
  1072 //
       
  1073 TInt CThemesTest::CreateFileL( CStifItemParser& aItem )
       
  1074     {
       
  1075     // Print to UI
       
  1076     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("CreateFileL") );
       
  1077     // Print to log file
       
  1078     iLog->Log(_L("CThemesTest::CreateFileL()"));
       
  1079 
       
  1080 	TInt ret = KErrNone;
       
  1081 	 
       
  1082 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1083 	AddParamsL( params );
       
  1084 	
       
  1085 	TPtrC8 filename( params->Data() );
       
  1086 	
       
  1087 	RFs fs; fs.Connect();
       
  1088 	
       
  1089 	TFileName fname; fname.Copy( filename );
       
  1090 	RFile f; f.Replace(fs, fname, EFileShareExclusive|EFileWrite);
       
  1091 	TPtrC8 dataType( params->DataType() );
       
  1092 	if(dataType.Length() == 0)
       
  1093 	    {
       
  1094 	    f.Write(_L8("File created by ThemesTest"));
       
  1095 	    }
       
  1096 	else
       
  1097 	    {
       
  1098 	    f.Write( dataType );
       
  1099 	    }
       
  1100 	f.Close();
       
  1101 	
       
  1102 	fs.Close();
       
  1103 
       
  1104     ret = params->CheckL( iCallback );
       
  1105 	//ret = CheckAllL( );
       
  1106 
       
  1107     //CleanupStack::PopAndDestroy( params );
       
  1108 
       
  1109 	// Cleanup
       
  1110 	return ret;
       
  1111     }
       
  1112     
       
  1113 // -----------------------------------------------------------------------------
       
  1114 // CThemesTest::RFSCommandL
       
  1115 // 
       
  1116 // -----------------------------------------------------------------------------
       
  1117 //
       
  1118 TInt CThemesTest::RFSCommandL( CStifItemParser& aItem )
       
  1119     {
       
  1120     // Print to UI
       
  1121     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("RFSCommandL") );
       
  1122 
       
  1123     // Print to log file
       
  1124     iLog->Log(_L("CThemesTest::RFSCommandL()"));
       
  1125 
       
  1126 	TInt status = KErrNone;
       
  1127 	 
       
  1128 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1129 	AddParamsL( params );
       
  1130 	
       
  1131 	TPtrC8 command( params->Data() );
       
  1132 	
       
  1133     RRfsClient client;
       
  1134     
       
  1135     status = client.Connect();
       
  1136     
       
  1137     if( KErrNone == status )
       
  1138         {        
       
  1139         CleanupClosePushL( client );
       
  1140 
       
  1141         HBufC* cmd = HBufC::NewLC( command.Length() );
       
  1142         if(cmd != 0)
       
  1143             {            
       
  1144             TPtr ptr( cmd->Des() );
       
  1145             ptr.Copy( command );
       
  1146             status = client.RunScriptInDescriptor(ptr);
       
  1147             if(status >= 0) status = 0;
       
  1148             }
       
  1149         CleanupStack::PopAndDestroy( cmd );
       
  1150 
       
  1151         CleanupStack::PopAndDestroy( &client );
       
  1152         }
       
  1153 
       
  1154     params->CheckL( iCallback );
       
  1155 
       
  1156 	return status;    
       
  1157     }
       
  1158 
       
  1159 // -----------------------------------------------------------------------------
       
  1160 // CThemesTest::LoadPolicyL
       
  1161 // 
       
  1162 // -----------------------------------------------------------------------------
       
  1163 //
       
  1164 TInt CThemesTest::LoadPolicyL( CStifItemParser& aItem )
       
  1165     {
       
  1166     // Print to UI
       
  1167     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("LoadPolicyL") );
       
  1168     // Print to log file
       
  1169     iLog->Log(_L("CThemesTest::LoadPolicyL()"));
       
  1170 	TInt status = KErrNone;
       
  1171 	 
       
  1172 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1173 	AddParamsL( params );
       
  1174 
       
  1175 	TPtrC8 data( params->Data() );
       
  1176 
       
  1177 	RPolicyEngine eng;
       
  1178 	status = eng.Connect();
       
  1179 	
       
  1180 	if( KErrNone == status )
       
  1181 	    {
       
  1182         iLog->Log(_L("CThemesTest::LoadPolicyL() Connected to policy engine"));
       
  1183 	    RPolicyManagement man;
       
  1184 	    status = man.Open( eng );
       
  1185 	    if( KErrNone == status )
       
  1186 	        {
       
  1187             iLog->Log(_L("CThemesTest::LoadPolicyL() Policy management session open"));
       
  1188 	        TParserResponse resp;
       
  1189 	        status = man.ExecuteOperation(data, resp);
       
  1190             if( KErrNone == status )
       
  1191                 {
       
  1192                 iLog->Log(_L("CThemesTest::LoadPolicyL() Policy added"));                
       
  1193                 }
       
  1194             man.Close();
       
  1195 	        }
       
  1196 	    eng.Close();
       
  1197 	    }
       
  1198 
       
  1199     params->CheckL( iCallback );
       
  1200 
       
  1201 	return status;
       
  1202     }
       
  1203 
       
  1204 // -----------------------------------------------------------------------------
       
  1205 // CThemesTest::SetCertificateL
       
  1206 // 
       
  1207 // -----------------------------------------------------------------------------
       
  1208 //
       
  1209 /*
       
  1210 Test-Case for this API
       
  1211 [Test]
       
  1212 title SS_GetAll
       
  1213 create ThemesTest ttest
       
  1214 ttest LoadL 1020782E
       
  1215 
       
  1216 ttest SetCertificate <CentralRepositoryUid>
       
  1217 [EndTest]
       
  1218 */
       
  1219 
       
  1220 TInt CThemesTest::SetCertificateL( CStifItemParser& aItem )
       
  1221     {
       
  1222     TInt errx = KErrNone;
       
  1223 
       
  1224     RDMUtil dm;
       
  1225     if( KErrNone == dm.Connect() )
       
  1226         {
       
  1227         dm.Close();
       
  1228         }
       
  1229 
       
  1230     TCertInfo info;
       
  1231     info.iSerialNo    = _L8("Lässynlää");
       
  1232     info.iFingerprint = _L8("Joopajoo");;
       
  1233 
       
  1234 	// Changed due to SF.
       
  1235 	TInt ret = KErrNone;
       
  1236     TUint CentralRepositoryUid = 0;
       
  1237 
       
  1238 	ret = aItem.GetNextInt( CentralRepositoryUid, EHex );
       
  1239 	
       
  1240 	const TInt KCertKey = 0x01;
       
  1241 	CRepository *re = NULL;
       
  1242 	TRAP( errx, re = CRepository::NewL ( CentralRepositoryUid ) );
       
  1243 	if (errx == KErrNone )
       
  1244 		{
       
  1245 		TPckg<TCertInfo> pcert( info );
       
  1246 		errx = re->Create( KCertKey, pcert ) ;
       
  1247 		if ( errx == KErrNone )
       
  1248 			{
       
  1249 			}
       
  1250 		else
       
  1251 			{
       
  1252 			if ( errx == KErrAlreadyExists )
       
  1253 				{
       
  1254 				errx = re->Set( KCertKey, pcert ) ;
       
  1255 				if ( errx != KErrNone )
       
  1256 					{
       
  1257 					// DBG_ARGS8(_S8("ERROR Failed to add reposiritry key %d"), errx );
       
  1258 					}
       
  1259 				}
       
  1260 			else
       
  1261 				{
       
  1262 				// DBG_ARGS8(_S8("ERROR Failed to create reposiritry key %d"), errx );	
       
  1263 				}
       
  1264 			
       
  1265 			}	
       
  1266 		delete re ;
       
  1267 		}
       
  1268 	else
       
  1269 		{
       
  1270 		// DBG_ARGS8(_S8("ERROR Failed to open reposiritry %d"), erx );	
       
  1271 		}
       
  1272 
       
  1273     return errx;
       
  1274     }
       
  1275 
       
  1276 // -----------------------------------------------------------------------------
       
  1277 // CThemesTest::ConnectToPolicyServerL
       
  1278 // 
       
  1279 // -----------------------------------------------------------------------------
       
  1280 //
       
  1281 TInt CThemesTest::ConnectToPolicyServerL( CStifItemParser& /*aItem*/ )
       
  1282     {
       
  1283     TInt status = KErrNone;
       
  1284 
       
  1285 	RPolicyEngine eng;
       
  1286 	status = eng.Connect();
       
  1287 	
       
  1288 	if( KErrNone == status )
       
  1289 	    {
       
  1290         iLog->Log(_L("CThemesTest::LoadPolicyL() Connected to policy engine"));
       
  1291 	    RPolicyManagement man;
       
  1292 	    status = man.Open( eng );
       
  1293 	    if( KErrNone == status )
       
  1294 	        {
       
  1295             iLog->Log(_L("CThemesTest::LoadPolicyL() Policy management session open"));
       
  1296             man.Close();
       
  1297 	        }
       
  1298 	    eng.Close();
       
  1299 	    }
       
  1300     
       
  1301     return status;
       
  1302     }
       
  1303 
       
  1304 // -----------------------------------------------------------------------------
       
  1305 // CThemesTest::ConnectToDMUTILL
       
  1306 // 
       
  1307 // -----------------------------------------------------------------------------
       
  1308 //
       
  1309 TInt CThemesTest::ConnectToDMUTILL( CStifItemParser& /*aItem*/ )
       
  1310     {
       
  1311     TInt status = KErrNone;
       
  1312 
       
  1313     RDMUtil dm;
       
  1314     status = dm.Connect();
       
  1315     if( KErrNone == status )
       
  1316         {
       
  1317         dm.Close();
       
  1318         }
       
  1319 
       
  1320     return status;
       
  1321     }
       
  1322 
       
  1323 // -----------------------------------------------------------------------------
       
  1324 // CThemesTest::GetThirdPartyValueL
       
  1325 // 
       
  1326 // -----------------------------------------------------------------------------
       
  1327 //
       
  1328 HBufC8* CThemesTest::GetThirdPartyValueL( TInt aType )
       
  1329     {
       
  1330     RTerminalControl tc;
       
  1331     User::LeaveIfError( tc.Connect() );
       
  1332 
       
  1333     RTerminalControl3rdPartySession ts;
       
  1334     User::LeaveIfError( ts.Open( tc ) );
       
  1335 
       
  1336     TInt size = ts.GetDeviceLockParameterSize( aType );
       
  1337     if( size < 0 )
       
  1338         {
       
  1339         User::Leave( size );
       
  1340         }
       
  1341 
       
  1342     HBufC8* buffer = HBufC8::NewLC( size );
       
  1343     TPtr8 ptr8( buffer->Des() );
       
  1344 
       
  1345     User::LeaveIfError( ts.GetDeviceLockParameter( aType, ptr8 ) );
       
  1346 
       
  1347     ts.Close();
       
  1348     tc.Close();
       
  1349 
       
  1350     CleanupStack::Pop( buffer );
       
  1351     return buffer;
       
  1352     }
       
  1353 
       
  1354 // -----------------------------------------------------------------------------
       
  1355 // CThemesTest::SetThirdPartyValueL
       
  1356 // 
       
  1357 // -----------------------------------------------------------------------------
       
  1358 //
       
  1359 void CThemesTest::SetThirdPartyValueL( TInt aType, TDesC8& aData )
       
  1360     {
       
  1361     RTerminalControl tc;
       
  1362     User::LeaveIfError( tc.Connect() );
       
  1363 
       
  1364     RTerminalControl3rdPartySession ts;
       
  1365     User::LeaveIfError( ts.Open( tc ) );
       
  1366 
       
  1367     User::LeaveIfError( ts.SetDeviceLockParameter( aType, aData ) );
       
  1368 
       
  1369     ts.Close();
       
  1370     tc.Close();
       
  1371     }
       
  1372 
       
  1373 // -----------------------------------------------------------------------------
       
  1374 // CThemesTest::ThirdPartyCommandL
       
  1375 // 
       
  1376 // -----------------------------------------------------------------------------
       
  1377 //
       
  1378 TInt CThemesTest::ThirdPartyCommandL( CStifItemParser& aItem )
       
  1379     {
       
  1380     CTestDmCallback *cb = CTestDmCallback::NewL( iLog );
       
  1381     CleanupStack::PushL( cb );
       
  1382     
       
  1383     // Print to UI
       
  1384     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("ThirdP_AutolockPeriodL") );
       
  1385     // Print to log file
       
  1386     iLog->Log(_L("CThemesTest::ThirdP_AutolockPeriodL()"));
       
  1387 	TInt status = KErrNone;
       
  1388 
       
  1389 	CTestParams* params = CTestParams::NewL( iLog, aItem );
       
  1390 	AddParamsL( params );
       
  1391 
       
  1392     TPtrC8 command( params->Uri() );
       
  1393     TPtrC8 direction( params->DataType() );
       
  1394     TPtrC8 value( params->Data() );
       
  1395 
       
  1396 /*
       
  1397     	{
       
  1398         	ETimeout = 1000,		// Autolock timeout. Values in minutes. 
       
  1399         	EMaxTimeout,	// Maximum autolock timeout value. When != 0 the lock is enabled, When = 0 the lock is off
       
  1400         	EPasscode,		// Passcode. Return value not supported
       
  1401         	EPasscodePolicy, // 0 = passcode free. When != 0 the passcode can not be changed
       
  1402         	ELock,			// Lock the terminal immediately. Return value not supported
       
  1403         	EDeviceWipe, 	// When != 0 the Device is wiped
       
  1404         	ELast = 2000
       
  1405     	};
       
  1406 */
       
  1407 
       
  1408     if( direction.Compare( _L8("read") ) == 0)
       
  1409         {
       
  1410         HBufC8* data = 0;
       
  1411         if( command.Compare( _L8("ETimeout") ) == 0 )
       
  1412             {
       
  1413             data = GetThirdPartyValueL( RTerminalControl3rdPartySession::ETimeout );
       
  1414             }
       
  1415         else if( command.Compare( _L8("EMaxTimeout") ) == 0 )
       
  1416             {
       
  1417             data = GetThirdPartyValueL( RTerminalControl3rdPartySession::EMaxTimeout );
       
  1418             }
       
  1419         else if( command.Compare( _L8("EPasscode") ) == 0 )
       
  1420             {
       
  1421             data = GetThirdPartyValueL( RTerminalControl3rdPartySession::EPasscode );
       
  1422             }
       
  1423         else if( command.Compare( _L8("EPasscodePolicy") ) == 0 )
       
  1424             {
       
  1425             data = GetThirdPartyValueL( RTerminalControl3rdPartySession::EPasscodePolicy );
       
  1426             }
       
  1427         else if( command.Compare( _L8("ELock") ) == 0 )
       
  1428             {
       
  1429             data = GetThirdPartyValueL( RTerminalControl3rdPartySession::ELock );
       
  1430             }
       
  1431         else if( command.Compare( _L8("EDeviceWipe") ) == 0 )
       
  1432             {
       
  1433             data = GetThirdPartyValueL( RTerminalControl3rdPartySession::EDeviceWipe );
       
  1434             }
       
  1435 
       
  1436         if( 0 == data )
       
  1437             {
       
  1438             User::Leave( KErrGeneral );
       
  1439             }
       
  1440         CleanupStack::PushL( data );
       
  1441 
       
  1442     	TInt statusRef = cb->GetNewStatusRefL( );
       
  1443         TInt resultsRef = cb->GetNewResultsRefL( );
       
  1444 
       
  1445     	params->SetStatusRef( statusRef);
       
  1446         params->SetResultsRef( resultsRef);
       
  1447 
       
  1448         CBufFlat* buf = CBufFlat::NewL(128);
       
  1449         CleanupStack::PushL( buf );
       
  1450 
       
  1451         buf->InsertL( 0, *data );
       
  1452         cb->SetResultsL( resultsRef, *buf, KNullDesC8() );
       
  1453         cb->SetStatusL( statusRef, (MSmlDmAdapter::TError)0 );
       
  1454 
       
  1455         CleanupStack::PopAndDestroy( buf );
       
  1456         CleanupStack::PopAndDestroy( data );
       
  1457         }
       
  1458     else if( direction.Compare( _L8("write") ) == 0)
       
  1459         {
       
  1460         if( command.Compare( _L8("ETimeout") ) == 0 )
       
  1461             {
       
  1462             SetThirdPartyValueL( RTerminalControl3rdPartySession::ETimeout, value );
       
  1463             }
       
  1464         else if( command.Compare( _L8("EMaxTimeout") ) == 0 )
       
  1465             {
       
  1466             SetThirdPartyValueL( RTerminalControl3rdPartySession::EMaxTimeout, value );
       
  1467             }
       
  1468         else if( command.Compare( _L8("EPasscode") ) == 0 )
       
  1469             {
       
  1470             SetThirdPartyValueL( RTerminalControl3rdPartySession::EPasscode, value );
       
  1471             }
       
  1472         else if( command.Compare( _L8("EPasscodePolicy") ) == 0 )
       
  1473             {
       
  1474             SetThirdPartyValueL( RTerminalControl3rdPartySession::EPasscodePolicy, value );
       
  1475             }
       
  1476         else if( command.Compare( _L8("ELock") ) == 0 )
       
  1477             {
       
  1478             SetThirdPartyValueL( RTerminalControl3rdPartySession::ELock, value );
       
  1479             }
       
  1480         else if( command.Compare( _L8("EDeviceWipe") ) == 0 )
       
  1481             {
       
  1482             SetThirdPartyValueL( RTerminalControl3rdPartySession::EDeviceWipe, value );
       
  1483             }
       
  1484         }
       
  1485     else
       
  1486         {
       
  1487         User::Leave( KErrArgument );
       
  1488         }
       
  1489 
       
  1490     params->CheckL( cb );
       
  1491 
       
  1492     CleanupStack::PopAndDestroy( cb );
       
  1493 
       
  1494 	return status;
       
  1495     }
       
  1496 
       
  1497 // -----------------------------------------------------------------------------
       
  1498 // CThemesTest::InitDMSessionL
       
  1499 // 
       
  1500 // -----------------------------------------------------------------------------
       
  1501 //
       
  1502 TInt CThemesTest::InitDMSessionL( CStifItemParser& /*aItem*/ )
       
  1503     {
       
  1504     TInt status = KErrNone;
       
  1505 
       
  1506 	RNSmlPrivateAPI privateApi;
       
  1507 				
       
  1508 	privateApi.OpenL();
       
  1509 
       
  1510 	TBuf8<100> buf;
       
  1511 	
       
  1512 	buf.Append( 0x3F);
       
  1513 	buf.Append( 0x4E);
       
  1514 	buf.Append( 0x87);
       
  1515 	buf.Append( 0xBE);
       
  1516 	buf.Append( 0x50);
       
  1517 	buf.Append( 0xCC);
       
  1518 	buf.Append( 0x28);
       
  1519 	buf.Append( 0x5E);
       
  1520 	buf.Append( 0x96);
       
  1521 	buf.Append( 0x87);
       
  1522 	buf.Append( 0x3D);
       
  1523 	buf.Append( 0x29);
       
  1524 	buf.Append( 0x39);
       
  1525 	buf.Append( 0xEB);
       
  1526 	buf.Append( 0x78);
       
  1527 	buf.Append( 0x0B);
       
  1528 	buf.Append( 0x02);
       
  1529 	buf.Append( 0xF8);
       
  1530 	buf.Append( 0x00);
       
  1531 	buf.Append( 0x00);
       
  1532 	buf.Append( 0x00);
       
  1533 	buf.Append( 0x00);
       
  1534 	buf.Append( 0x17);
       
  1535 	buf.Append( 0x06);
       
  1536 	buf.Append( 0x53);
       
  1537 	buf.Append( 0x79);
       
  1538 	buf.Append( 0x6E);
       
  1539 	buf.Append( 0x63);
       
  1540 	buf.Append( 0x34);
       
  1541 	buf.Append( 0x6A);
       
  1542 
       
  1543 	privateApi.SendL( buf, ESmlDevMan, ESmlVersion1_1_2 );
       
  1544 		
       
  1545 	privateApi.Close();
       
  1546 
       
  1547     return status;
       
  1548     }
       
  1549 
       
  1550 
       
  1551 // -----------------------------------------------------------------------------
       
  1552 // CThemesTest::RRRunL
       
  1553 // 
       
  1554 // -----------------------------------------------------------------------------
       
  1555 //
       
  1556 TInt CThemesTest::RRRunL( CStifItemParser& aItem )
       
  1557 	{
       
  1558     // Print to UI
       
  1559     TestModuleIf().Printf( 0, _L("ThemesTest"), _L("RRRunL") );
       
  1560     // Print to log file
       
  1561     iLog->Log(_L("CThemesTest::RRRunL()"));
       
  1562 
       
  1563 //	void DDFVersionL( CBufBase& aVersion );
       
  1564 	TInt ret = KErrNone;
       
  1565 
       
  1566 	CTestParams *params = CTestParams::NewLC( iLog, aItem );
       
  1567 
       
  1568 /*	
       
  1569 URI=
       
  1570 
       
  1571 File=
       
  1572 Text=
       
  1573 
       
  1574 IT= Input (text)
       
  1575 IF= Input File (filename)
       
  1576 OF= Output File
       
  1577 
       
  1578 ET= Expected result (text)
       
  1579 EF= Expected file (filename)
       
  1580 */
       
  1581 
       
  1582 	CleanupStack::PopAndDestroy( params );
       
  1583 
       
  1584 	return ret;
       
  1585 	}
       
  1586 
       
  1587 
       
  1588 
       
  1589 // -----------------------------------------------------------------------------
       
  1590 // CThemesTest::?member_function
       
  1591 // ?implementation_description
       
  1592 // (other items were commented in a header).
       
  1593 // -----------------------------------------------------------------------------
       
  1594 //
       
  1595 /*
       
  1596 TInt CThemesTest::?member_function(
       
  1597    CItemParser& aItem )
       
  1598    {
       
  1599 
       
  1600    ?code
       
  1601 
       
  1602    }
       
  1603 */
       
  1604 
       
  1605 #endif
       
  1606 void CThemesTest::AddParamsL( CTestParams* aParams )
       
  1607 	{
       
  1608 	CleanupStack::PushL( aParams );
       
  1609 	User::LeaveIfError( iParams.Append( aParams ) );
       
  1610 	CleanupStack::Pop( aParams );
       
  1611 	}
       
  1612 
       
  1613 void CThemesTest::AddDDFParamsL( CDDFTestParams* aDDFParams )
       
  1614 	{
       
  1615 	CleanupStack::PushL( aDDFParams );
       
  1616 	User::LeaveIfError( iDDFParams.Append( aDDFParams ) );
       
  1617 	CleanupStack::Pop( aDDFParams );
       
  1618 	}
       
  1619 
       
  1620 TInt CThemesTest::CheckAllL( )
       
  1621 	{
       
  1622 	TInt ret = KErrNone;
       
  1623 	
       
  1624 	for (TInt i = 0 ; i < iParams.Count() ; i++)
       
  1625 		{
       
  1626 		TInt result = iParams[i]->CheckL( iCallback );
       
  1627 		if (result != KErrNone && ret == KErrNone)
       
  1628 			{
       
  1629 			ret = result;
       
  1630 			}
       
  1631 		}
       
  1632 
       
  1633 	return ret;
       
  1634 	}
       
  1635 
       
  1636 TInt CThemesTest::CheckDDFL( CTestDmDDFObject* aDDFRoot )
       
  1637 	{
       
  1638 	TInt ret = KErrNone;
       
  1639 	TInt result = 0;
       
  1640 
       
  1641 	if ( iDDFParams.Count() > 0 )
       
  1642 		{
       
  1643 		}
       
  1644 
       
  1645 	TInt i;
       
  1646 	for ( i = 0 ; i < iDDFParams.Count() ; i++ )
       
  1647 		{
       
  1648 		result = iDDFParams[i]->CheckL( aDDFRoot );
       
  1649 		if ( result != KErrNone && ret == KErrNone )
       
  1650 			{
       
  1651 			ret = result;
       
  1652 			}
       
  1653 		}
       
  1654 
       
  1655 	if ( i > 0 )
       
  1656 		{
       
  1657 		TInt count = aDDFRoot->SubObjectsCount();
       
  1658 		if (count != i)
       
  1659 			{
       
  1660 			iLog->Log( _L8("Error: CheckDDFL(): DDF count mismatch: expected=%d real=%d"), iDDFParams.Count(), count );
       
  1661 			if (ret == KErrNone)
       
  1662 				{
       
  1663 				ret = KErrGeneral;
       
  1664 				}
       
  1665 			}
       
  1666 		}
       
  1667 
       
  1668 	return ret;
       
  1669 	}
       
  1670 
       
  1671 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
  1672 // None
       
  1673 
       
  1674 //  End of File