X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Faccessibility-manager%2Faccessibility-manager-impl.cpp;h=7f698610bd23e409778d45462c6fa08710d29d09;hb=32fb8d43cf8802133910ad631a8278974a076317;hp=aee1bc0ff176bd0e7f902c97f14a669f7c0ebdd8;hpb=87a9019904ab49c42f1e32e7ebb6a1512b0dc28c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp b/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp index aee1bc0..7f69861 100644 --- a/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp +++ b/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ #include // INTERNAL INCLUDES +#include #include #include #include @@ -58,10 +59,10 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOC const char* const ACTOR_FOCUSABLE("focusable"); const char* const IS_FOCUS_GROUP("isFocusGroup"); -const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.9.png"; +const char* FOCUS_BORDER_IMAGE_FILE_NAME = "B16-8_TTS_focus.9.png"; -const char* FOCUS_SOUND_FILE = DALI_SOUND_DIR "Focus.ogg"; -const char* FOCUS_CHAIN_END_SOUND_FILE = DALI_SOUND_DIR "End_of_List.ogg"; +const char* FOCUS_SOUND_FILE_NAME = "Focus.ogg"; +const char* FOCUS_CHAIN_END_SOUND_FILE_NAME = "End_of_List.ogg"; /** * The function to be used in the hit-test algorithm to check whether the actor is hittable. @@ -112,6 +113,8 @@ AccessibilityManager::AccessibilityManager() mFocusIndicatorActor(), mPreviousPosition( 0.0f, 0.0f ), mRecursiveFocusMoveCounter(0), + mFocusSoundFilePath(), + mFocusChainEndSoundFilePath(), mIsWrapped(false), mIsFocusWithinGroup(false), mIsEndcapFeedbackEnabled(false), @@ -119,7 +122,9 @@ AccessibilityManager::AccessibilityManager() mIsAccessibilityTtsEnabled(false), mTtsCreated(false), mIsFocusIndicatorEnabled(false), - mContinuousPlayMode(false) + mContinuousPlayMode(false), + mIsFocusSoundFilePathSet(false), + mIsFocusChainEndSoundFilePathSet(false) { } @@ -357,7 +362,13 @@ bool AccessibilityManager::DoSetCurrentFocusActor(const unsigned int actorID) Dali::SoundPlayer soundPlayer = Dali::SoundPlayer::Get(); if(soundPlayer) { - soundPlayer.PlaySound(FOCUS_SOUND_FILE); + if (!mIsFocusSoundFilePathSet) + { + const std::string soundDirPath = AssetManager::GetDaliSoundPath(); + mFocusSoundFilePath = soundDirPath + FOCUS_SOUND_FILE_NAME; + mIsFocusSoundFilePathSet = true; + } + soundPlayer.PlaySound(mFocusSoundFilePath); } // Play the accessibility attributes with the TTS player. @@ -595,7 +606,10 @@ Actor AccessibilityManager::GetFocusIndicatorActor() if( ! mFocusIndicatorActor ) { // Create the default if it hasn't been set and one that's shared by all the keyboard focusable actors - mFocusIndicatorActor = Toolkit::ImageView::New( FOCUS_BORDER_IMAGE_PATH ); + const std::string imageDirPath = AssetManager::GetDaliImagePath(); + const std::string focusBorderImagePath = imageDirPath + FOCUS_BORDER_IMAGE_FILE_NAME; + + mFocusIndicatorActor = Toolkit::ImageView::New(focusBorderImagePath); mFocusIndicatorActor.SetParentOrigin( ParentOrigin::CENTER ); mFocusIndicatorActor.SetZ( 1.0f ); @@ -622,7 +636,13 @@ bool AccessibilityManager::DoMoveFocus(FocusIDIter focusIDIter, bool forward, bo Dali::SoundPlayer soundPlayer = Dali::SoundPlayer::Get(); if(soundPlayer) { - soundPlayer.PlaySound(FOCUS_CHAIN_END_SOUND_FILE); + if (!mIsFocusChainEndSoundFilePathSet) + { + const std::string soundDirPath = AssetManager::GetDaliSoundPath(); + mFocusChainEndSoundFilePath = soundDirPath + FOCUS_CHAIN_END_SOUND_FILE_NAME; + mIsFocusChainEndSoundFilePathSet = true; + } + soundPlayer.PlaySound(mFocusChainEndSoundFilePath); } mIsEndcapFeedbackPlayed = true; @@ -1298,11 +1318,11 @@ bool AccessibilityManager::AccessibilityActionTouch(const TouchEvent& touchEvent return handled; } -bool AccessibilityManager::HandlePanGesture(const Integration::PanGestureEvent& panEvent) +bool AccessibilityManager::HandlePanGesture(const AccessibilityGestureEvent& panEvent) { bool handled = false; - if( panEvent.state == Gesture::Started ) + if( panEvent.state == AccessibilityGestureEvent::Started ) { // Find the focusable actor at the event position Dali::HitTestAlgorithm::Results results; @@ -1319,7 +1339,7 @@ bool AccessibilityManager::HandlePanGesture(const Integration::PanGestureEvent& // Gesture::Finished (Up) events are delivered with previous (Motion) event position // Use the real previous position; otherwise we may incorrectly get a ZERO velocity - if ( Gesture::Finished != panEvent.state ) + if ( AccessibilityGestureEvent::Finished != panEvent.state ) { // Store the previous position for next Gesture::Finished iteration. mPreviousPosition = panEvent.previousPosition; @@ -1327,7 +1347,8 @@ bool AccessibilityManager::HandlePanGesture(const Integration::PanGestureEvent& Actor rootActor = Stage::GetCurrent().GetRootLayer(); - Dali::PanGesture pan(panEvent.state); + Dali::PanGesture pan( static_cast(panEvent.state) ); + pan.time = panEvent.time; pan.numberOfTouches = panEvent.numberOfTouches; pan.screenPosition = panEvent.currentPosition;