#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 <string>
-#include <deque>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/object-registry.h>
// INTERNAL INCLUDES
-#include <dali/dali.h>
-#include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali-toolkit/public-api/controls/control.h>
namespace Dali
/**
* @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;
+ typedef Dali::Vector< Dali::BaseObject* > FocusStack;
+ typedef FocusStack::Iterator FocusStackIterator;
/**
* Construct a new KeyInputFocusManager.
void SetFocus(Toolkit::Control control);
/**
- * @copydoc Toolkit::GetCurrentFocusControl
+ * @copydoc Toolkit::RemoveFocus
*/
- Toolkit::Control GetCurrentFocusControl() const;
+ void RemoveFocus(Toolkit::Control control);
/**
- * @copydoc Toolkit::RemoveFocus
+ * @copydoc Toolkit::GetCurrentFocusControl
*/
- void RemoveFocus(Toolkit::Control control);
+ Toolkit::Control GetCurrentFocusControl() const;
/**
* @copydoc Toolkit::IsKeyboardListener
/**
* @copydoc Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignal()
*/
- Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalV2& KeyInputFocusChangedSignal();
+ Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalType& KeyInputFocusChangedSignal();
/**
* @copydoc Toolkit::KeyInputFocusManager::UnhandledKeyEventSignal()
*/
- Toolkit::KeyInputFocusManager::UnhandledKeyEventSignalV2& UnhandledKeyEventSignal();
+ Toolkit::KeyInputFocusManager::UnhandledKeyEventSignalType& UnhandledKeyEventSignal();
/**
* Connects a callback function with the object's signals.
private:
/**
+ * Search for a control in the focus stack.
+ * @param[in] control The control for which to search
+ * @return An iterator to the control. If not found, this will equate to the
+ * mFocusStack.End() iterator.
+ */
+ FocusStackIterator FindFocusControlInStack( Toolkit::Control control ) const;
+
+ /**
* 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);
/**
- * 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 );
+
+ /**
+ * Signal handler called when an actor is destroyed.
+ */
+ void OnObjectDestroyed(const Dali::RefObject* object);
private:
private:
// The key input focus change signal
- Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalV2 mKeyInputFocusChangedSignalV2;
+ Toolkit::KeyInputFocusManager::KeyInputFocusChangedSignalType mKeyInputFocusChangedSignal;
// The un-handled key event signal
- Toolkit::KeyInputFocusManager::UnhandledKeyEventSignalV2 mUnhandledKeyEventSignalV2;
+ Toolkit::KeyInputFocusManager::UnhandledKeyEventSignalType mUnhandledKeyEventSignal;
// Keyboard events are sent to the current focus actor, which will be the actor on the top of the focus actors stack.
- ActorQueue mFocusActorsQueue;
-
+ FocusStack mFocusStack;
SlotDelegate< KeyInputFocusManager > mSlotDelegate;
+ ObjectRegistry mObjectRegistry;
};
} // namespace Internal