Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiITextEventListener.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                FUiITextEventListener.h
19  * @brief               This is the header file for the %ITextEventListener interface.
20  *
21  * This header file contains the declarations of the %ITextEventListener interface. @n
22  * If a change event is generated, a method of this interface is called. @n
23  * So, if the applications perform tasks related to change events, use the methods of this interface.
24  *
25  */
26 #ifndef _FUI_ITEXT_EVENT_LISTENER_H_
27 #define _FUI_ITEXT_EVENT_LISTENER_H_
28
29 // Includes
30 #include <FBaseRtIEventListener.h>
31 #include <FBaseObject.h>
32
33 namespace Tizen { namespace Ui
34 {
35 class Control;
36 }} // Tizen::Ui
37
38 namespace Tizen {namespace Ui
39 {
40
41 /**
42  * @interface   ITextEventListener
43  * @brief               This interface implements the listener for text events.
44  *
45  * @since               2.0
46  *
47  * The %ITextEventListener interface is the listener interface for receiving text events, for example, from EditFields.
48  * The class that processes a text event implements this interface, and the instance created with that class is registered with a
49  * UI control, using the control's AddTextEventListener() method. When the text event occurs, the OnTextValueChanged() method of
50  * that instance is invoked.
51  *
52  * 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_exp_editarea.htm">ExpandableEditArea</a>, <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_textbox.htm">TextBox</a>, and <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_searchbar.htm">SearchBar</a>.
53
54  */
55 class ITextEventListener
56         : public Tizen::Base::Runtime::IEventListener
57 {
58 // Operation
59 public:
60         /**
61          * This is the destructor for this class.
62          *
63          * @since                       2.0
64          */
65         virtual ~ITextEventListener(void) {}
66
67         /**
68          * Called when a text is changed.
69          *
70          * @since                       2.0
71          *
72          * @param[in]       source              The source of the event
73          * @remarks                     For EditField or EditArea with INPUT_STYLE_FULLSCREEN input style, this listener method is invoked when the user presses "Done"
74          *                                      soft-key. Whereas, for %EditField or %EditArea with INPUT_STYLE_OVERLAY input style, this method is called whenever the user presses a
75          *                                      key.
76          * @remarks         Note that when a non-character key is pressed, OnTextValueChanged() callback is invoked.
77          */
78         virtual void OnTextValueChanged(const Tizen::Ui::Control& source) = 0;
79
80         /**
81          * Called when a change made to the text is canceled.
82          *
83          * @since               2.0
84          *
85          * @param[in]   source          The source of the event
86          * @remarks     This listener method is called when the user presses "Cancel" soft-key for EditField or EditArea with INPUT_STYLE_FULLSCREEN input
87          *                              style.
88          */
89         virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source) = 0;
90
91 // Reserves
92 protected:
93         //
94         // This method is for internal use only. Using this method can cause behavioral,
95         // security-related, and consistency-related issues in the application.
96         //
97         // This method is reserved and may change its name at any time without prior notice.
98         //
99         virtual void ITextEventListener_Reserved1(void) {}
100
101         //
102         // This method is for internal use only. Using this method can cause behavioral,
103         // security-related, and consistency-related issues in the application.
104         //
105         // This method is reserved and may change its name at any time without prior notice.
106         //
107         virtual void ITextEventListener_Reserved2(void) {}
108
109         //
110         // This method is for internal use only. Using this method can cause behavioral,
111         // security-related, and consistency-related issues in the application.
112         //
113         // This method is reserved and may change its name at any time without prior notice.
114         //
115         virtual void ITextEventListener_Reserved3(void) {}
116 }; // ITextEventListener
117
118 }} // Tizen::Ui
119
120 #endif // _FUI_ITEXT_EVENT_LISTENER_H_