Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiIKeypadEventListener.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  * @file                FUiIKeypadEventListener.h
19  * @brief               This is the header file for the %IKeypadEventListener interface.
20  *
21  * This header file contains the declarations of the %IKeypadEventListener interface.
22  */
23 #ifndef _FUI_IKEYPAD_EVENT_LISTENER_H_
24 #define _FUI_IKEYPAD_EVENT_LISTENER_H_
25
26 // Includes
27 #include <FBaseRtIEventListener.h>
28 #include <FUiCtrlEditTypes.h>
29
30 namespace Tizen { namespace Graphics
31 {
32 class Dimension;
33 }} // Tizen::Graphics
34
35 // Namespace declaration
36 namespace Tizen { namespace Ui
37 {
38
39 class Control;
40
41 /**
42  * @enum    KeypadAction
43  *
44  * Defines the possible keypad action types.
45  *
46  * @since               2.0
47  */
48 enum KeypadAction
49 {
50         KEYPAD_ACTION_ENTER,    /**< The Enter key */
51         KEYPAD_ACTION_GO,       /**< The Go key */
52         KEYPAD_ACTION_NEXT,     /**< The Next key */
53         KEYPAD_ACTION_SEND,     /**< The Send key */
54         KEYPAD_ACTION_SEARCH,   /**< The Search key */
55         KEYPAD_ACTION_LOGIN,    /**< The Login key */
56         KEYPAD_ACTION_SIGN_IN,  /**< The Sign-In key */
57         KEYPAD_ACTION_JOIN,     /**< The Join key */
58         KEYPAD_ACTION_DONE      /**< The Done key */
59 };
60
61 /**
62  * @interface   IKeypadEventListener
63  * @brief           This interface implements the listener for the keypad events.
64  *
65  * @since           2.0
66  *
67  * The %IKeypadEventListener interface is the listener interface for receiving software keypad events.
68  * The class that processes a software keypad event implements this interface, and the instance created with that class is
69  * registered with a UI control, using the control's AddKeypadEventListener() method. When the software keypad event occurs, a
70  * method of that instance is invoked.
71  * @n
72  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_editfield_editarea.htm">EditArea and EditField</a>, <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_searchbar.htm">SearchBar</a> and <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_exp_editarea.htm">ExpandableEditArea</a>.
73
74  */
75 class _OSP_EXPORT_ IKeypadEventListener
76         : public Tizen::Base::Runtime::IEventListener
77 {
78 // Lifecycle
79 public:
80         /**
81          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
82          *
83          * @since       2.0
84          */
85         virtual ~IKeypadEventListener(void) {}
86
87
88 // Operation
89 public:
90         /**
91          * Called when the keypad is about to be shown on the screen.
92          *
93          * @since               2.0
94          *
95          * @param[in]   source          The source of the event
96          * @remarks             When the software keypad appears on the screen, the client area of the current Form is adjusted to account for the space that is taken
97          *              up by the software keypad.
98          * @see         Tizen::Ui::Controls::Form::GetClientAreaBounds()
99          */
100         virtual void OnKeypadWillOpen(Tizen::Ui::Control& source) = 0;
101
102         /**
103          * Called when the keypad is shown on the screen.
104          *
105          * @since               2.0
106          *
107          * @param[in]   source          The source of the event
108          * @remarks             When the software keypad appears on the screen, the client area of the current Form is adjusted to account for the space that is taken
109          *              up by the software keypad.
110          * @see                 Tizen::Ui::Controls::Form::GetClientAreaBounds()
111          */
112         virtual void OnKeypadOpened(Tizen::Ui::Control& source) = 0;
113
114         /**
115          * Called when the keypad is hidden from the screen.
116          *
117          * @since               2.0
118          *
119          * @param[in]   source          The source of the event
120          * @see                 Tizen::Ui::Controls::Form::GetClientAreaBounds()
121          */
122         virtual void OnKeypadClosed(Tizen::Ui::Control& source) = 0;
123
124         /**
125          * Called when the keypad action button is pressed.
126          *
127          * @since               2.0
128          *
129          * @param[in]   source                  The source of the event
130          * @param[in]   keypadAction    The keypad action
131          * @see         KeypadAction
132          */
133         virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction) = 0;
134
135         /**
136          * Called when the keypad bounds are changed, for instance when the predictive text window which is located in the upper side of the keypad is shown.
137          *
138          * @since               2.0
139          *
140          * @param[in]   source          The source of the event
141          * @see                 Tizen::Ui::Controls::Form::GetClientAreaBounds()
142          */
143         virtual void OnKeypadBoundsChanged(Tizen::Ui::Control& source) {};
144
145 // Reserves
146 protected:
147         //
148         // This method is for internal use only. Using this method can cause behavioral,
149         // security-related, and consistency-related issues in the application.
150         //
151         // This method is reserved and may change its name at any time without prior notice.
152         //
153         virtual void IKeypadEventListener_Reserved1(void) { }
154
155         //
156         // This method is for internal use only. Using this method can cause behavioral,
157         // security-related, and consistency-related issues in the application.
158         //
159         // This method is reserved and may change its name at any time without prior notice.
160         //
161         virtual void IKeypadEventListener_Reserved2(void) { }
162
163         //
164         // This method is for internal use only. Using this method can cause behavioral,
165         // security-related, and consistency-related issues in the application.
166         //
167         // This method is reserved and may change its name at any time without prior notice.
168         //
169         virtual void IKeypadEventListener_Reserved3(void) { }
170
171         //
172         // This method is for internal use only. Using this method can cause behavioral,
173         // security-related, and consistency-related issues in the application.
174         //
175         // This method is reserved and may change its name at any time without prior notice.
176         //
177         virtual void IKeypadEventListener_Reserved4(void) { }
178 }; // IKeypadEventListener
179 }} // Tizen::Ui
180
181 #endif // _FUI_IKEYPAD_EVENT_LISTENER_H_