idlehomescreen/xmluicontroller/src/contentrenderer.cpp
branchRCL_3
changeset 17 b8fae6b8a148
parent 9 f966699dea19
child 26 1b758917cafc
equal deleted inserted replaced
12:9674c1a575e9 17:b8fae6b8a148
   266             
   266             
   267             for ( TInt j = i; j < aArray.Count(); ++j )
   267             for ( TInt j = i; j < aArray.Count(); ++j )
   268                 {
   268                 {
   269                 HBufC* id2( PropertyValueL( aArray[j].Target(), 
   269                 HBufC* id2( PropertyValueL( aArray[j].Target(), 
   270                    AiUiDef::xml::property::KId ) );
   270                    AiUiDef::xml::property::KId ) );
       
   271                 CleanupStack::PushL( id2 );
   271                 
   272                 
   272                 if ( id2 )
   273                 if ( id2 )
   273                     {
   274                     {
   274                     CleanupStack::PushL( id2 );
       
   275                 
       
   276                     // Same id and same policy
   275                     // Same id and same policy
   277                     if ( i != j && id->Compare( *id2 ) == 0 &&                          
   276                     if ( i != j && id->Compare( *id2 ) == 0 &&                          
   278                      ( aArray[i].Policy().Compare( aArray[j].Policy()) == 0 ) ) 
   277                      ( aArray[i].Policy().Compare( aArray[j].Policy()) == 0 ) ) 
   279                             
   278                             
   280                         {
   279                         {
   569 TBool CContentRenderer::CanPublish( CHsContentPublisher& aPlugin,
   568 TBool CContentRenderer::CanPublish( CHsContentPublisher& aPlugin,
   570     TInt aContent, TInt aIndex )                                   
   569     TInt aContent, TInt aIndex )                                   
   571     {
   570     {
   572     TInt error( KErrNone );
   571     TInt error( KErrNone );
   573     TInt retval( KErrNone );
   572     TInt retval( KErrNone );
   574     
   573         
   575     __PRINTS("*** UC: Init - Content Validation ***");
   574     __PRINTS("*** XML UI: CContentRenderer::CanPublish ***");
       
   575     
       
   576     __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ),          
       
   577         &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); 
       
   578                                   
   576 	__TIME("UC: Content Validation",
   579 	__TIME("UC: Content Validation",
   577         TRAP( error, retval = CanPublishL( aPlugin, aContent, aIndex ) );
   580         TRAP( error, retval = CanPublishL( aPlugin, aContent, aIndex ) ) );
   578         );
   581             
   579     __HEAP("UC: Content Validation");
   582 	__HEAP("UC: Content Validation");
   580     __PRINTS("*** UC: Done - Content Validation ***");
   583     
   581 
   584 	TBool ret( error == KErrNone && retval == KErrNone );
   582     return ( error == KErrNone && retval == KErrNone );
   585 	
       
   586 	__PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::CanPublish - done, CanPublish: %d ***"), ret );
       
   587     
       
   588     return ret;
   583     }
   589     }
   584 
   590 
   585 // ----------------------------------------------------------------------------
   591 // ----------------------------------------------------------------------------
   586 // CContentRenderer::Publish
   592 // CContentRenderer::Publish
   587 // 
   593 // 
   591     TInt aResource, TInt aIndex )
   597     TInt aResource, TInt aIndex )
   592     {
   598     {
   593 	TInt error( KErrNone );
   599 	TInt error( KErrNone );
   594 	TInt retval( KErrNone );
   600 	TInt retval( KErrNone );
   595 	
   601 	
   596 	__PRINTS("*** UC: Init - Content Publishing (Resource) ***");
   602 	__PRINTS("*** XML UI: CContentRenderer::Publish (Resource) ***");
       
   603 	
       
   604     __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ),          
       
   605         &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); 
       
   606 		
   597 	__TIME("UC: Content Publishing (Resource)",
   607 	__TIME("UC: Content Publishing (Resource)",
   598     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aResource, aIndex ) );
   608     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aResource, aIndex ) ) );
   599     );
   609     
   600     __HEAP("UC: Content Publishing (Resource)");
   610     __HEAP("UC: Content Publishing (Resource)");
   601     __PRINTS("*** UC: Done - Content Publishing (Resource) ***");
   611     
   602 
       
   603     if( !error && retval )
   612     if( !error && retval )
   604         {
   613         {
   605         error = retval;
   614         error = retval;
   606         }
   615         }
   607     
   616     
       
   617     __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Resource) - done, error: %d ***"), error );
       
   618             
   608     return error;
   619     return error;
   609     }
   620     }
   610 
   621 
   611 // ----------------------------------------------------------------------------
   622 // ----------------------------------------------------------------------------
   612 // CContentRenderer::Publish
   623 // CContentRenderer::Publish
   617     const TDesC16& aText, TInt aIndex )
   628     const TDesC16& aText, TInt aIndex )
   618     {
   629     {
   619     TInt error( KErrNone );
   630     TInt error( KErrNone );
   620     TInt retval( KErrNone );
   631     TInt retval( KErrNone );
   621     
   632     
   622     __PRINTS("*** UC: Init - Content Publishing (Value-Text) ***");
   633     __PRINTS("*** XML UI: CContentRenderer::Publish (Value-Text) ***");
       
   634     
       
   635     __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ),          
       
   636         &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); 
       
   637     
   623    	__TIME("UC: Content Publishing (Value-Text)",
   638    	__TIME("UC: Content Publishing (Value-Text)",
   624     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aText, aIndex ) );
   639     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aText, aIndex ) ) );
   625     );
   640        	
   626     __HEAP("UC: Content Publishing (Value-Text)");
   641     __HEAP("UC: Content Publishing (Value-Text)");
   627     __PRINTS("*** UC: Done - Content Publishing (Value-Text) ***");
   642         
   628 
       
   629     if( !error && retval )
   643     if( !error && retval )
   630         {
   644         {
   631         error = retval;
   645         error = retval;
   632         }
   646         }
   633 
   647 
       
   648     __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Value-Text) - done, error: %d ***"), error );
       
   649     
   634     return error;
   650     return error;
   635     }
   651     }
   636 
   652 
   637 // ----------------------------------------------------------------------------
   653 // ----------------------------------------------------------------------------
   638 // CContentRenderer::Publish
   654 // CContentRenderer::Publish
   643     const TDesC8& aBuf, TInt aIndex )
   659     const TDesC8& aBuf, TInt aIndex )
   644     {
   660     {
   645     TInt error( KErrNone );
   661     TInt error( KErrNone );
   646     TInt retval( KErrNone );
   662     TInt retval( KErrNone );
   647     
   663     
   648     __PRINTS("*** UC: Init - Content Publishing (Value-Buf) ***");
   664     __PRINTS("*** XML UI: CContentRenderer::Publish (Value-Buf) ***");
       
   665     
       
   666     __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ),          
       
   667         &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); 
       
   668     
   649     __TIME("UC: Content Publishing (Value-Buf)",
   669     __TIME("UC: Content Publishing (Value-Buf)",
   650     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aBuf, aIndex ) );
   670     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aBuf, aIndex ) ) );
   651     )
   671     
   652     __HEAP("UC: Content Publishing (Value-Buf)");
   672     __HEAP("UC: Content Publishing (Value-Buf)");
   653     __PRINTS("*** UC: Done - Content Publishing (Value-Buf) ***");
   673        
   654 
       
   655     if( !error && retval )
   674     if( !error && retval )
   656         {
   675         {
   657         error = retval;
   676         error = retval;
   658         }
   677         }
       
   678     
       
   679     __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Value-Buf) - done, error: %d ***"), error );
   659     
   680     
   660     return error;
   681     return error;
   661     }
   682     }
   662 
   683 
   663 // ----------------------------------------------------------------------------
   684 // ----------------------------------------------------------------------------
   669     RFile& aFile, TInt aIndex )                                
   690     RFile& aFile, TInt aIndex )                                
   670     {
   691     {
   671     TInt error( KErrNone );
   692     TInt error( KErrNone );
   672     TInt retval( KErrNone );
   693     TInt retval( KErrNone );
   673     	
   694     	
   674 	__PRINTS("*** UC: Init - Content Publishing (Value-RFile) ***");
   695 	__PRINTS("*** XML UI: CContentRenderer::Publish (Value-RFile) ***");
       
   696 	
       
   697     __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ),          
       
   698         &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); 
       
   699 	
   675     __TIME("UC: Content Publishing (Value-RFile)",
   700     __TIME("UC: Content Publishing (Value-RFile)",
   676     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aFile, aIndex ) );
   701     	TRAP( error, retval = DoPublishL( aPlugin, aContent, aFile, aIndex ) ) );
   677     );
   702 
   678     __HEAP("UC: Content Publishing (Value-RFile)");
   703     __HEAP("UC: Content Publishing (Value-RFile)");
   679     __PRINTS("*** UC: Done - Content Publishing (Value-RFile) ***");
   704         
   680 
       
   681     if( !error && retval )
   705     if( !error && retval )
   682         {
   706         {
   683         error = retval;
   707         error = retval;
   684         }
   708         }
       
   709     
       
   710     __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Publish (Value-RFile) - done, error: %d ***"), error );
   685     
   711     
   686     return error;
   712     return error;
   687     }
   713     }
   688 
   714 
   689 // ----------------------------------------------------------------------------
   715 // ----------------------------------------------------------------------------
   695     TInt aIndex )
   721     TInt aIndex )
   696     {
   722     {
   697     TInt error( KErrNone );
   723     TInt error( KErrNone );
   698     TInt retval( KErrNone );
   724     TInt retval( KErrNone );
   699             
   725             
   700     __PRINTS("*** UC: Init - Content Publishing (Clean) ***");
   726     __PRINTS("*** XML UI: CContentRenderer::Clean (Clean) ***");
       
   727     
       
   728     __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x" ),          
       
   729         &aPlugin.PublisherInfo().Name(), aPlugin.PublisherInfo().Uid().iUid ); 
       
   730         
   701     __TIME("UC: Content Publishing (Clean)",
   731     __TIME("UC: Content Publishing (Clean)",
   702     	TRAP( error, retval = DoCleanL( aPlugin, aContent, aIndex ) );
   732     	TRAP( error, retval = DoCleanL( aPlugin, aContent, aIndex ) ) );
   703     );
   733     
   704     __HEAP("UC: Content Publishing (Clean)");
   734     __HEAP("UC: Content Publishing (Clean)");
   705     __PRINTS("*** UC: Done - Content Publishing (Clean) ***");
   735        
   706 
       
   707     if( !error && retval )
   736     if( !error && retval )
   708         {
   737         {
   709         error = retval;
   738         error = retval;
   710         }
   739         }
       
   740     
       
   741     __PRINT( __DBG_FORMAT("*** XML UI: CContentRenderer::Clean (Clean) - done, error: %d ***"), error );
   711     
   742     
   712     return error;
   743     return error;
   713     }
   744     }
   714 
   745 
   715 // ----------------------------------------------------------------------------
   746 // ----------------------------------------------------------------------------
  1273 void CContentRenderer::ProcessTransactionElementL( 
  1304 void CContentRenderer::ProcessTransactionElementL( 
  1274     MTransactionElement* aElement )
  1305     MTransactionElement* aElement )
  1275     {
  1306     {
  1276     LeaveIfNull( aElement, KErrArgument );
  1307     LeaveIfNull( aElement, KErrArgument );
  1277     
  1308     
       
  1309     __PRINTS("*** XML UI: CContentRenderer::ProcessTransactionElementL ***");
       
  1310     
  1278     if ( IsImmediateMode() || iStack->IsEmpty() )
  1311     if ( IsImmediateMode() || iStack->IsEmpty() )
  1279         {
  1312         {      
       
  1313         __PRINTS("* Immediate transaction mode, or transaction stack is empty" );
       
  1314         
  1280         // No transaction. Commit element immediately
  1315         // No transaction. Commit element immediately
  1281         TBool layoutChanged( EFalse );
  1316         TBool layoutChanged( EFalse );
  1282         
  1317         
  1283         RPropertyHashMap propertyHashMap;
  1318         RPropertyHashMap propertyHashMap;
  1284         CleanupClosePushL( propertyHashMap );
  1319         CleanupClosePushL( propertyHashMap );
  1295         iAppUi.UiEngineL()->RenderUIL();
  1330         iAppUi.UiEngineL()->RenderUIL();
  1296         }
  1331         }
  1297     else
  1332     else
  1298         {
  1333         {
  1299         // Append transaction element to transaction
  1334         // Append transaction element to transaction
       
  1335         __PRINTS("* Adding transaction element to stack");
       
  1336         
  1300         MTransaction* tr( iStack->Top() );
  1337         MTransaction* tr( iStack->Top() );
  1301         tr->Append( *aElement );
  1338         tr->Append( *aElement );
  1302         }
  1339         }
       
  1340     
       
  1341     __PRINTS("*** XML UI: CContentRenderer::ProcessTransactionElementL - done ***");
  1303     }
  1342     }
  1304 
  1343 
  1305 // ----------------------------------------------------------------------------
  1344 // ----------------------------------------------------------------------------
  1306 // CContentRenderer::FindNodeByClassL
  1345 // CContentRenderer::FindNodeByClassL
  1307 // 
  1346 //