X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyinput-focus-manager-impl.h;h=e1d1a94c3db8ae22ebe13f8eebdd686878904af8;hp=6622b736516fa67b3a72570e7a8df0b5ba1e16dd;hb=9795d65d103bdf0524aa92e96475019eff2705f3;hpb=e2eda444afbe82e9591fe198eef339227f90a616 diff --git a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.h b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.h index 6622b73..e1d1a94 100644 --- a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.h +++ b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.h @@ -1,29 +1,30 @@ #ifndef __DALI_TOOLKIT_INTERNAL_KEYINPUT_FOCUS_MANAGER_H__ #define __DALI_TOOLKIT_INTERNAL_KEYINPUT_FOCUS_MANAGER_H__ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // EXTERNAL INCLUDES #include -#include +#include +#include // INTERNAL INCLUDES -#include -#include +#include #include namespace Dali @@ -40,14 +41,9 @@ class KeyInputFocusManager; /** * @copydoc Toolkit::KeyInputFocusManager */ -class KeyInputFocusManager : public Dali::BaseObject +class KeyInputFocusManager : public Dali::BaseObject, public Dali::ConnectionTracker { public: - - typedef std::deque< unsigned int > ActorQueue; - typedef std::deque< unsigned int >::iterator ActorQueueIterator; - typedef std::deque< unsigned int >::const_iterator ActorQueueConstIterator; - /** * Construct a new KeyInputFocusManager. */ @@ -59,31 +55,21 @@ public: void SetFocus(Toolkit::Control control); /** - * @copydoc Toolkit::GetCurrentFocusControl - */ - Toolkit::Control GetCurrentFocusControl() const; - - /** * @copydoc Toolkit::RemoveFocus */ void RemoveFocus(Toolkit::Control control); /** - * @copydoc Toolkit::IsKeyboardListener + * @copydoc Toolkit::GetCurrentFocusControl */ - bool IsKeyboardListener(Toolkit::Control control) const; + Toolkit::Control GetCurrentFocusControl() const; public: /** * @copydoc Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignal() */ - Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalV2& KeyInputFocusChangedSignal(); - - /** - * @copydoc Toolkit::KeyInputFocusManager::UnhandledKeyEventSignal() - */ - Toolkit::KeyInputFocusManager::UnhandledKeyEventSignalV2& UnhandledKeyEventSignal(); + Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalType& KeyInputFocusChangedSignal(); /** * Connects a callback function with the object's signals. @@ -109,13 +95,21 @@ 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); + bool OnKeyEvent(const KeyEvent& event); /** - * Signal handler called when a focused Actor is removed from Stage. - * @param[in] actor The actor removed from stage. + * Signal handler called when a focused Control is removed from Stage. + * @param[in] control The control removed from stage. */ - void OnFocusActorStageDisconnection( Dali::Actor actor ); + void OnFocusControlStageDisconnection( Dali::Actor control ); + + /** + * Recursively deliver events to the control and its parents, until the event is consumed or the stage is reached. + * @param[in] control The control got KeyEvent. + * @param[in] event The KeyEvent. + * @return True if KeyEvent is consumed. + */ + bool EmitKeyEventSignal( Toolkit::Control control, const KeyEvent& event ); private: @@ -127,15 +121,11 @@ private: private: // The key input focus change signal - Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalV2 mKeyInputFocusChangedSignalV2; - - // The un-handled key event signal - Toolkit::KeyInputFocusManager::UnhandledKeyEventSignalV2 mUnhandledKeyEventSignalV2; - - // Keyboard events are sent to the current focus actor, which will be the actor on the top of the focus actors stack. - ActorQueue mFocusActorsQueue; + Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalType mKeyInputFocusChangedSignal; SlotDelegate< KeyInputFocusManager > mSlotDelegate; + + Toolkit::Control mCurrentFocusControl; ///< The current focused control }; } // namespace Internal