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.
19 * @file FUiKeyEventManager.h
20 * @brief This is the header file for the %KeyEventManager class.
22 * This header file contains the declarations of the %KeyEventManager class.
25 #ifndef _FUI_KEY_EVENT_MANAGER_H_
26 #define _FUI_KEY_EVENT_MANAGER_H_
28 #include <FBaseObject.h>
29 #include <FBaseErrors.h>
30 #include <FUiIKeyEventListener.h>
32 namespace Tizen { namespace Base { namespace Runtime
38 namespace Tizen {namespace Ui
43 * @class KeyEventManager
44 * @brief This class manages the key events that are fired within the context of this application.
48 * @final This class is not intended for extension.
50 * The %KeyEventManager class listens to all key events that are generated within the application's context.
52 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/event_listener.htm">Event Listeners</a>.
54 class _OSP_EXPORT_ KeyEventManager
55 : public Tizen::Base::Object
59 * This destructor overrides Osp::Base::Object::~Object().
63 virtual ~KeyEventManager(void);
66 * Gets the pointer to the current key event manager.
70 * @return The current %KeyEventManager instance
72 static KeyEventManager* GetInstance(void);
75 * Adds an application-wide %IKeyEventListener instance. @n
76 * The added listeners get notified when a key is pressed, released, or long pressed within the context of this application.
80 * @param[in] listener The event listener to be added
81 * @remarks The listener is called after the key event is delivered to the focused control's key event listeners, but before the
82 * key event is passed onto the focused control itself. @n
83 * Moreover, if the key needs to be consumed by the control itself, the added listeners will not be notified.
84 * @see RemoveKeyEventListener ()
86 void AddKeyEventListener(IKeyEventListener& listener);
89 * Removes the %IKeyEventListener instance. @n
90 * The removed listener is not notified even when the key events are fired.
94 * @return listener The current application-wide key event listener to be removed
95 * @see AddKeyEventListener()
97 void RemoveKeyEventListener(IKeyEventListener& listener);
101 * This is the default constructor for this class.
105 KeyEventManager(void);
108 * Initializes this instance of %KeyEventManager.
112 * @return An error code
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_SYSTEM A system error has occurred.
116 result Construct(void);
120 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
122 KeyEventManager(const KeyEventManager& value);
125 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
127 KeyEventManager& operator =(const KeyEventManager& value);
129 static void InitializeInstance(void);
131 }; // KeyEventManager
135 #endif // _FUI_KEY_EVENT_MANAGER_H_