idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp
changeset 2 08c6ee43b396
parent 1 5315654608de
child 4 4d54b72983ae
equal deleted inserted replaced
1:5315654608de 2:08c6ee43b396
    54 #include "xnviewmanager.h"
    54 #include "xnviewmanager.h"
    55 #include "xnplugindata.h"
    55 #include "xnplugindata.h"
    56 #include "xnrootdata.h"
    56 #include "xnrootdata.h"
    57 #include "xnviewdata.h"
    57 #include "xnviewdata.h"
    58 #include "xnwallpaperview.h"
    58 #include "xnwallpaperview.h"
       
    59 #include "xnbackgroundmanager.h"
    59 
    60 
    60 #include "xneditor.h"
    61 #include "xneditor.h"
    61 #include "xnpanic.h"
    62 #include "xnpanic.h"
    62 
    63 
    63 using namespace hspswrapper;
    64 using namespace hspswrapper;
   171     {
   172     {
   172     CXnDomNode* node( aNode.DomNode() );
   173     CXnDomNode* node( aNode.DomNode() );
   173     
   174     
   174     if ( node )
   175     if ( node )
   175         {
   176         {
   176         CXnDomStringPool& sp( node->StringPool() );
   177         CXnDomStringPool* sp( node->StringPool() );
   177 
   178 
   178         // create new property
   179         // create new property
   179         CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp );
   180         CXnDomPropertyValue* value = CXnDomPropertyValue::NewL( sp );
   180         CleanupStack::PushL( value );
   181         CleanupStack::PushL( value );
   181 
   182 
   182         value->SetStringValueL( CXnDomPropertyValue::EString, aValue );
   183         value->SetStringValueL( CXnDomPropertyValue::EString, aValue );
   183 
   184 
   184         CXnProperty* prop = CXnProperty::NewL( aAttribute, value, sp );
   185         CXnProperty* prop = CXnProperty::NewL( aAttribute, value, *sp );
   185                     
   186                     
   186         CleanupStack::Pop( value );
   187         CleanupStack::Pop( value );
   187         CleanupStack::PushL( prop );
   188         CleanupStack::PushL( prop );
   188 
   189 
   189         aNode.SetPropertyL( prop );
   190         aNode.SetPropertyL( prop );
   309 void CXnEditor::ConstructL( const TDesC8& aUid )
   310 void CXnEditor::ConstructL( const TDesC8& aUid )
   310     {
   311     {
   311     iCpsWrapper = CCpsWrapper::NewL( *this );
   312     iCpsWrapper = CCpsWrapper::NewL( *this );
   312     iHspsWrapper = CHspsWrapper::NewL( aUid, this );
   313     iHspsWrapper = CHspsWrapper::NewL( aUid, this );
   313     iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) );
   314     iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) );
       
   315     iBgManager = CXnBackgroundManager::NewL( iViewManager, *iHspsWrapper );
   314     }
   316     }
   315 
   317 
   316 // ---------------------------------------------------------------------------
   318 // ---------------------------------------------------------------------------
   317 // CXnEditor::~CXnEditor
   319 // CXnEditor::~CXnEditor
   318 // ---------------------------------------------------------------------------
   320 // ---------------------------------------------------------------------------
   323     
   325     
   324     delete iCpsWrapper;
   326     delete iCpsWrapper;
   325     delete iHspsWrapper;
   327     delete iHspsWrapper;
   326     delete iPublisherMap;
   328     delete iPublisherMap;
   327     delete iRepository;
   329     delete iRepository;
       
   330     delete iBgManager;
   328     }
   331     }
   329 
   332 
   330 // -----------------------------------------------------------------------------
   333 // -----------------------------------------------------------------------------
   331 // CXnEditor::IsCurrentViewFull
   334 // CXnEditor::IsCurrentViewFull
   332 // -----------------------------------------------------------------------------
   335 // -----------------------------------------------------------------------------
  1584     {
  1587     {
  1585     return *iHspsWrapper;
  1588     return *iHspsWrapper;
  1586     }
  1589     }
  1587 
  1590 
  1588 // -----------------------------------------------------------------------------
  1591 // -----------------------------------------------------------------------------
       
  1592 // CXnEditor::BgManager
       
  1593 // -----------------------------------------------------------------------------
       
  1594 //
       
  1595 CXnBackgroundManager& CXnEditor::BgManager() const
       
  1596     {
       
  1597     return *iBgManager;
       
  1598     }
       
  1599 
       
  1600 // -----------------------------------------------------------------------------
  1589 // from MHsContentController
  1601 // from MHsContentController
  1590 // -----------------------------------------------------------------------------
  1602 // -----------------------------------------------------------------------------
  1591 //
  1603 //
  1592 TInt CXnEditor::WidgetListL( CHsContentInfoArray& aArray )
  1604 TInt CXnEditor::WidgetListL( CHsContentInfoArray& aArray )
  1593     {
  1605     {
  1786         }
  1798         }
  1787     
  1799     
  1788     return iViewManager.ActivateAppL( aInfo.Uid() );     
  1800     return iViewManager.ActivateAppL( aInfo.Uid() );     
  1789     }
  1801     }
  1790 
  1802 
       
  1803 // -----------------------------------------------------------------------------
       
  1804 // from MHsContentController
       
  1805 // -----------------------------------------------------------------------------
       
  1806 //
       
  1807 TInt CXnEditor::ActiveViewL( CHsContentInfo& aInfo )
       
  1808     {
       
  1809 
       
  1810     TInt err( KErrNone );
       
  1811     
       
  1812     // Get active application configuration
       
  1813     CHspsConfiguration* app( iHspsWrapper->GetAppConfigurationL() );
       
  1814     CleanupStack::PushL( app );
       
  1815 
       
  1816     // Get list of views included in active application configuration
       
  1817     RPointerArray< CPluginMap >& plugins( app->PluginMaps() );
       
  1818     CPluginMap* plugin( NULL );
       
  1819     
       
  1820     // Find active view
       
  1821     for ( TInt i = 0; i < plugins.Count() && !plugin; i++ )
       
  1822         {
       
  1823         if ( plugins[ i ]->ActivationState() )
       
  1824             {
       
  1825             plugin = plugins[ i ];
       
  1826             }
       
  1827         }
       
  1828     
       
  1829     if ( plugin )
       
  1830         {
       
  1831         CHspsConfiguration* view( iHspsWrapper->GetPluginConfigurationL( plugin->PluginId() ) );
       
  1832         CleanupStack::PushL( view );
       
  1833         
       
  1834         aInfo.SetNameL( view->PluginInfo().Name() );
       
  1835         aInfo.SetUidL( view->PluginInfo().Uid() );
       
  1836         aInfo.SetTypeL( view->PluginInfo().Type() );
       
  1837         aInfo.SetDescriptionL( view->PluginInfo().Description() );
       
  1838         aInfo.SetIconPathL( view->PluginInfo().LogoIcon() );
       
  1839         
       
  1840         CleanupStack::PopAndDestroy( view );
       
  1841         }
       
  1842     else
       
  1843         {
       
  1844         err = KErrNotFound;
       
  1845         }
       
  1846     
       
  1847     CleanupStack::PopAndDestroy( app );
       
  1848     return err;     
       
  1849     }
       
  1850 
       
  1851 // -----------------------------------------------------------------------------
       
  1852 // from MHsContentController
       
  1853 // -----------------------------------------------------------------------------
       
  1854 //
       
  1855 TInt CXnEditor::ActiveAppL( CHsContentInfo& aInfo )
       
  1856     {
       
  1857 
       
  1858     TInt err( KErrNone );
       
  1859     CHspsConfiguration* app = iHspsWrapper->GetAppConfigurationL();
       
  1860     CleanupStack::PushL( app );
       
  1861 
       
  1862     if ( app->PluginInfo().Uid().Length() > 0 )
       
  1863         {
       
  1864         aInfo.SetNameL( app->PluginInfo().Name() );
       
  1865         aInfo.SetUidL( app->PluginInfo().Uid() );
       
  1866         aInfo.SetTypeL( app->PluginInfo().Type() );
       
  1867         aInfo.SetDescriptionL( app->PluginInfo().Description() );
       
  1868         aInfo.SetIconPathL( app->PluginInfo().LogoIcon() );
       
  1869         }
       
  1870     else
       
  1871         {
       
  1872         err = KErrNotFound;
       
  1873         }
       
  1874     
       
  1875     CleanupStack::PopAndDestroy( app );
       
  1876     return err;     
       
  1877     }
       
  1878 
  1791 // End of file
  1879 // End of file