idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp
branchRCL_3
changeset 26 1b758917cafc
parent 23 7be2816dbabd
child 28 d721605b30d0
equal deleted inserted replaced
25:137ebc85284b 26:1b758917cafc
    59 _LIT8( KName, "name" );
    59 _LIT8( KName, "name" );
    60 _LIT8( KToolTip, "tooltip" );
    60 _LIT8( KToolTip, "tooltip" );
    61 _LIT8( KMenuBar, "menubar" );
    61 _LIT8( KMenuBar, "menubar" );
    62 _LIT8( KTextEditor, "texteditor" );
    62 _LIT8( KTextEditor, "texteditor" );
    63 _LIT8( KPlugin, "plugin" );
    63 _LIT8( KPlugin, "plugin" );
       
    64 _LIT8( KTemplate, "template" );
       
    65 _LIT8( KIndex, "index" );
    64 
    66 
    65 _LIT8( KActionsHandler, "actionshandler" );
    67 _LIT8( KActionsHandler, "actionshandler" );
    66 
    68 
    67 const TInt KUnitMaxLen = 2;
    69 const TInt KUnitMaxLen = 2;
    68 const TInt KOneView = 1;
    70 const TInt KOneView = 1;
   422     RPointerArray< CXnProperty >& aArray,
   424     RPointerArray< CXnProperty >& aArray,
   423     RArray< CXnDomProperty::TPseudoClass >& aStates, TInt& aLevel,
   425     RArray< CXnDomProperty::TPseudoClass >& aStates, TInt& aLevel,
   424     TBool aInformChange = EFalse );
   426     TBool aInformChange = EFalse );
   425 static TBool MatchTitleScrollTriggerL(
   427 static TBool MatchTitleScrollTriggerL(
   426     CXnNode& aEventData, CXnDomNode& aTriggerNode );
   428     CXnNode& aEventData, CXnDomNode& aTriggerNode );
       
   429 static CXnDomNode* GetTemplateEventL( 
       
   430     const TDesC8& aTemplate, 
       
   431     CXnNode& aNode, 
       
   432     CXnDomNode& aEventNode );    
   427 
   433 
   428 // ============================= LOCAL FUNCTIONS ===============================
   434 // ============================= LOCAL FUNCTIONS ===============================
   429 
   435 // -----------------------------------------------------------------------------
       
   436 // GetTemplateEventL
       
   437 // -----------------------------------------------------------------------------
       
   438 //
       
   439 static CXnDomNode* GetTemplateEventL( const TDesC8& aTemplate, CXnNode& aNode, 
       
   440     CXnDomNode& aEventNode )
       
   441     {
       
   442     CXnDomNode* retval( NULL );
       
   443     
       
   444     if ( aTemplate == KIndex() )
       
   445         {
       
   446         _LIT8( KTemplateIndex, "(#)" );
       
   447         
       
   448         const TDesC8& eventString( aEventNode.AttributeValue( KName ) );
       
   449         
       
   450         TInt index( eventString.Find( KTemplateIndex ) );
       
   451         
       
   452         CXnNode* parent( aNode.Parent() );
       
   453         
       
   454         if ( index != KErrNotFound && parent )
       
   455             {                                
       
   456             RPointerArray< CXnNode >& siblings( parent->Children() );
       
   457             
       
   458             TInt itemindex( siblings.Find( &aNode ) );
       
   459             
       
   460             if ( itemindex != KErrNotFound )
       
   461                 {
       
   462                 TBuf8< 4 > buf;
       
   463                 buf.AppendNum( itemindex );
       
   464     
       
   465                 CXnDomNode* clone( 
       
   466                     aEventNode.CloneL( *aEventNode.StringPool() ) );
       
   467                 CleanupStack::PushL( clone );
       
   468                 
       
   469                 HBufC8* templateString = 
       
   470                     HBufC8::NewLC( eventString.Length() + 4 );
       
   471 
       
   472                 TPtr8 ptr( templateString->Des() );
       
   473                 
       
   474                 ptr.Copy( eventString );
       
   475                 ptr.Delete( index + 1, 1 );                    
       
   476                 ptr.Insert( index + 1, buf );
       
   477                                 
       
   478                 CXnDomAttribute* attribute = static_cast< CXnDomAttribute* > 
       
   479                     ( clone->AttributeList().FindByName( 
       
   480                         XnPropertyNames::action::event::KName ) );
       
   481                                                 
       
   482                 if ( attribute )
       
   483                     {                                        
       
   484                     attribute->SetValueL( ptr );
       
   485                     }
       
   486                                 
       
   487                 CleanupStack::PopAndDestroy( templateString );
       
   488                 
       
   489                 CleanupStack::Pop( clone );
       
   490                 retval = clone;
       
   491                 }
       
   492             }    
       
   493         }
       
   494     
       
   495     return retval;
       
   496     }
       
   497     
   430 // -----------------------------------------------------------------------------
   498 // -----------------------------------------------------------------------------
   431 // ResolveEffectId
   499 // ResolveEffectId
   432 // -----------------------------------------------------------------------------
   500 // -----------------------------------------------------------------------------
   433 //
   501 //
   434 static TInt ResolveEffectId( CXnDomNode& aEventNode )
   502 static TInt ResolveEffectId( CXnDomNode& aEventNode )
  2717     CXnDomNode& aTriggerNode,
  2785     CXnDomNode& aTriggerNode,
  2718     CXnNode& aEventData )
  2786     CXnNode& aEventData )
  2719     {       
  2787     {       
  2720     CXnAppUiAdapter& adapter( aEngine.AppUiAdapter() );
  2788     CXnAppUiAdapter& adapter( aEngine.AppUiAdapter() );
  2721     
  2789     
  2722     adapter.HandleXuikonEventL(
  2790     // Check if event is template
  2723         aNode.AppIfL(), aEventData.AppIfL(), aTriggerNode, aEventNode );
  2791     const TDesC8& templateEvent( aEventNode.AttributeValue( KTemplate ) );
       
  2792     
       
  2793     if ( templateEvent != KNullDesC8() )
       
  2794         {
       
  2795         CXnDomNode* event( 
       
  2796             GetTemplateEventL( templateEvent, aNode, aEventNode ) );
       
  2797         CleanupStack::PushL( event );
       
  2798 
       
  2799         if ( event )
       
  2800             {
       
  2801             adapter.HandleXuikonEventL(
       
  2802                 aNode.AppIfL(), aEventData.AppIfL(), aTriggerNode, *event );            
       
  2803             }
       
  2804         
       
  2805         CleanupStack::PopAndDestroy( event );        
       
  2806         }
       
  2807     else
       
  2808         {
       
  2809         adapter.HandleXuikonEventL(
       
  2810             aNode.AppIfL(), aEventData.AppIfL(), aTriggerNode, aEventNode );    
       
  2811         }
  2724     }
  2812     }
  2725 
  2813 
  2726 // -----------------------------------------------------------------------------
  2814 // -----------------------------------------------------------------------------
  2727 // RunFullScreenEffectL
  2815 // RunFullScreenEffectL
  2728 // -----------------------------------------------------------------------------
  2816 // -----------------------------------------------------------------------------