idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp
changeset 2 08c6ee43b396
parent 0 f72a12da539e
child 4 4d54b72983ae
equal deleted inserted replaced
1:5315654608de 2:08c6ee43b396
   113 //
   113 //
   114 static void SetVisibilityL( CXnNode& aNode, const TDesC8& aVisibility )
   114 static void SetVisibilityL( CXnNode& aNode, const TDesC8& aVisibility )
   115     {
   115     {
   116     CXnUiEngine* engine( aNode.UiEngine() );
   116     CXnUiEngine* engine( aNode.UiEngine() );
   117     
   117     
   118     CXnDomStringPool& sp( aNode.DomNode()->StringPool() );
   118     CXnDomStringPool* sp( aNode.DomNode()->StringPool() );
   119     
   119     
   120     CXnProperty* prop = CXnProperty::NewL(
   120     CXnProperty* prop = CXnProperty::NewL(
   121             XnPropertyNames::style::common::KVisibility,
   121             XnPropertyNames::style::common::KVisibility,
   122             aVisibility,
   122             aVisibility,
   123             CXnDomPropertyValue::EString, sp );
   123             CXnDomPropertyValue::EString, *sp );
   124     CleanupStack::PushL( prop );
   124     CleanupStack::PushL( prop );
   125     
   125     
   126     aNode.SetPropertyL( prop );
   126     aNode.SetPropertyL( prop );
   127     
   127     
   128     CleanupStack::Pop( prop );
   128     CleanupStack::Pop( prop );
   301         if ( iLastDrawRect != TRect::EUninitialized )
   301         if ( iLastDrawRect != TRect::EUninitialized )
   302             {
   302             {
   303             DrawNow( iLastDrawRect );
   303             DrawNow( iLastDrawRect );
   304             }
   304             }
   305         
   305         
   306         iDrawPos = TPoint::EUninitialized;
   306         iDrawPos.SetXY( 0, 0 );
   307         iLastDrawRect = TRect::EUninitialized;        
   307         iLastDrawRect = TRect::EUninitialized;        
   308         }
   308         }
   309     }
   309     }
   310 
   310 
   311 // -----------------------------------------------------------------------------
   311 // -----------------------------------------------------------------------------
   457             else if ( aPointerEvent.iType == TPointerEvent::EDrag )                     
   457             else if ( aPointerEvent.iType == TPointerEvent::EDrag )                     
   458                {
   458                {
   459                if ( iState == CXnEditMode::EDragging )
   459                if ( iState == CXnEditMode::EDragging )
   460                    {
   460                    {
   461                    node->SetStateL( XnPropertyNames::style::common::KFocus );               
   461                    node->SetStateL( XnPropertyNames::style::common::KFocus );               
   462     #ifdef RD_TACTILE_FEEDBACK               
   462 #ifdef RD_TACTILE_FEEDBACK               
   463                     Feedback( ETouchFeedbackSensitive );
   463                    Feedback( ETouchFeedbackSensitive );
   464     #endif                                   
   464 #endif                                   
   465                    }
   465                    }
   466                else if ( iDraggingNode && 
   466                else if ( iDraggingNode && 
   467                    !iDraggingNode->MarginRect().Contains( aPointerEvent.iPosition ) )
   467                    !iDraggingNode->MarginRect().Contains( aPointerEvent.iPosition ) )
   468                    {
   468                    {
   469                    iDraggingNode->UnsetStateL( 
   469                    iDraggingNode->UnsetStateL( 
   538             
   538             
   539             UpdateScreen();
   539             UpdateScreen();
   540             }
   540             }
   541         }
   541         }
   542     else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
   542     else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
   543         {                                                                          
   543         {
       
   544 #ifdef RD_TACTILE_FEEDBACK                
       
   545         Feedback( ETouchFeedbackBasic );
       
   546 #endif
   544         // Cancel
   547         // Cancel
   545         if ( !iTargetNode || !iDraggingNode ||                 
   548         if ( !iTargetNode || !iDraggingNode ||                 
   546              iDraggingNode == iTargetNode ||
   549              iDraggingNode == iTargetNode ||
   547              !iTargetNode->MarginRect().Contains( aPointerEvent.iPosition ) )
   550              !iTargetNode->MarginRect().Contains( aPointerEvent.iPosition ) )
   548             {                                
   551             {                                
   752                         
   755                         
   753         iDraggingNode->SetStateL( XnPropertyNames::style::common::KFocus );
   756         iDraggingNode->SetStateL( XnPropertyNames::style::common::KFocus );
   754         iDraggingNode->Parent()->SetDirtyL( XnDirtyLevel::ELayoutAndRender );
   757         iDraggingNode->Parent()->SetDirtyL( XnDirtyLevel::ELayoutAndRender );
   755         }
   758         }
   756 
   759 
   757     iDraggingNode = iTargetNode = NULL;
   760     iDraggingNode = NULL;
   758      
   761     iTargetNode = NULL;
   759     iPreviousPos = iStylusDownPos = TPoint::EUninitialized;
   762 
   760     
   763     iPreviousPos.SetXY( 0, 0 );
       
   764     iStylusDownPos.SetXY( 0, 0 );
       
   765 
   761     iState = CXnEditMode::EDragAndDrop;
   766     iState = CXnEditMode::EDragAndDrop;
   762     }
   767     }
   763 
   768 
   764 // -----------------------------------------------------------------------------
   769 // -----------------------------------------------------------------------------
   765 // CXnEditMode::HandleScreenDeviceChangedL
   770 // CXnEditMode::HandleScreenDeviceChangedL