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