- if( NULL == mEventData )
- {
- // Nothing to do if there is no text input.
- return;
- }
-
- DALI_LOG_INFO( gLogFilter, Debug::General, "ChangeState state:%d newstate:%d\n", mEventData->mState, newState );
-
- if( mEventData->mState != newState )
- {
- mEventData->mPreviousState = mEventData->mState;
- mEventData->mState = newState;
-
- switch( mEventData->mState )
- {
- case EventData::INACTIVE:
- {
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
- mEventData->mDecorator->StopCursorBlink();
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
- mEventData->mDecorator->SetPopupActive( false );
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::INTERRUPTED:
- {
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
- mEventData->mDecorator->SetPopupActive( false );
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::SELECTING:
- {
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
- mEventData->mDecorator->StopCursorBlink();
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
- if ( mEventData->mGrabHandleEnabled )
- {
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
- }
- mEventData->mDecorator->SetHighlightActive( true );
- if( mEventData->mGrabHandlePopupEnabled )
- {
- SetPopupButtons();
- mEventData->mDecorator->SetPopupActive( true );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::EDITING:
- {
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
- if( mEventData->mCursorBlinkEnabled )
- {
- mEventData->mDecorator->StartCursorBlink();
- }
- // Grab handle is not shown until a tap is received whilst EDITING
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
- if( mEventData->mGrabHandlePopupEnabled )
- {
- mEventData->mDecorator->SetPopupActive( false );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::EDITING_WITH_POPUP:
- {
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_POPUP \n", newState );
-
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
- if( mEventData->mCursorBlinkEnabled )
- {
- mEventData->mDecorator->StartCursorBlink();
- }
- if( mEventData->mSelectionEnabled )
- {
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
- }
- else if ( mEventData->mGrabHandleEnabled )
- {
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
- }
- if( mEventData->mGrabHandlePopupEnabled )
- {
- SetPopupButtons();
- mEventData->mDecorator->SetPopupActive( true );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::EDITING_WITH_GRAB_HANDLE:
- {
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_GRAB_HANDLE \n", newState );
-
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
- if( mEventData->mCursorBlinkEnabled )
- {
- mEventData->mDecorator->StartCursorBlink();
- }
- // Grab handle is not shown until a tap is received whilst EDITING
- if ( mEventData->mGrabHandleEnabled )
- {
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
- }
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
- if( mEventData->mGrabHandlePopupEnabled )
- {
- mEventData->mDecorator->SetPopupActive( false );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::SELECTION_HANDLE_PANNING:
- {
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
- mEventData->mDecorator->StopCursorBlink();
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
- if ( mEventData->mGrabHandleEnabled )
- {
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
- }
- mEventData->mDecorator->SetHighlightActive( true );
- if( mEventData->mGrabHandlePopupEnabled )
- {
- mEventData->mDecorator->SetPopupActive( false );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::GRAB_HANDLE_PANNING:
- {
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GRAB_HANDLE_PANNING \n", newState );
-
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
- if( mEventData->mCursorBlinkEnabled )
- {
- mEventData->mDecorator->StartCursorBlink();
- }
- if ( mEventData->mGrabHandleEnabled )
- {
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
- }
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
- if( mEventData->mGrabHandlePopupEnabled )
- {
- mEventData->mDecorator->SetPopupActive( false );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::EDITING_WITH_PASTE_POPUP:
- {
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "EDITING_WITH_PASTE_POPUP \n", newState );
-
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
- if( mEventData->mCursorBlinkEnabled )
- {
- mEventData->mDecorator->StartCursorBlink();
- }
-
- if ( mEventData->mGrabHandleEnabled )
- {
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
- }
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( false );
-
- if( mEventData->mGrabHandlePopupEnabled )
- {
- SetPopupButtons();
- mEventData->mDecorator->SetPopupActive( true );
- }
- mEventData->mDecoratorUpdated = true;
- break;
- }
- case EventData::TEXT_PANNING:
- {
- mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
- mEventData->mDecorator->StopCursorBlink();
- mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
- if( mEventData->mDecorator->IsHandleActive( LEFT_SELECTION_HANDLE ) ||
- mEventData->mDecorator->IsHandleActive( RIGHT_SELECTION_HANDLE ) )
- {
- mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
- mEventData->mDecorator->SetHighlightActive( true );
- }
-
- if( mEventData->mGrabHandlePopupEnabled )
- {
- mEventData->mDecorator->SetPopupActive( false );
- }
-
- mEventData->mDecoratorUpdated = true;
- break;
- }
- }
- }