X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyboard-focus-manager-impl.h;h=4ab0ea35a81b081e785d1c30de06c6a54dfaed36;hb=9637b6f3d8d77b6ccb1cff1e0ec5a0d37e82b2ea;hp=ff79634bf2bec1c85faa39d31ff8a6c2de849568;hpb=3d289bfc3a7a600011f0ba00b7fa8241854a74ca;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h index ff79634..4ab0ea3 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_KEYBOARD_FOCUS_MANAGER_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ // INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -52,6 +53,25 @@ public: typedef Toolkit::DevelKeyboardFocusManager::CustomAlgorithmInterface CustomAlgorithmInterface; + enum FocusIndicatorState + { + UNKNOWN = -1, ///< Unknown state + HIDE = 0, ///< FocusIndicator is hidden + SHOW = 1, ///< FocusIndicator is shown + }; + + enum EnableFocusedIndicatorState + { + DISABLE = 0, ///< FocusIndicator is disable + ENABLE = 1, ///< FocusIndicator is enable + }; + + enum FocusedIndicatorModeState + { + NONE = 0, ///< Set nothing + ALWAYS_SHOW = 1, ///< FocusIndicator is always shown + }; + /** * @copydoc Toolkit::KeyboardFocusManager::Get */ @@ -260,14 +280,26 @@ private: * Callback for the key event when no actor in the stage has gained the key input focus * @param[in] event The KeyEvent event. */ - void OnKeyEvent(const KeyEvent& event); + void OnKeyEvent( const KeyEvent& event ); /** * Callback for the touch event when the screen is touched and when the touch ends * (i.e. the down & up touch events only). * @param[in] touch The touch information */ - void OnTouch( const TouchData& touch ); + void OnTouch( const TouchEvent& touch ); + + /** + * Called when the window focus is changed. + * @param[in] window The window whose focus is changed + * @param[in] focusIn Whether the focus is in/out + */ + void OnWindowFocusChanged( Window window, bool focusIn ); + + /** + * Get the focus Actor from current window + */ + Actor GetFocusActorFromCurrentWindow(); private: @@ -287,24 +319,29 @@ private: Actor mFocusIndicatorActor; ///< The focus indicator actor shared by all the keyboard focusable actors for highlight - int mIsFocusIndicatorShown; ///< Whether indicator should be shown / hidden when getting focus. It could be enabled when keyboard focus feature is enabled and navigation keys or 'Tab' key are pressed. + FocusStack mFocusHistory; ///< Stack to contain pre-focused actor's BaseObject* - bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group + SlotDelegate< KeyboardFocusManager > mSlotDelegate; - bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet. + CustomAlgorithmInterface* mCustomAlgorithmInterface; ///< The user's (application / toolkit) implementation of CustomAlgorithmInterface - bool mClearFocusOnTouch:1; ///< Whether clear focus on touch. + typedef std::vector< std::pair< WeakHandle< Layer >, WeakHandle< Actor > > > FocusActorContainer; - bool mEnableFocusIndicator; ///< Whether use focus indicator + FocusActorContainer mCurrentFocusActors; ///< A container of focused actors - bool mAlwaysShowIndicator; ///< Whether always show indicator. If true, the indicator would be directly shown when focused. + WeakHandle< Layer > mCurrentFocusedWindow; ///< A weak handle to the current focused window's root layer - FocusStack mFocusHistory; ///< Stack to contain pre-focused actor's BaseObject* + FocusIndicatorState mIsFocusIndicatorShown; ///< Whether indicator should be shown / hidden when getting focus. It could be enabled when keyboard focus feature is enabled and navigation keys or 'Tab' key are pressed. - SlotDelegate< KeyboardFocusManager > mSlotDelegate; + EnableFocusedIndicatorState mEnableFocusIndicator; ///< Whether use focus indicator - CustomAlgorithmInterface* mCustomAlgorithmInterface; ///< The user's (application / toolkit) implementation of CustomAlgorithmInterface + FocusedIndicatorModeState mAlwaysShowIndicator; ///< Whether always show indicator. If true, the indicator would be directly shown when focused + bool mFocusGroupLoopEnabled:1; ///< Whether the focus movement is looped within the same focus group + + bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet. + + bool mClearFocusOnTouch:1; ///< Whether clear focus on touch. }; } // namespace Internal