}
}
+void Controller::RetrieveSelection( std::string& selectedText ) const
+{
+ mImpl->RetrieveSelection( selectedText, false );
+}
+
+void Controller::SetSelection( int start, int end )
+{
+ mImpl->SetSelection( start, end );
+}
+
+std::pair< int, int > Controller::GetSelectionIndexes() const
+{
+ return mImpl->GetSelectionIndexes();
+}
+
+void Controller::CopyStringToClipboard( const std::string& source )
+{
+ mImpl->CopyStringToClipboard( source );
+}
+
+void Controller::SendSelectionToClipboard( bool deleteAfterSending )
+{
+ mImpl->SendSelectionToClipboard( deleteAfterSending );
+}
+
// public : Default style & Input style
void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily )
// Insert at current cursor position.
Vector<Character>& modifyText = mImpl->mModel->mLogicalModel->mText;
+ auto pos = modifyText.End();
if( cursorIndex < numberOfCharactersInModel )
{
- modifyText.Insert( modifyText.Begin() + cursorIndex, utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText );
+ pos = modifyText.Begin() + cursorIndex;
}
- else
+ unsigned int realPos = pos - modifyText.Begin();
+ modifyText.Insert( pos, utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText );
+
+ if( NULL != mImpl->mEditableControlInterface )
{
- modifyText.Insert( modifyText.End(), utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText );
+ mImpl->mEditableControlInterface->TextInserted( realPos, maxSizeOfNewText, text );
}
// Mark the first paragraph to be updated.
currentText.Erase( first, last );
+ if( NULL != mImpl->mEditableControlInterface )
+ {
+ std::string utf8;
+ Utf32ToUtf8( first, numberOfCharacters, utf8 );
+ mImpl->mEditableControlInterface->TextDeleted( cursorIndex, numberOfCharacters, utf8 );
+ }
+
// Cursor position retreat
oldCursorIndex = cursorIndex;
}
}
+CharacterIndex Controller::GetCursorPosition()
+{
+ if( !mImpl->mEventData )
+ return 0;
+
+ return mImpl->mEventData->mPrimaryCursorPosition;
+}
+
void Controller::ResetScrollPosition()
{
if( NULL != mImpl->mEventData )