idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp
changeset 2 08c6ee43b396
parent 0 f72a12da539e
child 5 c743ef5928ba
equal deleted inserted replaced
1:5315654608de 2:08c6ee43b396
   368         if ( attribute->NameStringPoolIndex() == KErrNotFound )
   368         if ( attribute->NameStringPoolIndex() == KErrNotFound )
   369             {
   369             {
   370             continue;
   370             continue;
   371             }
   371             }
   372          CXnDomProperty* clone =
   372          CXnDomProperty* clone =
   373             CXnDomProperty::NewL( attribute->NameStringPoolIndex(), aStringPool );
   373             CXnDomProperty::NewL( attribute->NameStringPoolIndex(), &aStringPool );
   374         CleanupStack::PushL( clone );
   374         CleanupStack::PushL( clone );
   375         CXnDomPropertyValue* propertyValue =
   375         CXnDomPropertyValue* propertyValue =
   376             CXnDomPropertyValue::NewL( aStringPool );
   376             CXnDomPropertyValue::NewL( &aStringPool );
   377         CleanupStack::PushL( propertyValue );
   377         CleanupStack::PushL( propertyValue );
   378         propertyValue->SetStringPoolIndexL(
   378         propertyValue->SetStringPoolIndexL(
   379             CXnDomPropertyValue::EString, attribute->ValueStringPoolIndex() );
   379             CXnDomPropertyValue::EString, attribute->ValueStringPoolIndex() );
   380         CXnDomList& propertyList = clone->PropertyValueList();
   380         CXnDomList& propertyList = clone->PropertyValueList();
   381         propertyList.AddItemL( propertyValue );
   381         propertyList.AddItemL( propertyValue );
   624 //
   624 //
   625 void CXnODTParser::LoadRootL( CXnRootData& aRootData, TUid /*aAppUid*/ )        
   625 void CXnODTParser::LoadRootL( CXnRootData& aRootData, TUid /*aAppUid*/ )        
   626     {    
   626     {    
   627     CXnDomNode* root( aRootData.Owner() );
   627     CXnDomNode* root( aRootData.Owner() );
   628     
   628     
   629     CXnDomStringPool& sp( root->StringPool() );
   629     CXnDomStringPool* sp( root->StringPool() );
   630     
   630     
   631     CXnAppUiAdapter& appui( iManager.AppUiAdapter() );
   631     CXnAppUiAdapter& appui( iManager.AppUiAdapter() );
   632     
   632     
   633     // Build root
   633     // Build root
   634     CXnNode* node( BuildRootNodeL( iUiEngine ) );
   634     CXnNode* node( BuildRootNodeL( iUiEngine ) );
   636     // Let root nodes to know each other
   636     // Let root nodes to know each other
   637     CXnDomNode* dom( aRootData.ODT()->DomDocument().RootNode() );    
   637     CXnDomNode* dom( aRootData.ODT()->DomDocument().RootNode() );    
   638     dom->SetLayoutNode( node );
   638     dom->SetLayoutNode( node );
   639     node->SetDomNode( dom );
   639     node->SetDomNode( dom );
   640         
   640         
   641     CreateNodesL( root, sp, aRootData );
   641     CreateNodesL( root, *sp, aRootData );
   642 
   642 
   643     // root doesn't have any controls   
   643     // root doesn't have any controls   
   644     
   644     
   645     aRootData.SetOccupied();
   645     aRootData.SetOccupied();
   646     }
   646     }
   652 void CXnODTParser::LoadViewL( CXnViewData& aViewData )
   652 void CXnODTParser::LoadViewL( CXnViewData& aViewData )
   653     {    
   653     {    
   654     // <view> element
   654     // <view> element
   655     CXnDomNode* view( aViewData.Node() );
   655     CXnDomNode* view( aViewData.Node() );
   656     
   656     
   657     CXnDomStringPool& sp( view->StringPool() );
   657     CXnDomStringPool* sp( view->StringPool() );
   658 
   658 
   659     // from <view> element
   659     // from <view> element
   660     CreateNodesL( view, sp, aViewData );       
   660     CreateNodesL( view, *sp, aViewData );       
   661     CreateControlsL( view, aViewData );
   661     CreateControlsL( view, aViewData );
   662 
   662 
   663     // By default make controls invisible
   663     // By default make controls invisible
   664     CXnControlAdapter* adapter( view->LayoutNode()->Control() );
   664     CXnControlAdapter* adapter( view->LayoutNode()->Control() );
   665     
   665     
   711         }
   711         }
   712     
   712     
   713     // <widget> element
   713     // <widget> element
   714     CXnDomNode* widget( aPluginData.Node() );
   714     CXnDomNode* widget( aPluginData.Node() );
   715     
   715     
   716     CXnDomStringPool& sp( widget->StringPool() );
   716     CXnDomStringPool* sp( widget->StringPool() );
   717 
   717 
   718     // from <widget> element 
   718     // from <widget> element 
   719     CreateNodesL( widget, sp, aPluginData );           
   719     CreateNodesL( widget, *sp, aPluginData );           
   720     CreateControlsL( widget, aPluginData );    
   720     CreateControlsL( widget, aPluginData );    
   721 
   721 
   722     HandleWidgetBackgroundL( widget->LayoutNode() );
   722     HandleWidgetBackgroundL( widget->LayoutNode() );
   723 
   723 
   724     // By default make controls invisible
   724     // By default make controls invisible
  1218                 break;
  1218                 break;
  1219                 }
  1219                 }
  1220             }
  1220             }
  1221         }
  1221         }
  1222 
  1222 
       
  1223     __ASSERT_DEBUG( parentAdapter, User::Leave( KErrGeneral ) );
       
  1224     
  1223     CXnControlAdapter* adapter( NULL );
  1225     CXnControlAdapter* adapter( NULL );
  1224     
  1226     
  1225     if( aName == KStylusPopupNodeName )
  1227     if( aName == KStylusPopupNodeName )
  1226         {
  1228         {
  1227         adapter = CXnPopupControlAdapter::NewL( aNode.PluginIfL() );
  1229         adapter = CXnPopupControlAdapter::NewL( aNode.PluginIfL() );
  1234         CleanupStack::PushL( adapter );        
  1236         CleanupStack::PushL( adapter );        
  1235         CXnProperty* prop = CXnProperty::NewL( 
  1237         CXnProperty* prop = CXnProperty::NewL( 
  1236             XnPropertyNames::style::common::KPosition,
  1238             XnPropertyNames::style::common::KPosition,
  1237             XnPropertyNames::style::common::position::KFloating,
  1239             XnPropertyNames::style::common::position::KFloating,
  1238             CXnDomPropertyValue::EString, 
  1240             CXnDomPropertyValue::EString, 
  1239             aNode.UiEngine()->ODT()->DomDocument().StringPool() );
  1241             *aNode.UiEngine()->ODT()->DomDocument().StringPool() );
  1240         CleanupStack::PushL( prop );
  1242         CleanupStack::PushL( prop );
  1241         aNode.SetPropertyL( prop );                    
  1243         aNode.SetPropertyL( prop );                    
  1242         CleanupStack::Pop( prop );                                                        
  1244         CleanupStack::Pop( prop );                                                        
  1243         }
  1245         }
  1244     else if( aName == KScrollableBoxNodeName )
  1246     else if( aName == KScrollableBoxNodeName )
  1302             CleanupStack::PushL( value );
  1304             CleanupStack::PushL( value );
  1303             value->SetStringValueL( CXnDomPropertyValue::EString, KWidgetBgSkinId );
  1305             value->SetStringValueL( CXnDomPropertyValue::EString, KWidgetBgSkinId );
  1304         
  1306         
  1305             CXnProperty* bgColor = CXnProperty::NewL(
  1307             CXnProperty* bgColor = CXnProperty::NewL(
  1306                 XnPropertyNames::appearance::common::KBackGroundColor,
  1308                 XnPropertyNames::appearance::common::KBackGroundColor,
  1307                 value, uiengine->ODT()->DomDocument().StringPool() );
  1309                 value, *uiengine->ODT()->DomDocument().StringPool() );
  1308         
  1310         
  1309             CleanupStack::Pop( value );
  1311             CleanupStack::Pop( value );
  1310             CleanupStack::PushL( bgColor );
  1312             CleanupStack::PushL( bgColor );
  1311             aWidgetNode->SetPropertyL( bgColor );
  1313             aWidgetNode->SetPropertyL( bgColor );
  1312             CleanupStack::Pop( bgColor );
  1314             CleanupStack::Pop( bgColor );