2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FUi_KeyEventManagerImpl.h
19 * @brief This is the header file for the _KeyEventManagerImpl class.
21 * This header file contains the declarations of the _KeyEventManagerImpl class. @n.
23 #ifndef _FUI_INTERNAL_KEY_EVENT_MANAGER_IMPL_H_
24 #define _FUI_INTERNAL_KEY_EVENT_MANAGER_IMPL_H_
27 #include <FBaseObject.h>
28 #include <FBaseErrors.h>
29 #include <FOspConfig.h>
30 #include <FUiIKeyEventListener.h>
31 #include <FBaseColLinkedListT.h>
33 namespace Tizen {namespace Ui
38 * @class _KeyEventManagerImpl
39 * @brief This class manages the key events that are fired within this application's context.
42 * The _KeyEventManagerImpl listens to all key events that are generated within this application's context.
44 class _KeyEventManagerImpl
45 : public Tizen::Base::Object
49 * Returns the pointer to the current key event manager.
52 * @return The current _KeyEventManagerImpl instance
54 static _KeyEventManagerImpl* GetInstance(void);
58 * Adds an application-wide IKeyEventListener instance. @n
59 * The added listeners gets notified when a key is pressed, released, or long
60 * pressed within this application's context.
63 * @param[in] listener The event listener to add
64 * @remarks The listener is called after the key event is delivered
65 * to the focused Control's key event listeners, but before the
66 * key event is passed onto the focused Control itself. @n
67 * Moreover, if the key needs to be consumed by Control itself,
68 * the added listeners will not be notified.
69 * @see Tizen::Ui::IKeyEventListener::OnKeyPressed()
70 * @see Tizen::Ui::IKeyEventListener::OnKeyReleased()
71 * @see Tizen::Ui::IKeyEventListener::OnKeyLongPressed()
72 * @see RemoveKeyEventListener ()
74 void AddKeyEventListener(IKeyEventListener& listener);
78 * Removes the IKeyEventListener instance. @n
79 * The removed listener is not notified even when the key events are fired.
82 * @return listener The current application-wide key event listener to remove
83 * @see AddKeyEventListener()
85 void RemoveKeyEventListener(IKeyEventListener& listener);
87 _ControlImpl* GetKeyCapturingControl(KeyCode keyCode) const;
89 static void Initialize(void);
91 static void ReleaseInstance(void);
95 * This is the default constructor for this class.
99 _KeyEventManagerImpl(void);
102 * This is the destructor for this class.
106 virtual ~_KeyEventManagerImpl(void);
109 * This is the copy constructor for this class.
111 _KeyEventManagerImpl(const _KeyEventManagerImpl&);
114 * This is the assignment operator for this class.
116 _KeyEventManagerImpl& operator =(const _KeyEventManagerImpl&);
118 static void InitializeInstance(void);
121 static _KeyEventManagerImpl* __pInstance;
123 Tizen::Base::Collection::LinkedListT <Tizen::Ui::IKeyEventListener*>* __pPublicKeyEventListeners;
125 class PublicEventListener;
126 PublicEventListener* __pKeyEventListeners;
127 }; // _KeyEventManagerImpl
131 #endif // _FUI_INTERNAL_KEY_EVENT_MANAGER_IMPL_H_