menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp
changeset 4 4d54b72983ae
parent 0 f72a12da539e
--- a/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp	Fri Jan 22 09:35:14 2010 +0200
+++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdmenuitem.cpp	Tue Jan 26 11:48:23 2010 +0200
@@ -32,6 +32,17 @@
 // 
 // ---------------------------------------------------------------------------
 //
+TBool CHnMdMenuItem::IsMenuItemElementName( const TDesC8& aNameToCompare )    
+    {
+    return !aNameToCompare.Compare( KMenuItemElementName8 )
+        || !aNameToCompare.Compare( KMenuItemSpecificElementName8 )
+        || !aNameToCompare.Compare( KMenuItemActionElementName8 );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
 void CHnMdMenuItem::AppendChildItemL( CHnMdMenuItem* aMenuItem )
     {
     iChildren.AppendL( aMenuItem );
@@ -56,7 +67,7 @@
       }
     aMenuModel->SetCommand( iEvent );
     aMenuModel->SetPosition( iPosition );
-    aMenuModel->SetItemSpecific( iSpecific );
+    aMenuModel->SetMenuItemType( iType );
     }
 
 // ---------------------------------------------------------------------------
@@ -67,7 +78,15 @@
 void CHnMdMenuItem::CreatePropertiesL( TXmlEngElement aElement,
                                  THnMdCommonPointers* /* aCmnPtrs */ )
     {
-    iSpecific = !aElement.Name().Compare( KMenuItemSpecificElementName8 );
+    iType = CHnMenuItemModel::EItemApplication;
+    if ( !aElement.Name().Compare( KMenuItemSpecificElementName8 ) )
+    	{
+    	iType = CHnMenuItemModel::EItemSpecific;
+    	}
+    else if ( !aElement.Name().Compare( KMenuItemActionElementName8 ) )
+    	{
+    	iType = CHnMenuItemModel::EItemAction;
+    	}
     
     // name
     HBufC* name = HnConvUtils::Str8ToStrLC(
@@ -112,8 +131,7 @@
     for ( TInt i = 0; i < count; i++ )
         {
         TXmlEngElement child = children.Next();
-        if ( !child.Name().Compare( KMenuItemElementName8 ) 
-        		|| !child.Name().Compare( KMenuItemSpecificElementName8 ) )
+        if ( IsMenuItemElementName( child.Name() ) )
             {
             AppendChildItemL( CHnMdMenuItem::NewL( child, aCmnPtrs ) );
             }
@@ -129,8 +147,7 @@
 void CHnMdMenuItem::ConstructL( TXmlEngElement aElement,
                                 THnMdCommonPointers* aCmnPtrs )
     {
-    if ( !aElement.Name().Compare( KMenuItemElementName8 )
-    		|| !aElement.Name().Compare( KMenuItemSpecificElementName8 ) )
+    if ( IsMenuItemElementName( aElement.Name() ) )
         { // this is an ordinary menu item
         CreatePropertiesL( aElement, aCmnPtrs );
         CreateChildrenL( aElement, aCmnPtrs ); // in case there are subitems