2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include "focus-manager-impl.h"
21 #include <dali-toolkit/public-api/controls/control.h>
22 #include <dali-toolkit/public-api/controls/control-impl.h>
23 #include <dali/integration-api/debug.h>
34 namespace // unnamed namespace
37 #if defined(DEBUG_ENABLED)
38 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOCUS_MANAGER");
41 const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png";
42 const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
45 * The function to be used in the hit-test algorithm to check whether the actor is hittable.
47 bool IsActorFocusableFunction(Actor actor, Dali::HitTestAlgorithm::TraverseType type)
49 bool hittable = false;
53 case Dali::HitTestAlgorithm::CHECK_ACTOR:
55 // Check whether the actor is visible and not fully transparent.
57 && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT
59 // Check whether the actor is focusable
60 Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE);
61 if(propertyActorFocusable != Property::INVALID_INDEX)
63 hittable = actor.GetProperty<bool>(propertyActorFocusable);
68 case Dali::HitTestAlgorithm::DESCEND_ACTOR_TREE:
70 if( actor.IsVisible() ) // Actor is visible, if not visible then none of its children are visible.
87 FocusManager::FocusManager()
89 mIsFocusWithinGroup(false),
90 mCurrentFocusActor(FocusIDPair(0, 0)),
91 mFocusIndicatorActor(Actor()),
92 mRecursiveFocusMoveCounter(0),
93 mIsAccessibilityTtsEnabled(false),
94 mIsFocusIndicatorEnabled(false)
96 CreateDefaultFocusIndicatorActor();
98 AccessibilityManager manager = AccessibilityManager::Get();
99 manager.SetActionHandler(*this);
100 manager.SetGestureHandler(*this);
102 ChangeAccessibilityStatus();
105 FocusManager::~FocusManager()
109 FocusManager::ActorAdditionalInfo FocusManager::GetActorAdditionalInfo(const unsigned int actorID) const
111 ActorAdditionalInfo data;
112 IDAdditionalInfoConstIter iter = mIDAdditionalInfoContainer.find(actorID);
113 if(iter != mIDAdditionalInfoContainer.end())
115 data = (*iter).second;
121 void FocusManager::SynchronizeActorAdditionalInfo(const unsigned int actorID, const unsigned int order)
123 ActorAdditionalInfo actorInfo = GetActorAdditionalInfo(actorID);
124 actorInfo.mFocusOrder = order;
125 mIDAdditionalInfoContainer.erase(actorID);
126 mIDAdditionalInfoContainer.insert(IDAdditionalInfoPair(actorID, actorInfo));
129 void FocusManager::SetAccessibilityAttribute(Actor actor, Toolkit::FocusManager::AccessibilityAttribute type, const std::string& text)
133 unsigned int actorID = actor.GetId();
135 ActorAdditionalInfo info = GetActorAdditionalInfo(actorID);
136 info.mAccessibilityAttributes[type] = text;
138 mIDAdditionalInfoContainer.erase(actorID);
139 mIDAdditionalInfoContainer.insert(IDAdditionalInfoPair(actorID, info));
143 std::string FocusManager::GetAccessibilityAttribute(Actor actor, Toolkit::FocusManager::AccessibilityAttribute type) const
149 ActorAdditionalInfo data = GetActorAdditionalInfo(actor.GetId());
150 text = data.mAccessibilityAttributes[type];
156 void FocusManager::SetFocusOrder(Actor actor, const unsigned int order)
158 // Do nothing if the focus order of the actor is not changed.
159 if(actor && GetFocusOrder(actor) != order)
161 // Firstly delete the actor from the focus chain if it's already there with a different focus order.
162 mFocusIDContainer.erase(GetFocusOrder(actor));
164 // Create actor focusable property if not already created.
165 Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE);
166 if(propertyActorFocusable == Property::INVALID_INDEX)
168 propertyActorFocusable = actor.RegisterProperty(Toolkit::FocusManager::ACTOR_FOCUSABLE, true);
173 // The actor is not focusable without a defined focus order.
174 actor.SetProperty(propertyActorFocusable, false);
176 // If the actor is currently being focused, it should clear the focus
177 if(actor == GetCurrentFocusActor())
182 else // Insert the actor to the focus chain
184 // Check whether there is another actor in the focus chain with the same focus order already.
185 FocusIDIter focusIDIter = mFocusIDContainer.find(order);
186 if(focusIDIter != mFocusIDContainer.end())
188 // We need to increase the focus order of that actor and all the actors followed it
189 // in the focus chain.
190 FocusIDIter lastIter = mFocusIDContainer.end();
191 --lastIter;//We want forward iterator to the last element here
192 mFocusIDContainer.insert(FocusIDPair((*lastIter).first + 1, (*lastIter).second));
194 // Update the actor's focus order in its additional data
195 SynchronizeActorAdditionalInfo((*lastIter).second, (*lastIter).first + 1);
197 for(FocusIDIter iter = lastIter; iter != focusIDIter; iter--)
199 FocusIDIter previousIter = iter;
200 --previousIter;//We want forward iterator to the previous element here
201 unsigned int actorID = (*previousIter).second;
202 (*iter).second = actorID;
204 // Update the actor's focus order in its additional data
205 SynchronizeActorAdditionalInfo(actorID, (*iter).first);
208 mFocusIDContainer.erase(order);
211 // The actor is focusable
212 actor.SetProperty(propertyActorFocusable, true);
214 // Now we insert the actor into the focus chain with the specified focus order
215 mFocusIDContainer.insert(FocusIDPair(order, actor.GetId()));
218 // Update the actor's focus order in its additional data
219 SynchronizeActorAdditionalInfo(actor.GetId(), order);
223 unsigned int FocusManager::GetFocusOrder(Actor actor) const
225 unsigned int focusOrder = 0;
229 ActorAdditionalInfo data = GetActorAdditionalInfo(actor.GetId());
230 focusOrder = data.mFocusOrder;
236 unsigned int FocusManager::GenerateNewFocusOrder() const
238 unsigned int order = 1;
239 FocusIDContainer::const_reverse_iterator iter = mFocusIDContainer.rbegin();
241 if(iter != mFocusIDContainer.rend())
243 order = (*iter).first + 1;
249 Actor FocusManager::GetActorByFocusOrder(const unsigned int order)
251 Actor actor = Actor();
253 FocusIDIter focusIDIter = mFocusIDContainer.find(order);
254 if(focusIDIter != mFocusIDContainer.end())
256 Actor rootActor = Stage::GetCurrent().GetRootLayer();
257 actor = rootActor.FindChildById(mFocusIDContainer[order]);
263 bool FocusManager::SetCurrentFocusActor(Actor actor)
267 return DoSetCurrentFocusActor(actor.GetId());
273 bool FocusManager::DoSetCurrentFocusActor(const unsigned int actorID)
275 Actor rootActor = Stage::GetCurrent().GetRootLayer();
277 // If the group mode is enabled, check which focus group the current focused actor belongs to
279 if(mIsFocusWithinGroup)
281 focusGroup = GetFocusGroup(GetCurrentFocusActor());
286 focusGroup = rootActor;
289 Actor actor = focusGroup.FindChildById(actorID);
291 // Check whether the actor is in the stage
294 // Check whether the actor is focusable
295 bool actorFocusable = false;
296 Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE);
297 if(propertyActorFocusable != Property::INVALID_INDEX)
299 actorFocusable = actor.GetProperty<bool>(propertyActorFocusable);
302 // Go through the actor's hierarchy to check whether the actor is visible
303 bool actorVisible = actor.IsVisible();
304 Actor parent = actor.GetParent();
305 while (actorVisible && parent && parent != rootActor)
307 actorVisible = parent.IsVisible();
308 parent = parent.GetParent();
311 // Check whether the actor is fully transparent
312 bool actorOpaque = actor.GetCurrentWorldColor().a > 0.01f;
314 // Set the focus only when the actor is focusable and visible and not fully transparent
315 if(actorVisible && actorFocusable && actorOpaque)
317 // Draw the focus indicator upon the focused actor
318 if(mIsFocusIndicatorEnabled && mFocusIndicatorActor)
320 actor.Add(mFocusIndicatorActor);
323 // Send notification for the change of focus actor
324 mFocusChangedSignalV2.Emit( GetCurrentFocusActor(), actor );
326 // Save the current focused actor
327 mCurrentFocusActor = FocusIDPair(GetFocusOrder(actor), actorID);
329 if(mIsAccessibilityTtsEnabled)
331 // Play the accessibility attributes with the TTS player.
332 Dali::TtsPlayer player = Dali::TtsPlayer::Get(Dali::TtsPlayer::SCREEN_READER);
334 // Combine attribute texts to one text
335 std::string informationText;
336 for(int i = 0; i < Toolkit::FocusManager::ACCESSIBILITY_ATTRIBUTE_NUM; i++)
338 if(!GetActorAdditionalInfo(actorID).mAccessibilityAttributes[i].empty())
342 informationText += ", "; // for space time between each information
344 informationText += GetActorAdditionalInfo(actorID).mAccessibilityAttributes[i];
347 player.Play(informationText);
354 DALI_LOG_WARNING("[%s:%d] FAILED\n", __FUNCTION__, __LINE__);
358 Actor FocusManager::GetCurrentFocusActor()
360 Actor rootActor = Stage::GetCurrent().GetRootLayer();
361 return rootActor.FindChildById(mCurrentFocusActor.second);
364 Actor FocusManager::GetCurrentFocusGroup()
366 return GetFocusGroup(GetCurrentFocusActor());
369 unsigned int FocusManager::GetCurrentFocusOrder()
371 return mCurrentFocusActor.first;
374 bool FocusManager::MoveFocusForward()
377 mRecursiveFocusMoveCounter = 0;
379 FocusIDIter focusIDIter = mFocusIDContainer.find(mCurrentFocusActor.first);
380 if(focusIDIter != mFocusIDContainer.end())
382 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] focus order : %d\n", __FUNCTION__, __LINE__, (*focusIDIter).first);
383 ret = DoMoveFocus(focusIDIter, true, mIsWrapped);
387 // TODO: if there is not focused actor, move first actor
388 if(!mFocusIDContainer.empty())
390 //if there is not focused actor, move 1st actor
391 focusIDIter = mFocusIDContainer.begin(); // TODO: I'm not sure it was sorted.
392 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] focus order : %d\n", __FUNCTION__, __LINE__, (*focusIDIter).first);
393 ret = DoSetCurrentFocusActor((*focusIDIter).second);
397 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s] %s\n", __FUNCTION__, ret?"SUCCEED!!!":"FAILED!!!");
402 bool FocusManager::MoveFocusBackward()
405 mRecursiveFocusMoveCounter = 0;
407 FocusIDIter focusIDIter = mFocusIDContainer.find(mCurrentFocusActor.first);
408 if(focusIDIter != mFocusIDContainer.end())
410 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] focus order : %d\n", __FUNCTION__, __LINE__, (*focusIDIter).first);
411 ret = DoMoveFocus(focusIDIter, false, mIsWrapped);
415 // TODO: if there is not focused actor, move last actor
416 if(!mFocusIDContainer.empty())
418 //if there is not focused actor, move last actor
419 focusIDIter = mFocusIDContainer.end();
420 --focusIDIter;//We want forward iterator to the last element here
421 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] focus order : %d\n", __FUNCTION__, __LINE__, (*focusIDIter).first);
422 ret = DoSetCurrentFocusActor((*focusIDIter).second);
426 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s] %s\n", __FUNCTION__, ret?"SUCCEED!!!":"FAILED!!!");
431 void FocusManager::DoActivate(Actor actor)
435 Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
438 // Notify the control that it is activated
439 control.GetImplementation().OnActivated();
442 // Send notification for the activation of focused actor
443 mFocusedActorActivatedSignalV2.Emit(actor);
447 void FocusManager::ClearFocus()
449 Actor actor = GetCurrentFocusActor();
452 actor.Remove(mFocusIndicatorActor);
455 mCurrentFocusActor = FocusIDPair(0, 0);
457 // Send notification for the change of focus actor
458 mFocusChangedSignalV2.Emit(actor, Actor());
460 if(mIsAccessibilityTtsEnabled)
462 // Stop the TTS playing if any
463 Dali::TtsPlayer player = Dali::TtsPlayer::Get(Dali::TtsPlayer::SCREEN_READER);
468 void FocusManager::Reset()
471 mFocusIDContainer.clear();
472 mIDAdditionalInfoContainer.clear();
475 void FocusManager::SetFocusGroup(Actor actor, bool isFocusGroup)
479 // Create focus group property if not already created.
480 Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(Toolkit::FocusManager::IS_FOCUS_GROUP);
481 if(propertyIsFocusGroup == Property::INVALID_INDEX)
483 propertyIsFocusGroup = actor.RegisterProperty(Toolkit::FocusManager::IS_FOCUS_GROUP, isFocusGroup);
487 actor.SetProperty(propertyIsFocusGroup, isFocusGroup);
492 bool FocusManager::IsFocusGroup(Actor actor) const
494 // Check whether the actor is a focus group
495 bool isFocusGroup = false;
499 Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(Toolkit::FocusManager::IS_FOCUS_GROUP);
500 if(propertyIsFocusGroup != Property::INVALID_INDEX)
502 isFocusGroup = actor.GetProperty<bool>(propertyIsFocusGroup);
509 Actor FocusManager::GetFocusGroup(Actor actor)
511 // Go through the actor's hierarchy to check which focus group the actor belongs to
512 while (actor && !IsFocusGroup(actor))
514 actor = actor.GetParent();
520 void FocusManager::SetGroupMode(bool enabled)
522 mIsFocusWithinGroup = enabled;
525 bool FocusManager::GetGroupMode() const
527 return mIsFocusWithinGroup;
530 void FocusManager::SetWrapMode(bool wrapped)
532 mIsWrapped = wrapped;
535 bool FocusManager::GetWrapMode() const
540 void FocusManager::SetFocusIndicatorActor(Actor indicator)
542 mFocusIndicatorActor = indicator;
545 Actor FocusManager::GetFocusIndicatorActor()
547 return mFocusIndicatorActor;
550 bool FocusManager::DoMoveFocus(FocusIDIter focusIDIter, bool forward, bool wrapped)
552 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] %d focusable actors\n", __FUNCTION__, __LINE__, mFocusIDContainer.size());
553 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] focus order : %d\n", __FUNCTION__, __LINE__, (*focusIDIter).first);
555 if( (forward && ++focusIDIter == mFocusIDContainer.end())
556 || (!forward && focusIDIter-- == mFocusIDContainer.begin()) )
562 focusIDIter = mFocusIDContainer.begin();
566 focusIDIter = mFocusIDContainer.end();
567 --focusIDIter;//We want forward iterator to the last element here
572 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] Overshot\n", __FUNCTION__, __LINE__);
573 // Send notification for handling overshooted situation
574 mFocusOvershotSignalV2.Emit(GetCurrentFocusActor(), forward ? Toolkit::FocusManager::OVERSHOT_NEXT : Toolkit::FocusManager::OVERSHOT_PREVIOUS);
576 return false; // Try to move the focus out of the scope
580 if((focusIDIter != mFocusIDContainer.end()) && !DoSetCurrentFocusActor((*focusIDIter).second))
582 mRecursiveFocusMoveCounter++;
583 if(mRecursiveFocusMoveCounter > mFocusIDContainer.size())
585 // We've attempted to focus all the actors in the whole focus chain and no actor
586 // can be focused successfully.
588 DALI_LOG_WARNING("[%s] There is no more focusable actor in %d focus chains\n", __FUNCTION__, mRecursiveFocusMoveCounter);
594 return DoMoveFocus(focusIDIter, forward, wrapped);
601 void FocusManager::SetFocusable(Actor actor, bool focusable)
605 // Create actor focusable property if not already created.
606 Property::Index propertyActorFocusable = actor.GetPropertyIndex(Toolkit::FocusManager::ACTOR_FOCUSABLE);
607 if(propertyActorFocusable == Property::INVALID_INDEX)
609 propertyActorFocusable = actor.RegisterProperty(Toolkit::FocusManager::ACTOR_FOCUSABLE, focusable);
613 actor.SetProperty(propertyActorFocusable, focusable);
618 void FocusManager::CreateDefaultFocusIndicatorActor()
620 // Create a focus indicator actor shared by all the focusable actors
621 Image borderImage = Image::New(FOCUS_BORDER_IMAGE_PATH);
623 ImageActor focusIndicator = ImageActor::New(borderImage);
624 focusIndicator.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
625 focusIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
626 focusIndicator.SetNinePatchBorder(FOCUS_BORDER_IMAGE_BORDER);
627 focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
629 // Apply size constraint to the focus indicator
630 Constraint constraint = Constraint::New<Vector3>(Actor::SIZE,
631 ParentSource(Actor::SIZE),
632 EqualToConstraint());
633 focusIndicator.ApplyConstraint(constraint);
635 SetFocusIndicatorActor(focusIndicator);
638 bool FocusManager::ChangeAccessibilityStatus()
640 AccessibilityManager manager = AccessibilityManager::Get();
641 mIsAccessibilityTtsEnabled = manager.IsEnabled();
643 if(mIsAccessibilityTtsEnabled)
645 // Show indicator when tts turned on if there is focused actor.
646 Actor actor = GetCurrentFocusActor();
649 if(mFocusIndicatorActor)
651 actor.Add(mFocusIndicatorActor);
654 mIsFocusIndicatorEnabled = true;
658 // Hide indicator when tts turned off
659 Actor actor = GetCurrentFocusActor();
662 actor.Remove(mFocusIndicatorActor);
664 mIsFocusIndicatorEnabled = false;
670 bool FocusManager::AccessibilityActionNext()
672 if(mIsAccessibilityTtsEnabled)
674 return MoveFocusForward();
682 bool FocusManager::AccessibilityActionPrevious()
684 if(mIsAccessibilityTtsEnabled)
686 return MoveFocusBackward();
694 bool FocusManager::AccessibilityActionActivate()
698 Actor actor = GetCurrentFocusActor();
708 bool FocusManager::AccessibilityActionRead(bool allowReadAgain)
712 if(mIsAccessibilityTtsEnabled)
714 // Find the focusable actor at the read position
715 AccessibilityManager manager = AccessibilityManager::Get();
716 Dali::HitTestAlgorithm::Results results;
717 Dali::HitTestAlgorithm::HitTest( Stage::GetCurrent(), manager.GetReadPosition(), results, IsActorFocusableFunction );
719 FocusIDIter focusIDIter = mFocusIDContainer.find(GetFocusOrder(results.actor));
720 if(focusIDIter != mFocusIDContainer.end())
722 if( allowReadAgain || (results.actor != GetCurrentFocusActor()) )
724 // Move the focus to the actor
725 ret = SetCurrentFocusActor(results.actor);
726 DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] SetCurrentFocusActor returns %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
734 bool FocusManager::AccessibilityActionReadNext()
736 if(mIsAccessibilityTtsEnabled)
738 return MoveFocusForward();
746 bool FocusManager::AccessibilityActionReadPrevious()
748 if(mIsAccessibilityTtsEnabled)
750 return MoveFocusBackward();
758 bool FocusManager::AccessibilityActionUp()
762 if(mIsAccessibilityTtsEnabled)
764 Actor actor = GetCurrentFocusActor();
767 Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
770 // Notify the control that it is activated
771 ret = control.GetImplementation().OnAccessibilityValueChange(true);
779 bool FocusManager::AccessibilityActionDown()
783 if(mIsAccessibilityTtsEnabled)
785 Actor actor = GetCurrentFocusActor();
788 Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor);
791 // Notify the control that it is activated
792 ret = control.GetImplementation().OnAccessibilityValueChange(false);
800 bool FocusManager::ClearAccessibilityFocus()
802 if(mIsAccessibilityTtsEnabled)
813 bool FocusManager::AccessibilityActionBack()
815 // TODO: Back to previous view
817 return mIsAccessibilityTtsEnabled;
820 bool FocusManager::HandlePanGesture(const Integration::PanGestureEvent& panEvent)
822 bool handled = false;
824 Actor currentGesturedActor = GetCurrentFocusActor();
825 Actor rootActor = Stage::GetCurrent().GetRootLayer();
827 Dali::PanGesture pan(panEvent.state);
828 pan.time = panEvent.time;
829 pan.numberOfTouches = panEvent.numberOfTouches;
830 pan.screenPosition = panEvent.currentPosition;
831 pan.screenDisplacement = panEvent.previousPosition - panEvent.currentPosition;
832 pan.screenVelocity.x = pan.screenDisplacement.x / panEvent.timeDelta;
833 pan.screenVelocity.y = pan.screenDisplacement.y / panEvent.timeDelta;
835 // Only handle the pan gesture when the current focused actor is scrollable or within a scrollable actor
836 while(currentGesturedActor && currentGesturedActor != rootActor && !handled)
838 Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(currentGesturedActor);
841 Vector2 localCurrent;
842 control.ScreenToLocal( localCurrent.x, localCurrent.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
843 pan.position = localCurrent;
845 Vector2 localPrevious;
846 control.ScreenToLocal( localPrevious.x, localPrevious.y, panEvent.previousPosition.x, panEvent.previousPosition.y );
848 pan.displacement = localCurrent - localPrevious;
849 pan.velocity.x = pan.displacement.x / panEvent.timeDelta;
850 pan.velocity.y = pan.displacement.y / panEvent.timeDelta;
852 handled = control.GetImplementation().OnAccessibilityPan(pan);
855 // If the gesture is not handled by the control, check its parent
858 currentGesturedActor = currentGesturedActor.GetParent();
862 // If handled, then update the pan gesture properties
863 PanGestureDetector::SetPanGestureProperties( pan );
870 Toolkit::FocusManager::FocusChangedSignalV2& FocusManager::FocusChangedSignal()
872 return mFocusChangedSignalV2;
875 Toolkit::FocusManager::FocusOvershotSignalV2& FocusManager::FocusOvershotSignal()
877 return mFocusOvershotSignalV2;
880 Toolkit::FocusManager::FocusedActorActivatedSignalV2& FocusManager::FocusedActorActivatedSignal()
882 return mFocusedActorActivatedSignalV2;
885 bool FocusManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
887 Dali::BaseHandle handle( object );
889 bool connected( true );
890 FocusManager* manager = dynamic_cast<FocusManager*>(object);
892 if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_CHANGED == signalName )
894 manager->FocusChangedSignal().Connect( tracker, functor );
896 else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_OVERSHOT == signalName )
898 manager->FocusOvershotSignal().Connect( tracker, functor );
900 else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName )
902 manager->FocusedActorActivatedSignal().Connect( tracker, functor );
906 // signalName does not match any signal
913 } // namespace Internal
915 } // namespace Toolkit