// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/public-api/adaptor-framework/tts-player.h>
#include <memory.h>
#include <cmath>
#include <limits>
DALI_ASSERT_DEBUG(text.size() >= utf32Characters.Count() && "Invalid UTF32 conversion length");
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "UTF8 size %d, UTF32 size %d\n", text.size(), utf32Characters.Count());
+
+ // Play the input text with the TTS player.
+ Dali::TtsPlayer player = Dali::TtsPlayer::Get(Dali::TtsPlayer::SCREEN_READER);
+ if(player)
+ {
+ if(type == COMMIT && mImpl->mEventData->mPreEditToCommitFlag)
+ {
+ if(characterCount > 1u)
+ {
+ std::string ttsText = text;
+ if(text.length() > mImpl->mEventData->mPreEditTextLength)
+ {
+ ttsText = text.substr(mImpl->mEventData->mPreEditTextLength);
+ }
+ player.Play(ttsText);
+ }
+ }
+ else
+ {
+ player.Play(text);
+ }
+ }
+ }
+
+ // PRE_EDIT type empty text is inserted before the preedit input is converted to commit.
+ if(text.empty() && type == PRE_EDIT)
+ {
+ mImpl->mEventData->mPreEditToCommitFlag = true;
}
if(0u != utf32Characters.Count()) // Check if Utf8ToUtf32 conversion succeeded
}
mImpl->ChangeState(EventData::EDITING);
+ mImpl->mEventData->mPreEditToCommitFlag = false;
// Handle the InputMethodContext (predicitive text) state changes
if(COMMIT == type)
mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;
}
- mImpl->mEventData->mPreEditLength = utf32Characters.Count();
- mImpl->mEventData->mPreEditFlag = true;
+ mImpl->mEventData->mPreEditLength = utf32Characters.Count();
+ mImpl->mEventData->mPreEditTextLength = text.length();
+ mImpl->mEventData->mPreEditFlag = true;
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "mPreEditStartPosition %d mPreEditLength %d\n", mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength);
}