Add spatial navigation API in EFL port

https://bugs.webkit.org/show_bug.cgi?id=125002

Patch by Dariusz Frankiewicz <d.frankiewic@samsung.com> on 2013-12-03
Reviewed by Gyuyoung Kim.

API enables capability of turning on and off spatial navigation
and check is state.
Spatial navigation is the ability to navigate between focusable
elements by keyboard.

* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_spatial_navigation_enabled_set):
(ewk_settings_spatial_navigation_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a536ab9e
2013-12-03 Dariusz Frankiewicz <d.frankiewic@samsung.com>
Add spatial navigation API in EFL port
https://bugs.webkit.org/show_bug.cgi?id=125002
Reviewed by Gyuyoung Kim.
API enables capability of turning on and off spatial navigation
and check is state.
Spatial navigation is the ability to navigate between focusable
elements by keyboard.
* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_spatial_navigation_enabled_set):
(ewk_settings_spatial_navigation_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):
2013-12-02 Zan Dobersek <zdobersek@igalia.com>
Build fixes for GCC-using ports after r159965 and later
......
......@@ -318,3 +318,18 @@ Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings* settings)
#endif
}
Eina_Bool ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
settings->preferences()->setSpatialNavigationEnabled(enable);
return true;
}
Eina_Bool ewk_settings_spatial_navigation_enabled_get(const Ewk_Settings* settings)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
return settings->preferences()->spatialNavigationEnabled();
}
......@@ -444,6 +444,27 @@ EAPI Eina_Bool ewk_settings_text_autosizing_enabled_set(Ewk_Settings *settings,
*/
EAPI Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings *settings);
/**
* Changes spatial navigation state.
*
* @param settings settings object to enable/disable spatial navigation
* @param enabled @c EINA_TRUE to enable spatial navigation
* @c EINA_FALSE to disable spatial navigation
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_settings_spatial_navigation_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
/**
* Returns current state of spatial navigation.
*
* @param settings settings object to get whether spatial navigation is enabled
*
* @return @c EINA_TRUE if spatial navigation is enabled
* @c EINA_FALSE if spatial navigation is disabled
*/
EAPI Eina_Bool ewk_settings_spatial_navigation_enabled_get(const Ewk_Settings *settings);
#ifdef __cplusplus
}
#endif
......
......@@ -287,3 +287,17 @@ TEST_F(EWK2UnitTestBase, ewk_settings_text_autosizing_enabled)
ASSERT_FALSE(ewk_settings_text_autosizing_enabled_get(settings));
#endif
}
TEST_F(EWK2UnitTestBase, ewk_settings_spatial_navigation_enabled)
{
Ewk_Settings* settings = ewk_view_settings_get(webView());
// Spatial navigation is disabled by default.
ASSERT_FALSE(ewk_settings_spatial_navigation_enabled_get(settings));
ASSERT_TRUE(ewk_settings_spatial_navigation_enabled_set(settings, true));
ASSERT_TRUE(ewk_settings_spatial_navigation_enabled_get(settings));
ASSERT_TRUE(ewk_settings_spatial_navigation_enabled_set(settings, false));
ASSERT_FALSE(ewk_settings_spatial_navigation_enabled_get(settings));
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment