-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
// CLASS HEADER
#include "keyboard-focus-manager-impl.h"
+// EXTERNAL INCLUDES
+#include <cstring> // for strcmp
+#include <dali/public-api/actors/layer.h>
+#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/events/key-event.h>
+#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/images/resource-image.h>
+#include <dali/integration-api/debug.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
-#include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
-#include <dali/integration-api/debug.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
namespace Dali
{
namespace Internal
{
-namespace // unnamed namespace
+namespace // Unnamed namespace
{
#if defined(DEBUG_ENABLED)
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_KEYBOARD_FOCUS_MANAGER");
#endif
-const std::string IS_FOCUS_GROUP_PROPERTY_NAME("is-keyboard-focus-group"); // This property will be replaced by a flag in ControlImpl.
+const char* const IS_FOCUS_GROUP_PROPERTY_NAME = "isKeyboardFocusGroup"; // This property will be replaced by a flag in Control.
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.png";
-const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
+const char* const FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.9.png";
BaseHandle Create()
{
BaseHandle handle = KeyboardFocusManager::Get();
- if ( !handle && Adaptor::IsAvailable() )
+ if ( !handle )
{
- Toolkit::KeyboardFocusManager manager = Toolkit::KeyboardFocusManager( new Internal::KeyboardFocusManager() );
- Adaptor::Get().RegisterSingleton( typeid( manager ), manager );
- handle = manager;
+ SingletonService singletonService( SingletonService::Get() );
+ if ( singletonService )
+ {
+ Toolkit::KeyboardFocusManager manager = Toolkit::KeyboardFocusManager( new Internal::KeyboardFocusManager() );
+ singletonService.Register( typeid( manager ), manager );
+ handle = manager;
+ }
}
return handle;
}
-TypeRegistration KEYBOARD_FOCUS_MANAGER_TYPE( typeid(Dali::Toolkit::KeyboardFocusManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
+
+DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::KeyboardFocusManager, Dali::BaseHandle, Create, true )
+
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardPreFocusChange", SIGNAL_PRE_FOCUS_CHANGE )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusChanged", SIGNAL_FOCUS_CHANGED )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusGroupChanged", SIGNAL_FOCUS_GROUP_CHANGED )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusedActorEnterKey", SIGNAL_FOCUSED_ACTOR_ENTER_KEY )
+
+DALI_TYPE_REGISTRATION_END()
} // unnamed namespace
{
Toolkit::KeyboardFocusManager manager;
- if ( Adaptor::IsAvailable() )
+ SingletonService singletonService( SingletonService::Get() );
+ if ( singletonService )
{
// Check whether the keyboard focus manager is already created
- Dali::BaseHandle handle = Dali::Adaptor::Get().GetSingleton( typeid( Toolkit::KeyboardFocusManager ) );
+ Dali::BaseHandle handle = singletonService.GetSingleton( typeid( Toolkit::KeyboardFocusManager ) );
if(handle)
{
// If so, downcast the handle of singleton to keyboard focus manager
KeyboardFocusManager::KeyboardFocusManager()
: mCurrentFocusActor(0),
- mFocusIndicatorActor(Actor()),
+ mFocusIndicatorActor(),
mFocusGroupLoopEnabled(false),
mIsKeyboardFocusEnabled(false),
mIsFocusIndicatorEnabled(false),
mIsWaitingKeyboardFocusChangeCommit(false),
mSlotDelegate(this)
{
- CreateDefaultFocusIndicatorActor();
-
OnPhysicalKeyboardStatusChanged(PhysicalKeyboard::Get());
Toolkit::KeyInputFocusManager::Get().UnhandledKeyEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
- Stage::GetCurrent().TouchedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnTouched);
+ Stage::GetCurrent().TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
PhysicalKeyboard::Get().StatusChangedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnPhysicalKeyboardStatusChanged);
}
{
}
-bool KeyboardFocusManager::SetCurrentFocusActor(Actor actor)
+bool KeyboardFocusManager::SetCurrentFocusActor( Actor actor )
{
DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" );
- if(actor)
+ if( actor )
{
- return DoSetCurrentFocusActor(actor.GetId());
+ return DoSetCurrentFocusActor( actor.GetId() );
}
return false;
}
-bool KeyboardFocusManager::DoSetCurrentFocusActor(const unsigned int actorID)
+bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID )
{
Actor rootActor = Stage::GetCurrent().GetRootLayer();
- Actor actor = rootActor.FindChildById(actorID);
+ Actor actor = rootActor.FindChildById( actorID );
+ bool success = false;
- // Check whether the actor is in the stage
- if(actor)
+ // Check whether the actor is in the stage and is keyboard focusable.
+ if( actor && actor.IsKeyboardFocusable() )
{
- // Set the focus only when the actor is keyboard focusable
- if(actor.IsKeyboardFocusable())
- {
- // Draw the focus indicator upon the focused actor
- if(mIsFocusIndicatorEnabled && mFocusIndicatorActor)
- {
- actor.Add(mFocusIndicatorActor);
- }
-
- // Send notification for the change of focus actor
- if( !mFocusChangedSignalV2.Empty() )
- {
- mFocusChangedSignalV2.Emit(GetCurrentFocusActor(), actor);
- }
+ mIsFocusIndicatorEnabled = true;
+ // Draw the focus indicator upon the focused actor
+ actor.Add( GetFocusIndicatorActor() );
- DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] Focus Changed\n", __FUNCTION__, __LINE__);
+ // Send notification for the change of focus actor
+ if( !mFocusChangedSignal.Empty() )
+ {
+ mFocusChangedSignal.Emit(GetCurrentFocusActor(), actor);
+ }
- // Save the current focused actor
- mCurrentFocusActor = actorID;
+ DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] Focus Changed\n", __FUNCTION__, __LINE__);
- // Move the accessibility focus to the same actor
-// Toolkit::FocusManager focusManager = Toolkit::FocusManager::Get();
-// focusManager.SetCurrentFocusActor(actor);
+ // Save the current focused actor
+ mCurrentFocusActor = actorID;
- DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] SUCCEED\n", __FUNCTION__, __LINE__);
- return true;
- }
+ DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] SUCCEED\n", __FUNCTION__, __LINE__);
+ success = true;
+ }
+ else
+ {
+ DALI_LOG_WARNING("[%s:%d] FAILED\n", __FUNCTION__, __LINE__);
}
- DALI_LOG_WARNING("[%s:%d] FAILED\n", __FUNCTION__, __LINE__);
- return false;
+ return success;
}
Actor KeyboardFocusManager::GetCurrentFocusActor()
bool KeyboardFocusManager::IsLayoutControl(Actor actor) const
{
Toolkit::Control control = Toolkit::Control::DownCast(actor);
- return control && control.GetImplementation().IsKeyboardNavigationSupported();
+ return control && GetImplementation( control ).IsKeyboardNavigationSupported();
}
Toolkit::Control KeyboardFocusManager::GetParentLayoutControl(Actor actor) const
return Toolkit::Control::DownCast(parent);
}
-bool KeyboardFocusManager::MoveFocus(Toolkit::Control::KeyboardFocusNavigationDirection direction)
+bool KeyboardFocusManager::MoveFocus(Toolkit::Control::KeyboardFocus::Direction direction)
{
Actor currentFocusActor = GetCurrentFocusActor();
parentLayoutControl = GetParentLayoutControl(parentLayoutControl);
}
- if(!succeed && !mPreFocusChangeSignalV2.Empty())
+ if(!succeed && !mPreFocusChangeSignal.Empty())
{
// Don't know how to move the focus further. The application needs to tell us which actor to move the focus to
mIsWaitingKeyboardFocusChangeCommit = true;
- Actor nextFocusableActor = mPreFocusChangeSignalV2.Emit(currentFocusActor, Actor(), direction);
+ Actor nextFocusableActor = mPreFocusChangeSignal.Emit(currentFocusActor, Actor(), direction);
mIsWaitingKeyboardFocusChangeCommit = false;
if ( nextFocusableActor && nextFocusableActor.IsKeyboardFocusable() )
return succeed;
}
-bool KeyboardFocusManager::DoMoveFocusWithinLayoutControl(Toolkit::Control control, Actor actor, Toolkit::Control::KeyboardFocusNavigationDirection direction)
+bool KeyboardFocusManager::DoMoveFocusWithinLayoutControl(Toolkit::Control control, Actor actor, Toolkit::Control::KeyboardFocus::Direction direction)
{
// Ask the control for the next actor to focus
- Actor nextFocusableActor = control.GetImplementation().GetNextKeyboardFocusableActor(actor, direction, mFocusGroupLoopEnabled);
+ Actor nextFocusableActor = GetImplementation( control ).GetNextKeyboardFocusableActor(actor, direction, mFocusGroupLoopEnabled);
if(nextFocusableActor)
{
if(!nextFocusableActor.IsKeyboardFocusable())
// We will try to move the focus to the actor. Emit a signal to notify the proposed actor to focus
// Signal handler can check the proposed actor and return a different actor if it wishes.
- if( !mPreFocusChangeSignalV2.Empty() )
+ if( !mPreFocusChangeSignal.Empty() )
{
mIsWaitingKeyboardFocusChangeCommit = true;
- committedFocusActor = mPreFocusChangeSignalV2.Emit(currentFocusActor, nextFocusableActor, direction);
+ committedFocusActor = mPreFocusChangeSignal.Emit(currentFocusActor, nextFocusableActor, direction);
mIsWaitingKeyboardFocusChangeCommit = false;
}
// If the application hasn't changed our proposed actor, we informs the layout control we will
// move the focus to what the control returns. The control might wish to perform some actions
// before the focus is actually moved.
- control.GetImplementation().OnKeyboardFocusChangeCommitted(committedFocusActor);
+ GetImplementation( control ).OnKeyboardFocusChangeCommitted( committedFocusActor );
}
return SetCurrentFocusActor(committedFocusActor);
{
// If the current focus group has a parent layout control, we can probably automatically
// move the focus to the next focus group in the forward or backward direction.
- Toolkit::Control::KeyboardFocusNavigationDirection direction = forward ? Toolkit::Control::Right : Toolkit::Control::Left;
+ Toolkit::Control::KeyboardFocus::Direction direction = forward ? Toolkit::Control::KeyboardFocus::RIGHT : Toolkit::Control::KeyboardFocus::LEFT;
succeed = DoMoveFocusWithinLayoutControl(parentLayoutControl, GetCurrentFocusActor(), direction);
parentLayoutControl = GetParentLayoutControl(parentLayoutControl);
}
- if(!mFocusGroupChangedSignalV2.Empty())
+ if(!mFocusGroupChangedSignal.Empty())
{
// Emit a focus group changed signal. The applicaton can move the focus to a new focus group
- mFocusGroupChangedSignalV2.Emit(GetCurrentFocusActor(), forward);
+ mFocusGroupChangedSignal.Emit(GetCurrentFocusActor(), forward);
}
return succeed;
}
-void KeyboardFocusManager::DoActivate(Actor actor)
+void KeyboardFocusManager::DoKeyboardEnter(Actor actor)
{
- if(actor)
+ if( actor )
{
- Toolkit::Control control = Toolkit::Control::DownCast(actor);
- if(control)
+ Toolkit::Control control = Toolkit::Control::DownCast( actor );
+ if( control )
{
- // Notify the control that it is activated
- control.GetImplementation().OnActivated();
+ // Notify the control that enter has been pressed on it.
+ GetImplementation( control ).KeyboardEnter();
}
- // Send notification for the activation of focused actor
- if( !mFocusedActorActivatedSignalV2.Empty() )
+ // Send a notification for the actor.
+ if( !mFocusedActorEnterKeySignal.Empty() )
{
- mFocusedActorActivatedSignalV2.Emit(actor);
+ mFocusedActorEnterKeySignal.Emit( actor );
}
}
}
Actor actor = GetCurrentFocusActor();
if(actor)
{
- actor.Remove(mFocusIndicatorActor);
+ if(mFocusIndicatorActor)
+ {
+ actor.Remove(mFocusIndicatorActor);
+ }
// Send notification for the change of focus actor
- if( !mFocusChangedSignalV2.Empty() )
+ if( !mFocusChangedSignal.Empty() )
{
- mFocusChangedSignalV2.Emit(actor, Actor());
+ mFocusChangedSignal.Emit(actor, Actor());
}
}
{
if(actor)
{
- // Create focus group property if not already created.
- Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(IS_FOCUS_GROUP_PROPERTY_NAME);
- if(propertyIsFocusGroup == Property::INVALID_INDEX)
- {
- propertyIsFocusGroup = actor.RegisterProperty(IS_FOCUS_GROUP_PROPERTY_NAME, isFocusGroup);
- }
- else
- {
- actor.SetProperty(propertyIsFocusGroup, isFocusGroup);
- }
+ // Create/Set focus group property.
+ actor.RegisterProperty( IS_FOCUS_GROUP_PROPERTY_NAME, isFocusGroup, Property::READ_WRITE );
}
}
void KeyboardFocusManager::SetFocusIndicatorActor(Actor indicator)
{
- mFocusIndicatorActor = indicator;
-}
+ if(mFocusIndicatorActor != indicator)
+ {
+ Actor currentFocusActor = GetCurrentFocusActor();
+ if(currentFocusActor)
+ {
+ // The new focus indicator should be added to the current focused actor immediately
+ if(mFocusIndicatorActor)
+ {
+ currentFocusActor.Remove(mFocusIndicatorActor);
+ }
-Actor KeyboardFocusManager::GetFocusIndicatorActor()
-{
- return mFocusIndicatorActor;
+ if(indicator)
+ {
+ currentFocusActor.Add(indicator);
+ }
+ }
+
+ mFocusIndicatorActor = indicator;
+ }
}
-void KeyboardFocusManager::CreateDefaultFocusIndicatorActor()
+Actor KeyboardFocusManager::GetFocusIndicatorActor()
{
- // Create a focus indicator actor shared by all the keyboard focusable actors
- Image borderImage = Image::New(FOCUS_BORDER_IMAGE_PATH);
-
- ImageActor focusIndicator = ImageActor::New(borderImage);
- focusIndicator.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
- focusIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
- focusIndicator.SetNinePatchBorder(FOCUS_BORDER_IMAGE_BORDER);
- focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
+ 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 );
+ mFocusIndicatorActor.SetParentOrigin( ParentOrigin::CENTER );
- // Apply size constraint to the focus indicator
- Constraint constraint = Constraint::New<Vector3>(Actor::SIZE,
- ParentSource(Actor::SIZE),
- EqualToConstraint());
- focusIndicator.ApplyConstraint(constraint);
+ // Apply size constraint to the focus indicator
+ mFocusIndicatorActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ }
- SetFocusIndicatorActor(focusIndicator);
+ return mFocusIndicatorActor;
}
void KeyboardFocusManager::OnPhysicalKeyboardStatusChanged(PhysicalKeyboard keyboard)
Actor actor = GetCurrentFocusActor();
if(actor)
{
- if(mFocusIndicatorActor)
- {
- actor.Add(mFocusIndicatorActor);
- }
+ actor.Add( GetFocusIndicatorActor() );
}
mIsFocusIndicatorEnabled = true;
}
{
// Hide indicator when keyboard focus turned off
Actor actor = GetCurrentFocusActor();
- if(actor)
+ if( actor && mFocusIndicatorActor )
{
- actor.Remove(mFocusIndicatorActor);
+ actor.Remove( mFocusIndicatorActor );
}
mIsFocusIndicatorEnabled = false;
}
return;
}
- AccessibilityManager accessibilityManager = AccessibilityManager::Get();
- bool isAccessibilityEnabled = accessibilityManager.IsEnabled();
+ AccessibilityAdaptor accessibilityAdaptor = AccessibilityAdaptor::Get();
+ bool isAccessibilityEnabled = accessibilityAdaptor.IsEnabled();
- Toolkit::FocusManager accessibilityFocusManager = Toolkit::FocusManager::Get();
+ Toolkit::AccessibilityManager accessibilityManager = Toolkit::AccessibilityManager::Get();
std::string keyName = event.keyPressedName;
else
{
// Move the focus towards left
- MoveFocus(Toolkit::Control::Left);
+ MoveFocus(Toolkit::Control::KeyboardFocus::LEFT);
}
isFocusStartableKey = true;
else
{
// Move the accessibility focus backward
- accessibilityFocusManager.MoveFocusBackward();
+ accessibilityManager.MoveFocusBackward();
}
}
else if (keyName == "Right")
else
{
// Move the focus towards right
- MoveFocus(Toolkit::Control::Right);
+ MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT);
}
-
- isFocusStartableKey = true;
}
else
{
// Move the accessibility focus forward
- accessibilityFocusManager.MoveFocusForward();
+ accessibilityManager.MoveFocusForward();
}
isFocusStartableKey = true;
else
{
// Move the focus towards up
- MoveFocus(Toolkit::Control::Up);
+ MoveFocus(Toolkit::Control::KeyboardFocus::UP);
}
isFocusStartableKey = true;
else
{
// Move the focus towards down
- MoveFocus(Toolkit::Control::Down);
+ MoveFocus(Toolkit::Control::KeyboardFocus::DOWN);
}
isFocusStartableKey = true;
}
else
{
- // Activate the focused actor
+ // The focused actor has enter pressed on it
Actor actor;
- if(!isAccessibilityEnabled)
+ if( !isAccessibilityEnabled )
{
actor = GetCurrentFocusActor();
}
else
{
- actor = accessibilityFocusManager.GetCurrentFocusActor();
+ actor = accessibilityManager.GetCurrentFocusActor();
}
- if(actor)
+ if( actor )
{
- DoActivate(actor);
+ DoKeyboardEnter( actor );
}
}
if(isFocusStartableKey && mIsFocusIndicatorEnabled && !isAccessibilityEnabled)
{
Actor actor = GetCurrentFocusActor();
- if( !actor )
+ if( actor )
{
- // No actor is focused but keyboard focus is activated by the key press
- // Let's try to move the initial focus
- MoveFocus(Toolkit::Control::Right);
+ // Make sure the focused actor is highlighted
+ actor.Add( GetFocusIndicatorActor() );
}
- else if(mFocusIndicatorActor)
+ else
{
- // Make sure the focused actor is highlighted
- actor.Add(mFocusIndicatorActor);
+ // No actor is focused but keyboard focus is activated by the key press
+ // Let's try to move the initial focus
+ MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT);
}
}
}
-void KeyboardFocusManager::OnTouched(const TouchEvent& touchEvent)
+void KeyboardFocusManager::OnTouch(const TouchData& touch)
{
- // Clear the focus when user touch the screen
- ClearFocus();
+ // Clear the focus when user touch the screen.
+ // We only do this on a Down event, otherwise the clear action may override a manually focused actor.
+ if( ( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN ) )
+ {
+ ClearFocus();
+ }
}
-Toolkit::KeyboardFocusManager::PreFocusChangeSignalV2& KeyboardFocusManager::PreFocusChangeSignal()
+Toolkit::KeyboardFocusManager::PreFocusChangeSignalType& KeyboardFocusManager::PreFocusChangeSignal()
{
- return mPreFocusChangeSignalV2;
+ return mPreFocusChangeSignal;
}
-Toolkit::KeyboardFocusManager::FocusChangedSignalV2& KeyboardFocusManager::FocusChangedSignal()
+Toolkit::KeyboardFocusManager::FocusChangedSignalType& KeyboardFocusManager::FocusChangedSignal()
{
- return mFocusChangedSignalV2;
+ return mFocusChangedSignal;
}
-Toolkit::KeyboardFocusManager::FocusGroupChangedSignalV2& KeyboardFocusManager::FocusGroupChangedSignal()
+Toolkit::KeyboardFocusManager::FocusGroupChangedSignalType& KeyboardFocusManager::FocusGroupChangedSignal()
{
- return mFocusGroupChangedSignalV2;
+ return mFocusGroupChangedSignal;
}
-Toolkit::KeyboardFocusManager::FocusedActorActivatedSignalV2& KeyboardFocusManager::FocusedActorActivatedSignal()
+Toolkit::KeyboardFocusManager::FocusedActorEnterKeySignalType& KeyboardFocusManager::FocusedActorEnterKeySignal()
{
- return mFocusedActorActivatedSignalV2;
+ return mFocusedActorEnterKeySignal;
}
bool KeyboardFocusManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
Dali::BaseHandle handle( object );
bool connected( true );
- KeyboardFocusManager* manager = dynamic_cast<KeyboardFocusManager*>(object);
+ KeyboardFocusManager* manager = dynamic_cast<KeyboardFocusManager*>( object );
- if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_PRE_FOCUS_CHANGE == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_PRE_FOCUS_CHANGE ) )
{
manager->PreFocusChangeSignal().Connect( tracker, functor );
}
- if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUS_CHANGED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
{
manager->FocusChangedSignal().Connect( tracker, functor );
}
- if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUS_GROUP_CHANGED == signalName )
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_GROUP_CHANGED ) )
{
manager->FocusGroupChangedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName )
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ENTER_KEY ) )
{
- manager->FocusedActorActivatedSignal().Connect( tracker, functor );
+ manager->FocusedActorEnterKeySignal().Connect( tracker, functor );
}
else
{