50 #include "xnlistquerydialogadapter.h" |
50 #include "xnlistquerydialogadapter.h" |
51 #include "xneffectmanager.h" |
51 #include "xneffectmanager.h" |
52 #include "xnviewadapter.h" |
52 #include "xnviewadapter.h" |
53 #include "xnbackgroundmanager.h" |
53 #include "xnbackgroundmanager.h" |
54 #include "xntexteditor.h" |
54 #include "xntexteditor.h" |
|
55 #include "xnitemactivator.h" |
55 |
56 |
56 // Local constants |
57 // Local constants |
57 _LIT8( KId, "id" ); |
58 _LIT8( KId, "id" ); |
58 _LIT8( KName, "name" ); |
59 _LIT8( KName, "name" ); |
59 _LIT8( KToolTip, "tooltip" ); |
60 _LIT8( KToolTip, "tooltip" ); |
346 const TKeyEvent& aKeyEvent, TEventCode aType ); |
347 const TKeyEvent& aKeyEvent, TEventCode aType ); |
347 static void DoTriggerEventL( |
348 static void DoTriggerEventL( |
348 CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, |
349 CXnNodeImpl* aThis, CXnUiEngine& aEngine, CXnNode& aNode, |
349 CXnNode& aActionsParent, CXnNode& aEventData, TInt aSource ); |
350 CXnNode& aActionsParent, CXnNode& aEventData, TInt aSource ); |
350 static TBool DoReceiveFocusL( CXnNode& aNode, CXnUiEngine& aEngine ); |
351 static TBool DoReceiveFocusL( CXnNode& aNode, CXnUiEngine& aEngine ); |
351 static CXnNode* BuildActivateTriggerNodeL( CXnUiEngine& aUiEngine ); |
|
352 static void DoSetActiveL( CXnNode& aNode, CXnUiEngine& aUiEngine ); |
|
353 static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty = NULL ); |
352 static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty = NULL ); |
354 static CXnNode* BuildEventTypeNodeL( TEventCode aType, CXnUiEngine& aUiEngine ); |
353 static CXnNode* BuildEventTypeNodeL( TEventCode aType, CXnUiEngine& aUiEngine ); |
355 static CXnNode* BuildModifiersNodeL( |
354 static CXnNode* BuildModifiersNodeL( |
356 const TKeyEvent& aKeyEvent, CXnUiEngine& aUiEngine ); |
355 const TKeyEvent& aKeyEvent, CXnUiEngine& aUiEngine ); |
357 static CXnNode* BuildKeyCodeNodeL( |
356 static CXnNode* BuildKeyCodeNodeL( |
1999 CleanupStack::Pop( node ); |
1998 CleanupStack::Pop( node ); |
2000 return node; |
1999 return node; |
2001 } |
2000 } |
2002 |
2001 |
2003 // ----------------------------------------------------------------------------- |
2002 // ----------------------------------------------------------------------------- |
2004 // BuildActivateTriggerNodeL |
|
2005 // ----------------------------------------------------------------------------- |
|
2006 // |
|
2007 static CXnNode* BuildActivateTriggerNodeL( CXnUiEngine& aUiEngine ) |
|
2008 { |
|
2009 CXnNode* node = CXnNode::NewL(); |
|
2010 CleanupStack::PushL( node ); |
|
2011 CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); |
|
2012 CleanupStack::PushL( type ); |
|
2013 CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); |
|
2014 CleanupStack::Pop( type ); |
|
2015 node->SetImpl( impl ); |
|
2016 node->SetUiEngine( aUiEngine ); |
|
2017 CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( |
|
2018 aUiEngine.ODT()->DomDocument().StringPool() ); |
|
2019 CleanupStack::PushL( nameValue ); |
|
2020 nameValue->SetStringValueL( CXnDomPropertyValue::EString, |
|
2021 XnPropertyNames::action::trigger::name::KActivate ); |
|
2022 CXnProperty* name = CXnProperty::NewL( |
|
2023 XnPropertyNames::action::trigger::KName, |
|
2024 nameValue, |
|
2025 *aUiEngine.ODT()->DomDocument().StringPool() ); |
|
2026 CleanupStack::Pop( nameValue ); |
|
2027 CleanupStack::PushL( name ); |
|
2028 node->SetPropertyL( name ); |
|
2029 CleanupStack::Pop( name ); |
|
2030 CleanupStack::Pop( node ); |
|
2031 return node; |
|
2032 } |
|
2033 |
|
2034 // ----------------------------------------------------------------------------- |
|
2035 // BuildPropertyNodesL |
2003 // BuildPropertyNodesL |
2036 // ----------------------------------------------------------------------------- |
2004 // ----------------------------------------------------------------------------- |
2037 // |
2005 // |
2038 static void BuildPropertyNodesL( |
2006 static void BuildPropertyNodesL( |
2039 CXnNode& aNode, |
2007 CXnNode& aNode, |
3917 RunActivateL( aThis, aEngine, aEventNode ); |
3885 RunActivateL( aThis, aEngine, aEventNode ); |
3918 return ETrue; |
3886 return ETrue; |
3919 } |
3887 } |
3920 else if ( nameString == XnPropertyNames::action::event::KActivateSelectedItem ) |
3888 else if ( nameString == XnPropertyNames::action::event::KActivateSelectedItem ) |
3921 { |
3889 { |
3922 CXnNode* focusedNode = aEngine.FocusedNode(); |
3890 CXnNode* focusedNode( aEngine.FocusedNode() ); |
|
3891 |
3923 if ( focusedNode ) |
3892 if ( focusedNode ) |
3924 { |
3893 { |
3925 CXnNode* activate = BuildActivateTriggerNodeL( aEngine ); |
3894 aEngine.AppUiAdapter().ItemActivator().Activate( focusedNode ); |
3926 CleanupStack::PushL( activate ); |
3895 } |
3927 focusedNode->ReportXuikonEventL( *activate ); |
3896 |
3928 CleanupStack::PopAndDestroy( activate ); |
3897 return ETrue; |
3929 } |
|
3930 return EFalse; |
|
3931 } |
3898 } |
3932 else if ( nameString == XnPropertyNames::action::event::KDeactivate ) |
3899 else if ( nameString == XnPropertyNames::action::event::KDeactivate ) |
3933 { |
3900 { |
3934 RunDeactivateL( aThis, aEngine, aEventNode ); |
3901 RunDeactivateL( aThis, aEngine, aEventNode ); |
3935 return ETrue; |
3902 return ETrue; |
6265 |
6232 |
6266 return ETrue; |
6233 return ETrue; |
6267 } |
6234 } |
6268 |
6235 |
6269 // ----------------------------------------------------------------------------- |
6236 // ----------------------------------------------------------------------------- |
6270 // DoSetActiveL |
|
6271 // ----------------------------------------------------------------------------- |
|
6272 // |
|
6273 static void DoSetActiveL( CXnNode& aNode, CXnUiEngine& aUiEngine ) |
|
6274 { |
|
6275 CXnNode* activate = BuildActivateTriggerNodeL( aUiEngine ); |
|
6276 activate->SetUiEngine( aUiEngine ); |
|
6277 CleanupStack::PushL( activate ); |
|
6278 aNode.ReportXuikonEventL( *activate ); |
|
6279 CleanupStack::PopAndDestroy( activate ); |
|
6280 } |
|
6281 |
|
6282 // ----------------------------------------------------------------------------- |
|
6283 // Informs the component about the property change. |
6237 // Informs the component about the property change. |
6284 // ----------------------------------------------------------------------------- |
6238 // ----------------------------------------------------------------------------- |
6285 // |
6239 // |
6286 static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty ) |
6240 static void InformPropertyChangeL( CXnNode& aNode, CXnProperty* aProperty ) |
6287 { |
6241 { |