X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.h;h=ab2764caf32a7ddf196e72b2a886497b0fdd8e36;hp=9295d5fdfe081dc4e33ae9e0846e990baa2c10c0;hb=64cacc4d250a25eb19c27ed55741f3ae61266518;hpb=09f35f81061ca470e79ac674024b9e587ff44e7f diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 9295d5f..ab2764c 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -19,8 +19,8 @@ */ // EXTERNAL INCLUDES -#include -#include +#include +#include // INTERNAL INCLUDES #include @@ -42,8 +42,6 @@ struct Event // Used to queue input events until DoRelayout() enum Type { - KEYBOARD_FOCUS_GAIN_EVENT, - KEYBOARD_FOCUS_LOST_EVENT, CURSOR_KEY_EVENT, TAP_EVENT, PAN_EVENT, @@ -154,9 +152,8 @@ struct ModifyEvent { enum Type { - PLACEHOLDER_TEXT, ///< Show the placeholder text if necessary TEXT_REPLACED, ///< The entire text was replaced - TEXT_INSERTED, ///< Insert characters at the current cursor position + TEXT_INSERTED, ///< Insert characters at the current cursor position TEXT_DELETED ///< Characters were deleted }; @@ -234,6 +231,12 @@ struct Controller::Impl */ void QueueModifyEvent( ModifyEvent::Type type ) { + if( ModifyEvent::TEXT_REPLACED == type) + { + // Cancel previously queued inserts etc. + mModifyEvents.clear(); + } + ModifyEvent event; event.type = type; mModifyEvents.push_back( event ); @@ -263,17 +266,6 @@ struct Controller::Impl return ( mEventData && mEventData->mIsShowingPlaceholderText ); } - void ShowPlaceholderText() - { - if( IsPlaceholderAvailable() ) - { - mEventData->mIsShowingPlaceholderText = true; - - // Placeholder-text is dependent on focus state i.e. replace after event processing - QueueModifyEvent( ModifyEvent::PLACEHOLDER_TEXT ); - } - } - /** * @brief Called when placeholder-text is hidden */ @@ -288,7 +280,17 @@ struct Controller::Impl } } - void PreEditReset() + void ClearPreEditFlag() + { + if( mEventData ) + { + mEventData->mPreEditFlag = false; + mEventData->mPreEditStartPosition = 0; + mEventData->mPreEditLength = 0; + } + } + + void ResetImfManager() { // Reset incase we are in a pre-edit state. ImfManager imfManager = ImfManager::Get(); @@ -296,12 +298,9 @@ struct Controller::Impl { imfManager.Reset(); // Will trigger a commit message } - } - /** - * @brief Called when placeholder-text is shown - */ - void ReplaceTextWithPlaceholder(); + ClearPreEditFlag(); + } void UpdateModel( OperationsMask operationsRequired ); @@ -313,8 +312,6 @@ struct Controller::Impl */ void GetDefaultFonts( Dali::Vector& fonts, Length numberOfCharacters ); - void OnKeyboardFocus( bool hasFocus ); - void OnCursorKeyEvent( const Event& event ); void OnTapEvent( const Event& event );