#include <dali-toolkit/internal/text/shaper.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
#include <dali-toolkit/internal/text/text-run-container.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
namespace
{
GetCursorPosition( mEventData->mPrimaryCursorPosition,
cursorInfo );
+
+ if( NULL != mEditableControlInterface )
+ {
+ mEditableControlInterface->CaretMoved( mEventData->mPrimaryCursorPosition );
+ }
+
if( mEventData->mUpdateCursorHookPosition )
{
// Update the cursor hook position. Used to move the cursor with the keys 'up' and 'down'.
{
// Set the normal font and the placeholder font.
defaultFontDescription = mFontDefaults->mFontDescription;
- defaultPointSize = mFontDefaults->mDefaultPointSize * 64u;
+
+ if( mTextFitEnabled )
+ {
+ defaultPointSize = mFontDefaults->mFitPointSize * 64u;
+ }
+ else
+ {
+ defaultPointSize = mFontDefaults->mDefaultPointSize * 64u;
+ }
}
// Validates the fonts. If there is a character with no assigned font it sets a default one.
if( mEventData->mSelectionEnabled )
{
- ChangeState( EventData::SELECTING );
+ // Calculates the logical position from the start.
+ RepositionSelectionHandles( 0.f - mModel->mScrollPosition.x,
+ 0.f - mModel->mScrollPosition.y,
+ Controller::NoTextTap::HIGHLIGHT );
mEventData->mLeftSelectionPosition = 0u;
mEventData->mRightSelectionPosition = mModel->mLogicalModel->mText.Count();
-
- mEventData->mScrollAfterUpdatePosition = true;
- mEventData->mUpdateLeftSelectionPosition = true;
- mEventData->mUpdateRightSelectionPosition = true;
- mEventData->mUpdateHighlightBox = true;
}
}
}
}
+void Controller::Impl::SetSelection( int start, int end )
+{
+ mEventData->mLeftSelectionPosition = start;
+ mEventData->mRightSelectionPosition = end;
+ mEventData->mUpdateCursorPosition = true;
+}
+
+std::pair< int, int > Controller::Impl::GetSelectionIndexes() const
+{
+ return { mEventData->mLeftSelectionPosition, mEventData->mRightSelectionPosition };
+}
+
void Controller::Impl::ShowClipboard()
{
if( mClipboard )
mClipboardHideEnabled = enable;
}
-bool Controller::Impl::CopyStringToClipboard( std::string& source )
+bool Controller::Impl::CopyStringToClipboard( const std::string& source )
{
//Send string to clipboard
return ( mClipboard && mClipboard.SetItem( source ) );