idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp
branchRCL_3
changeset 23 7be2816dbabd
parent 19 79311d856354
child 24 515194ff9f15
child 26 1b758917cafc
--- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp	Tue Apr 27 16:26:12 2010 +0300
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp	Tue May 11 16:02:39 2010 +0300
@@ -52,6 +52,7 @@
 #include "xnviewadapter.h"
 #include "xnbackgroundmanager.h"
 #include "xntexteditor.h"
+#include "xnitemactivator.h"
 
 // Local constants
 _LIT8( KId, "id" );
@@ -348,8 +349,6 @@
     CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode,
     CXnNode& aActionsParent, CXnNode& aEventData, TInt aSource );
 static TBool DoReceiveFocusL( CXnNode& aNode, CXnUiEngine& aEngine );
-static CXnNode* BuildActivateTriggerNodeL( CXnUiEngine& aUiEngine );
-static void DoSetActiveL( CXnNode& aNode, CXnUiEngine& aUiEngine );
 static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty = NULL );
 static CXnNode* BuildEventTypeNodeL( TEventCode aType, CXnUiEngine& aUiEngine );
 static CXnNode* BuildModifiersNodeL(
@@ -2001,37 +2000,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// BuildActivateTriggerNodeL
-// -----------------------------------------------------------------------------
-//
-static CXnNode* BuildActivateTriggerNodeL( CXnUiEngine& aUiEngine )
-    {
-    CXnNode* node = CXnNode::NewL();
-    CleanupStack::PushL( node );
-    CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger );
-    CleanupStack::PushL( type );
-    CXnNodeImpl* impl = CXnNodeImpl::NewL( type );
-    CleanupStack::Pop( type );
-    node->SetImpl( impl );
-    node->SetUiEngine( aUiEngine );
-    CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL(
-        aUiEngine.ODT()->DomDocument().StringPool() );
-    CleanupStack::PushL( nameValue );
-    nameValue->SetStringValueL( CXnDomPropertyValue::EString,
-        XnPropertyNames::action::trigger::name::KActivate );
-    CXnProperty* name = CXnProperty::NewL(
-        XnPropertyNames::action::trigger::KName,
-        nameValue,
-        *aUiEngine.ODT()->DomDocument().StringPool() );
-    CleanupStack::Pop( nameValue );
-    CleanupStack::PushL( name );
-    node->SetPropertyL( name );
-    CleanupStack::Pop( name );
-    CleanupStack::Pop( node );
-    return node;
-    }
-
-// -----------------------------------------------------------------------------
 // BuildPropertyNodesL
 // -----------------------------------------------------------------------------
 //
@@ -3919,15 +3887,14 @@
         }
     else if ( nameString == XnPropertyNames::action::event::KActivateSelectedItem )
         {
-        CXnNode* focusedNode = aEngine.FocusedNode();
+        CXnNode* focusedNode( aEngine.FocusedNode() );
+        
         if ( focusedNode )
             {
-            CXnNode* activate = BuildActivateTriggerNodeL( aEngine );
-            CleanupStack::PushL( activate );
-            focusedNode->ReportXuikonEventL( *activate );
-            CleanupStack::PopAndDestroy( activate );
-            }
-        return EFalse;
+            aEngine.AppUiAdapter().ItemActivator().Activate( focusedNode );            
+            }
+        
+        return ETrue;
         }
     else if ( nameString == XnPropertyNames::action::event::KDeactivate )
         {
@@ -6267,19 +6234,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// DoSetActiveL
-// -----------------------------------------------------------------------------
-//
-static void DoSetActiveL( CXnNode& aNode, CXnUiEngine& aUiEngine )
-    {
-    CXnNode* activate = BuildActivateTriggerNodeL( aUiEngine );
-    activate->SetUiEngine( aUiEngine );
-    CleanupStack::PushL( activate );
-    aNode.ReportXuikonEventL( *activate );
-    CleanupStack::PopAndDestroy( activate );
-    }
-
-// -----------------------------------------------------------------------------
 // Informs the component about the property change.
 // -----------------------------------------------------------------------------
 //
@@ -7590,7 +7544,7 @@
 
     if ( activated )
         {
-        DoSetActiveL( *iNode, *iUiEngine );
+        iUiEngine->AppUiAdapter().ItemActivator().Activate( iNode );
         }
 
     if ( stateChanged )