X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.h;h=fa502a70998f4ddfa899b0cf39f641301b648d34;hb=5cf3fe5c50e9c6bd3e52898af024cb29f6881d8c;hp=79792c932b5acd52fd322d34aa29e03ec0657067;hpb=ebc5e24273f0d9042194e533a09d989ff6f7b196;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 79792c9..fa502a7 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 @@ -146,6 +146,7 @@ struct EventData bool mUpdateLeftSelectionPosition : 1; ///< True if the visual position of the left selection handle must be recalculated. bool mUpdateRightSelectionPosition : 1; ///< True if the visual position of the right selection handle must be recalculated. bool mScrollAfterUpdateCursorPosition : 1; ///< Whether to scroll after the cursor position is updated. + bool mScrollAfterDelete : 1; ///< Whether to scroll after delete characters. }; struct ModifyEvent @@ -231,6 +232,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 ); @@ -274,7 +281,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(); @@ -282,6 +299,8 @@ struct Controller::Impl { imfManager.Reset(); // Will trigger a commit message } + + ClearPreEditFlag(); } void UpdateModel( OperationsMask operationsRequired ); @@ -376,10 +395,17 @@ struct Controller::Impl /** * @brief Scrolls the text to make the cursor visible. * - * This method is called after inserting, deleting or moving the cursor with the keypad. + * This method is called after inserting text or moving the cursor with the keypad. */ void ScrollToMakeCursorVisible(); + /** + * @brief Scrolls the text to make the cursor visible. + * + * This method is called after deleting text. + */ + void ScrollTextToMatchCursor(); + ControlInterface& mControlInterface; ///< Reference to the text controller. LogicalModelPtr mLogicalModel; ///< Pointer to the logical model. VisualModelPtr mVisualModel; ///< Pointer to the visual model.