idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp
branchRCL_3
changeset 12 9674c1a575e9
parent 11 ff572dfe6d86
child 17 b8fae6b8a148
equal deleted inserted replaced
11:ff572dfe6d86 12:9674c1a575e9
    32 #include "xnpanic.h"
    32 #include "xnpanic.h"
    33 
    33 
    34 #include "debug.h"
    34 #include "debug.h"
    35 
    35 
    36 // Constants
    36 // Constants
       
    37 const TInt KLoadDelay( 100000 );
    37 const TInt KInterval( 10000 );
    38 const TInt KInterval( 10000 );
    38 
    39 
    39 // ============================ LOCAL FUNCTIONS ================================
    40 // ============================ LOCAL FUNCTIONS ================================
    40 
    41 
    41 // ============================ MEMBER FUNCTIONS ===============================
    42 // ============================ MEMBER FUNCTIONS ===============================
   109         {
   110         {
   110         return;
   111         return;
   111         }
   112         }
   112        
   113        
   113     if ( aActive )
   114     if ( aActive )
   114         {     
   115         {
       
   116         iFlags.Set( EIsActive );
   115         iFlags.Clear( EIsInitial );
   117         iFlags.Clear( EIsInitial );
   116 
   118         
   117         iFlags.Set( EIsActive );
   119         LoadPublishers();                             
   118 
       
   119         LoadPublishers();       
       
   120         }
   120         }
   121     else
   121     else
   122         {                              
   122         {                              
   123         DestroyPublishers( EAiFwPageShutdown );
   123         DestroyPublishers( EAiFwPageShutdown );
   124 
   124 
   215 // Finds plugin or view data based on node
   215 // Finds plugin or view data based on node
   216 // -----------------------------------------------------------------------------
   216 // -----------------------------------------------------------------------------
   217 //
   217 //
   218 CXnPluginData* CXnViewData::Plugin( CXnNode* aNode )
   218 CXnPluginData* CXnViewData::Plugin( CXnNode* aNode )
   219     {
   219     {
   220     if ( !aNode ) { return NULL; }
   220     if ( !aNode ) 
   221 
   221         { 
       
   222         return NULL; 
       
   223         }
       
   224 
       
   225     CXnDomNode* view( Node() );
       
   226     
   222     if ( aNode->ViewNodeImpl() )
   227     if ( aNode->ViewNodeImpl() )
   223         {
   228         {
   224         // Reached view, return self
   229         // Reached view, return self
   225         if ( Node()->LayoutNode() == aNode )
   230         if ( view && view->LayoutNode() == aNode )
   226             {
   231             {
   227             return this;
   232             return this;
   228             }
   233             }
   229         }
   234         }
   230 
   235 
   231     for ( TInt i = 0; i < iPluginsData.Count(); i++ )
   236     for ( TInt i = 0; i < iPluginsData.Count(); i++ )
   232         {
   237         {
   233         if ( iPluginsData[i]->Owner()->LayoutNode() == aNode )
   238         CXnDomNode* plugin( iPluginsData[i]->Owner() );
       
   239         
       
   240         if ( plugin && plugin->LayoutNode() == aNode )
   234             {
   241             {
   235             return iPluginsData[i];
   242             return iPluginsData[i];
   236             }
   243             }
   237         }
   244         }
   238 
   245 
   464     
   471     
   465     iLoader->Cancel();
   472     iLoader->Cancel();
   466     
   473     
   467     iLoadIndex = 0;
   474     iLoadIndex = 0;
   468                                 
   475                                 
   469     iLoader->Start( TTimeIntervalMicroSeconds32( KInterval ),
   476     iLoader->Start( TTimeIntervalMicroSeconds32( KLoadDelay ),
   470                     TTimeIntervalMicroSeconds32( KInterval ),
   477                     TTimeIntervalMicroSeconds32( KInterval ),
   471                     TCallBack( DoLoadPublishersL, this ) );           
   478                     TCallBack( DoLoadPublishersL, this ) );           
   472     }
   479     }
   473 
   480 
   474 // -----------------------------------------------------------------------------
   481 // -----------------------------------------------------------------------------
   503         self->iLoadIndex++;
   510         self->iLoadIndex++;
   504         
   511         
   505         TInt reason( plugin->VirginPublishers() ? 
   512         TInt reason( plugin->VirginPublishers() ? 
   506             EAiFwSystemStartup : EAiFwPageStartup );         
   513             EAiFwSystemStartup : EAiFwPageStartup );         
   507         
   514         
   508         if( plugin->LoadPublishers( reason ) != KErrNone )
   515         TInt ret( plugin->LoadPublishers( reason ) );
       
   516         
       
   517         if ( ret == KErrAlreadyExists )
       
   518             {
       
   519             ret = KErrNone;
       
   520             }
       
   521         
       
   522         if( ret != KErrNone )
   509             {
   523             {
   510             self->iManager.UnloadWidgetFromPluginL( *plugin, ETrue );
   524             self->iManager.UnloadWidgetFromPluginL( *plugin, ETrue );
   511             
   525             
   512             self->iShowContentRemoved = ETrue;
   526             self->iShowContentRemoved = ETrue;
   513             }
   527             }