Fix to adjust the position of the partial Frame
[platform/framework/native/uifw.git] / inc / FUiKeyEventManager.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file                FUiKeyEventManager.h
20  * @brief               This is the header file for the %KeyEventManager class.
21  *
22  * This header file contains the declarations of the %KeyEventManager class.
23  */
24
25 #ifndef _FUI_KEY_EVENT_MANAGER_H_
26 #define _FUI_KEY_EVENT_MANAGER_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseErrors.h>
30 #include <FUiIKeyEventListener.h>
31
32 namespace Tizen { namespace Base { namespace Runtime
33 {
34 class _IEvent;
35 class IEventArg;
36 } } }
37
38 namespace Tizen {namespace Ui
39 {
40 class Control;
41
42 /**
43  * @class       KeyEventManager
44  * @brief       This class manages the key events that are fired within the context of this application.
45  *
46  * @since       2.0
47  *
48  * @final        This class is not intended for extension.
49  *
50  * The %KeyEventManager class listens to all key events that are generated within the application's context.
51  * @n
52  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/event_listener.htm">Event Listeners</a>.
53  */
54 class _OSP_EXPORT_ KeyEventManager
55         : public Tizen::Base::Object
56 {
57 public:
58         /**
59          * This destructor overrides Tizen::Base::Object::~Object().
60          *
61          * @since       2.0
62          */
63         virtual ~KeyEventManager(void);
64
65         /**
66          * Gets the pointer to the current key event manager.
67          *
68          * @since               2.0
69          *
70          * @return              The current %KeyEventManager instance
71          */
72         static KeyEventManager* GetInstance(void);
73
74         /**
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.
77          *
78          * @since               2.0
79          *
80          * @param[in]   listener    The event listener to add
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 ()
85          */
86         void AddKeyEventListener(IKeyEventListener& listener);
87
88          /**
89          * Removes the %IKeyEventListener instance. @n
90          * The removed listener is not notified even when the key events are fired.
91          *
92          * @since               2.0
93          *
94          * @return              listener                The current application-wide key event listener to remove
95          * @see                 AddKeyEventListener()
96          */
97         void RemoveKeyEventListener(IKeyEventListener& listener);
98
99 protected:
100         /**
101          * This is the default constructor for this class.
102          *
103          * @since       2.0
104          */
105         KeyEventManager(void);
106
107         /**
108          * Initializes this instance of %KeyEventManager.
109          *
110          * @since               2.0
111          *
112          * @return              An error code
113          * @exception   E_SUCCESS               The method is successful.
114          * @exception   E_SYSTEM                A system error has occurred.
115          */
116         result Construct(void);
117
118 private:
119         //
120         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
121         //
122         KeyEventManager(const KeyEventManager& value);
123
124         //
125         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
126         //
127         KeyEventManager& operator =(const KeyEventManager& value);
128
129         static void InitializeInstance(void);
130
131 }; // KeyEventManager
132
133 } } // Tizen::Ui
134
135 #endif // _FUI_KEY_EVENT_MANAGER_H_