DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
- // Clear the focus again
- manager.ClearFocus();
-
- // Send the up event for line coverage, but nothing was focued so focus manager will try the initial focus
- preFocusChangeCallback.Reset();
- application.ProcessEvent(upEvent);
- DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
- DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
- DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
- DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
-
- // Clear the focus again
- manager.ClearFocus();
-
- // Send the down event for line coverage, but nothing was focued so focus manager will try the initial focus
- preFocusChangeCallback.Reset();
- application.ProcessEvent(downEvent);
- DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
- DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
- DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
- DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
-
END_TEST;
}
-int UtcDaliKeyboardFocusManagerSignalChangedBySpaceKeyEvent(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliKeyboardFocusManagerSignalChangedBySpaceKeyEvent");
-
- KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK(manager);
-
- bool preFocusChangeSignalVerified = false;
- PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
-
- Integration::KeyEvent spaceEvent( "space", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
-
- // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
- // It makes mIsFocusIndicatorEnabled true
- application.ProcessEvent(spaceEvent);
-
- // Send the space event
- application.ProcessEvent(spaceEvent);
- DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
- DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
-
- // Clear the focus again
- manager.ClearFocus();
-
- // Send the space event again for line coverage
- preFocusChangeCallback.Reset();
- application.ProcessEvent(spaceEvent);
- DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
- DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
- DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
- DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
- END_TEST;
-}
mFocusedActorEnterKeySignal(),
mCurrentFocusActor(),
mFocusIndicatorActor(),
- mIsFocusIndicatorShown( -1 ),
+ mIsFocusIndicatorEnabled( -1 ),
mFocusGroupLoopEnabled( false ),
mIsWaitingKeyboardFocusChangeCommit( false ),
mClearFocusOnTouch( true ),
mEnableFocusIndicator( true ),
- mAlwaysShowIndicator( true ),
mFocusHistory(),
mSlotDelegate( this ),
mCustomAlgorithmInterface(NULL)
{
- // TODO: Get FocusIndicatorEnable constant from stylesheet to set mIsFocusIndicatorShown.
+ // TODO: Get FocusIndicatorEnable constant from stylesheet to set mIsFocusIndicatorEnabled.
Stage::GetCurrent().KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
Stage::GetCurrent().TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
}
if( styleManager )
{
Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
- mAlwaysShowIndicator = config["alwaysShowFocus"].Get<bool>();
- mIsFocusIndicatorShown = static_cast<int>(mAlwaysShowIndicator);
- mClearFocusOnTouch = mIsFocusIndicatorShown ? false : true;
+ mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
+ mClearFocusOnTouch = mIsFocusIndicatorEnabled ? false : true;
}
}
{
DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" );
- if( mIsFocusIndicatorShown == -1 )
+ if( mIsFocusIndicatorEnabled == -1 )
{
GetConfigurationFromStyleManger();
}
// Check whether the actor is in the stage and is keyboard focusable.
if( actor && actor.IsKeyboardFocusable() && actor.OnStage() )
{
- if( mIsFocusIndicatorShown && mEnableFocusIndicator )
+ if( mIsFocusIndicatorEnabled && mEnableFocusIndicator )
{
actor.Add( GetFocusIndicatorActor() );
}
}
mCurrentFocusActor.Reset();
- mIsFocusIndicatorShown = static_cast<int>(mAlwaysShowIndicator);
+ mIsFocusIndicatorEnabled = 0;
}
void KeyboardFocusManager::SetFocusGroupLoop(bool enabled)
std::string keyName = event.keyPressedName;
- if( mIsFocusIndicatorShown == -1 )
+ if( mIsFocusIndicatorEnabled == -1 )
{
GetConfigurationFromStyleManger();
}
{
if(!isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
{
if(!isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
else if (keyName == "Up" && !isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
else if (keyName == "Down" && !isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
else if (keyName == "Prior" && !isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
else if (keyName == "Next" && !isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
else if (keyName == "Tab" && !isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
else if (keyName == "space" && !isAccessibilityEnabled)
{
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
isFocusStartableKey = true;
else if (keyName == "" && !isAccessibilityEnabled)
{
// Check the fake key event for evas-plugin case
- if(!mIsFocusIndicatorShown)
+ if(!mIsFocusIndicatorEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
isFocusStartableKey = true;
{
if (keyName == "Return")
{
- if(!mIsFocusIndicatorShown && !isAccessibilityEnabled)
+ if(!mIsFocusIndicatorEnabled && !isAccessibilityEnabled)
{
// Show focus indicator
- mIsFocusIndicatorShown = 1;
+ mIsFocusIndicatorEnabled = 1;
}
else
{
}
}
- if(isFocusStartableKey && mIsFocusIndicatorShown && !isAccessibilityEnabled)
+ if(isFocusStartableKey && mIsFocusIndicatorEnabled && !isAccessibilityEnabled)
{
Actor actor = GetCurrentFocusActor();
if( actor )
void KeyboardFocusManager::OnTouch(const TouchData& touch)
{
- // if mIsFocusIndicatorShown is -1, it means Configuration is not loaded.
+ // if mIsFocusIndicatorEnabled is -1, it means Configuration is not loaded.
// Try to load configuration.
- if( mIsFocusIndicatorShown == -1 )
+ if( mIsFocusIndicatorEnabled == -1 )
{
GetConfigurationFromStyleManger();
}