1 #ifndef DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_DEVEL_H
2 #define DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_DEVEL_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali-toolkit/public-api/controls/control.h>
25 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
31 namespace DevelKeyboardFocusManager
34 * @brief Interface used to provide custom keyboard focus algorithm for retrieving the next focusable actor.
36 * The application / toolkit can implement the interface and override the keyboard focus behaviour.
37 * Upon providing an implementation of this interface, the PreFocusChangeSignal is no longer emitted.
38 * If focus is changing within a layout container, then the layout container is queried first to provide
39 * the next focusable actor. If this does not provide a valid actor, then the Keyboard FocusManager will
40 * check focusable properties to determine next focusable actor. If focusable properties are not set,
41 * then the Keyboard FocusManager calls the GetNextFocusableActor() method of this interface.
43 class CustomAlgorithmInterface
47 * @brief Virtual destructor.
49 virtual ~CustomAlgorithmInterface(){};
52 * @brief Called by the KeyboardFocusManager to get the next focusable actor.
54 * @param[in] current The current focused actor
55 * @param[in] proposed The proposed focused actor
56 * @param[in] direction The direction of focus movement
57 * @return A handle to the next focusable actor
59 virtual Actor GetNextFocusableActor(Actor current, Actor proposed, Control::KeyboardFocus::Direction direction) = 0;
63 * @brief Provide the implementation of custom Focus algorithm interface
65 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
66 * @param[in] interface The user's implementation of CustomAlgorithmInterface
67 * @see DevelKeyboardFocusManager::CustomAlgorithmInterface
69 DALI_TOOLKIT_API void SetCustomAlgorithm(KeyboardFocusManager keyboardFocusManager, CustomAlgorithmInterface& interface);
72 * @brief Decide using focus indicator or not
74 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
75 * @param[in] enable Whether using focus indicator or not
77 DALI_TOOLKIT_API void EnableFocusIndicator(KeyboardFocusManager keyboardFocusManager, bool enable);
80 * @brief Check focus indicator is enabled or not
82 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
83 * @return True when focus indicator is enabled
85 DALI_TOOLKIT_API bool IsFocusIndicatorEnabled(KeyboardFocusManager keyboardFocusManager);
88 * @brief Decide using default focus algorithm or not
90 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
91 * @param[in] enable Whether using default focus algorithm or not
93 DALI_TOOLKIT_API void EnableDefaultAlgorithm(KeyboardFocusManager keyboardFocusManager, bool enable);
96 * @brief Check default focus algorithm is enabled or not
98 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
99 * @return True when default focus algorithm is enabled
101 DALI_TOOLKIT_API bool IsDefaultAlgorithmEnabled(KeyboardFocusManager keyboardFocusManager);
103 } // namespace DevelKeyboardFocusManager
105 } // namespace Toolkit
109 #endif // DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_DEVEL_H