1 #ifndef DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_DEVEL_H
2 #define DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_DEVEL_H
5 * Copyright (c) 2018 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>
33 namespace DevelKeyboardFocusManager
36 * @brief Interface used to provide custom keyboard focus algorithm for retrieving the next focusable actor.
38 * The application / toolkit can implement the interface and override the keyboard focus behaviour.
39 * Upon providing an implementation of this interface, the PreFocusChangeSignal is no longer emitted.
40 * If focus is changing within a layout container, then the layout container is queried first to provide
41 * the next focusable actor. If this does not provide a valid actor, then the Keyboard FocusManager will
42 * check focusable properties to determine next focusable actor. If focusable properties are not set,
43 * then the Keyboard FocusManager calls the GetNextFocusableActor() method of this interface.
45 class CustomAlgorithmInterface
50 * @brief Virtual destructor.
52 virtual ~CustomAlgorithmInterface() {};
55 * @brief Called by the KeyboardFocusManager to get the next focusable actor.
57 * @param[in] current The current focused actor
58 * @param[in] proposed The proposed focused actor
59 * @param[in] direction The direction of focus movement
60 * @return A handle to the next focusable actor
62 virtual Actor GetNextFocusableActor(Actor current, Actor proposed, Control::KeyboardFocus::Direction direction) = 0;
66 * @brief Provide the implementation of custom Focus algorithm interface
68 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
69 * @param[in] interface The user's implementation of CustomAlgorithmInterface
70 * @see DevelKeyboardFocusManager::CustomAlgorithmInterface
72 DALI_TOOLKIT_API void SetCustomAlgorithm(KeyboardFocusManager keyboardFocusManager, CustomAlgorithmInterface& interface);
75 * @brief Decide using focus indicator or not
77 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
78 * @param[in] enable Whether using focus indicator or not
80 DALI_TOOLKIT_API void EnableFocusIndicator(KeyboardFocusManager keyboardFocusManager, bool enable);
83 * @brief Check focus indicator is enabled or not
85 * @param[in] keyboardFocusManager The instance of KeyboardFocusManager
86 * @return True when focus indicator is enabled
88 DALI_TOOLKIT_API bool IsFocusIndicatorEnabled(KeyboardFocusManager keyboardFocusManager);
90 } // namespace DevelKeyboardFocusManager
92 } // namespace Toolkit
96 #endif // DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_DEVEL_H