[Tizen] Add to play inserted text using tts player 85/286285/2 accepted/tizen/6.0/unified/20230105.030124 submit/tizen_6.0/20230104.100637
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 3 Jan 2023 06:20:28 +0000 (15:20 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 4 Jan 2023 10:01:36 +0000 (19:01 +0900)
- Currently in tizen 6.0, text is read only when keyboard character is focused,
  and not when text is inserted.
- So, updated to read inserted text with Tts player.

Change-Id: I3853bdf8292d7f9668ac3917ef96300cfc309234
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali-toolkit/internal/text/text-controller.cpp

index f96c976..670c6d9 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/adaptor-framework/tts-player.h>
 #include <memory.h>
 #include <cmath>
 #include <limits>
@@ -2278,6 +2279,13 @@ void Controller::InsertText(const std::string& text, Controller::InsertType type
 
   DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Controller::InsertText %p %s (%s) mPrimaryCursorPosition %d mPreEditFlag %d mPreEditStartPosition %d mPreEditLength %d\n", this, text.c_str(), (COMMIT == type ? "COMMIT" : "PRE_EDIT"), mImpl->mEventData->mPrimaryCursorPosition, mImpl->mEventData->mPreEditFlag, mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength);
 
+  // Play the input text with the TTS player.
+  Dali::TtsPlayer player = Dali::TtsPlayer::Get(Dali::TtsPlayer::SCREEN_READER);
+  if (player)
+  {
+    player.Play(text);
+  }
+
   // TODO: At the moment the underline runs are only for pre-edit.
   mImpl->mModel->mVisualModel->mUnderlineRuns.Clear();