From: Suyeon Hwang Date: Wed, 21 Sep 2022 07:12:29 +0000 (+0900) Subject: Request event for refreshing clickable object X-Git-Tag: accepted/tizen/unified/20220927.132354~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc5c8947a142e8f3bce3d7c0e8f00430e682eb97;p=platform%2Fcore%2Fuifw%2Fmmi-manager.git Request event for refreshing clickable object Change-Id: I98990c427a2a83cd7478a4344c76b86f85df092b Signed-off-by: Suyeon Hwang --- diff --git a/src/mmimgr/iu/VoiceTouchEngine.cpp b/src/mmimgr/iu/VoiceTouchEngine.cpp index 5461ffb..87741ac 100644 --- a/src/mmimgr/iu/VoiceTouchEngine.cpp +++ b/src/mmimgr/iu/VoiceTouchEngine.cpp @@ -35,6 +35,7 @@ static const string __SHOW_GRID_INVOCATION = "show grid"; static const vector __SHOW_NUMBER_KOKR = {"힌트 보여줘", "숫자 힌트 보여줘", "숫자 보여줘", "숫자"}; static const vector __SHOW_LABEL_KOKR = {"힌트 메세지 보여줘", "텍스트 보여줘", "텍스트", "텍스트 힌트 보여줘"}; static const vector __SHOW_GRID_KOKR = {"그리드", "그리드 모드", "그리드로 보여줘", "그리드 보여줘"}; +static const vector __REFRESH_WINDOW_INFO = {"화면 갱신해줘", "화면 업데이트", "리프레시", "새로고침", "새로 고침"}; static const int __DEFAULT_DISPLAY_WIDTH = 1920; static const int __DEFAULT_DISPLAY_HEIGHT = 1080; @@ -144,6 +145,35 @@ bool VoiceTouchEngine::setInputModalityData(std::string appId, int modalityType, return false; } +static bool __is_exist_in_candidates(const string &text, const vector &candidates) +{ + for (auto &candidate : candidates) { + if (0 == text.compare(candidate)) { + return true; + } + } + + return false; +} + +static void __refresh_screen_inform_event_free(void *data EINA_UNUSED, void *event) +{ + mmi_event_refresh_screen_inform *ev = (mmi_event_refresh_screen_inform *)event; + free(ev); +} + +static void __invoke_event_for_refreshing_window() +{ + mmi_event_refresh_screen_inform *ev = (mmi_event_refresh_screen_inform *)calloc(1, sizeof(mmi_event_refresh_screen_inform)); + if (ev == NULL) { + LOGE("mmi_event_refresh_screen_inform malloc failed"); + return; + } + + ev->seconds = 2.0; + ecore_event_add(MMI_EVENT_REFRESH_SCREEN_INFORM, ev, __refresh_screen_inform_event_free, nullptr); +} + bool VoiceTouchEngine::handleVoiceInput(mmi_provider_event_voice *voiceEvent) { _I("[VoiceTouchEngine] Voice modality"); @@ -171,6 +201,13 @@ bool VoiceTouchEngine::handleVoiceInput(mmi_provider_event_voice *voiceEvent) setFinalAsrResult(asrResult, timestamp, provider); invokeOutputResultCallback(provider.jsonToString()); + bool isRefreshNeed = __is_exist_in_candidates(asrResult, __REFRESH_WINDOW_INFO); + if (isRefreshNeed) { + _I("[VoiceTouchEngine] Request to refresh clickable object information."); + __invoke_event_for_refreshing_window(); + return true; + } + bool isModeUpdated = checkVoiceTouchMode(asrResult); if (isModeUpdated) { _I("[VoiceTouchEngine] Voice touch mode is changed. (%d)", static_cast(__currentMode)); @@ -262,17 +299,6 @@ void VoiceTouchEngine::makeClickedItemResult(ClickableItem* command, int timesta } } -static bool __is_exist_in_candidates(const string &text, const vector &candidates) -{ - for (auto &candidate : candidates) { - if (0 == text.compare(candidate)) { - return true; - } - } - - return false; -} - bool VoiceTouchEngine::checkVoiceTouchMode(const std::string &text) { _I("[VoiceTouchEngine] Input text(%s)", text.c_str());