Tizen Native API
5.0
|
Provides the functionality of handling keyboard navigation and maintaining the two dimensional keyboard focus chain. More...
Public Types | |
typedef Signal< Actor(Actor, Actor, Control::KeyboardFocus::Direction) > | PreFocusChangeSignalType |
Pre focus change signal. | |
typedef Signal< void(Actor, Actor) > | FocusChangedSignalType |
Focus changed signal. | |
typedef Signal< void(Actor, bool) > | FocusGroupChangedSignalType |
Focus group changed signal. | |
typedef Signal< void(Actor) > | FocusedActorEnterKeySignalType |
Focused actor has the enter key pressed signal. | |
Public Member Functions | |
KeyboardFocusManager () | |
Creates a KeyboardFocusManager handle; this can be initialized with KeyboardFocusManager::New(). | |
~KeyboardFocusManager () | |
Destructor. | |
bool | SetCurrentFocusActor (Actor actor) |
Moves the keyboard focus to the given actor. | |
Actor | GetCurrentFocusActor () |
Gets the current focused actor. | |
bool | MoveFocus (Control::KeyboardFocus::Direction direction) |
Moves the focus to the next focusable actor in the focus chain in the given direction (according to the focus traversal order). | |
void | ClearFocus () |
Clears the focus from the current focused actor if any, so that no actor is focused in the focus chain. | |
void | SetFocusGroupLoop (bool enabled) |
Sets whether the focus movement should be looped within the same focus group. | |
bool | GetFocusGroupLoop () const |
Gets whether the focus movement should be looped within the same focus group. | |
void | SetAsFocusGroup (Actor actor, bool isFocusGroup) |
Sets whether an actor is a focus group that can limit the scope of focus movement to its child actors in the focus chain. | |
bool | IsFocusGroup (Actor actor) const |
Checks whether the actor is set as a focus group or not. | |
Actor | GetFocusGroup (Actor actor) |
Returns the closest ancestor of the given actor that is a focus group. | |
void | SetFocusIndicatorActor (Actor indicator) |
Sets the focus indicator actor. | |
Actor | GetFocusIndicatorActor () |
Gets the focus indicator actor. | |
void | MoveFocusBackward () |
Move the focus to prev focused actor. | |
PreFocusChangeSignalType & | PreFocusChangeSignal () |
This signal is emitted before the focus is going to be changed. | |
FocusChangedSignalType & | FocusChangedSignal () |
This signal is emitted after the current focused actor has been changed. | |
FocusGroupChangedSignalType & | FocusGroupChangedSignal () |
This signal is emitted when the focus group has been changed. | |
FocusedActorEnterKeySignalType & | FocusedActorEnterKeySignal () |
This signal is emitted when the current focused actor has the enter key pressed on it. | |
Static Public Member Functions | |
static KeyboardFocusManager | Get () |
Gets the singleton of KeyboardFocusManager object. |
Provides the functionality of handling keyboard navigation and maintaining the two dimensional keyboard focus chain.
It provides functionality of setting the focus and moving the focus in four directions (i.e. Left, Right, Up and Down). It also draws a highlight for the focused actor and emits a signal when the focus is changed.
Signals | Signal Name | Method | |------------------------------|------------------------------------| | keyboardPreFocusChange | PreFocusChangeSignal() | | keyboardFocusChanged | FocusChangedSignal() | | keyboardFocusGroupChanged | FocusGroupChangedSignal() | | keyboardFocusedActorEnterKey | FocusedActorEnterKeySignal() |
Creates a KeyboardFocusManager handle; this can be initialized with KeyboardFocusManager::New().
Calling member functions with an uninitialized handle is not allowed.
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
Clears the focus from the current focused actor if any, so that no actor is focused in the focus chain.
It will emit focus changed signal without current focused actor.
This signal is emitted after the current focused actor has been changed.
A callback of the following type may be connected:
void YourCallbackName(Actor originalFocusedActor, Actor currentFocusedActor);
This signal is emitted when the current focused actor has the enter key pressed on it.
A callback of the following type may be connected:
void YourCallbackName(Actor enterPressedActor);
This signal is emitted when the focus group has been changed.
If the current focus group has a parent layout control, KeyboardFocusManager will make the best guess for the next focus group to move the focus to in the given direction (forward or backward). If not, the application has to set the new focus.
A callback of the following type may be connected:
void YourCallbackName(Actor currentFocusedActor, bool forward);
static KeyboardFocusManager Dali::Toolkit::KeyboardFocusManager::Get | ( | ) | [static] |
Gets the singleton of KeyboardFocusManager object.
Gets the current focused actor.
Returns the closest ancestor of the given actor that is a focus group.
actor | The actor to be checked for its focus group |
bool Dali::Toolkit::KeyboardFocusManager::GetFocusGroupLoop | ( | ) | const |
Gets whether the focus movement should be looped within the same focus group.
Gets the focus indicator actor.
bool Dali::Toolkit::KeyboardFocusManager::IsFocusGroup | ( | Actor | actor | ) | const |
Checks whether the actor is set as a focus group or not.
actor | The actor to be checked |
Moves the focus to the next focusable actor in the focus chain in the given direction (according to the focus traversal order).
direction | The direction of focus movement |
Move the focus to prev focused actor.
This signal is emitted before the focus is going to be changed.
KeyboardFocusManager makes the best guess for which actor to focus towards the given direction, but applications might want to change that. By connecting with this signal, they can check the proposed actor to focus and return a different actor if they wish. This signal is only emitted when the navigation key is pressed and KeyboardFocusManager tries to move the focus automatically. It won't be emitted for focus movement by calling SetCurrentFocusActor directly.
A callback of the following type may be connected:
Actor YourCallbackName(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocus::Direction direction);
void Dali::Toolkit::KeyboardFocusManager::SetAsFocusGroup | ( | Actor | actor, |
bool | isFocusGroup | ||
) |
Sets whether an actor is a focus group that can limit the scope of focus movement to its child actors in the focus chain.
Layout controls set themselves as focus groups by default.
actor | The actor to be set as a focus group |
isFocusGroup | Whether to set the actor as a focus group or not |
Moves the keyboard focus to the given actor.
Only one actor can be focused at the same time. The actor must be in the stage already and keyboard focusable.
actor | The actor to be focused |
void Dali::Toolkit::KeyboardFocusManager::SetFocusGroupLoop | ( | bool | enabled | ) |
Sets whether the focus movement should be looped within the same focus group.
The focus movement is not looped by default.
enabled | Whether the focus movement should be looped |
void Dali::Toolkit::KeyboardFocusManager::SetFocusIndicatorActor | ( | Actor | indicator | ) |
Sets the focus indicator actor.
This will replace the default focus indicator actor in KeyboardFocusManager and will be added to the focused actor as a highlight.
indicator | The indicator actor to be added |