Tizen 2.1 base
[framework/osp/ime.git] / src / FUiImeIInputMethodListener.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 FUiImeIInputMethodListener.h
20  * @brief This is the header file for the %IInputMethodListener interface.
21  *
22  * This header file contains the declarations of the %IInputMethodListener interface.
23  */
24
25 #ifndef _FUI_IME_IINPUT_METHOD_LISTENER_H_
26 #define _FUI_IME_IINPUT_METHOD_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseString.h>
30 #include <FGrpRectangle.h>
31 #include <FOspConfig.h>
32 #include <FUiInputConnectionTypes.h>
33
34 namespace Tizen { namespace Ui { namespace Ime {
35
36 /**
37  * @if VISPARTNER
38  * @interface   IInputMethodListener
39  * @brief       This interface provides a listener for the InputMethod class to receive asynchronous callbacks from the input service.
40  * @since       2.0
41  *
42  * @remarks IME application developers can implement a class that is derived from %IInputMethodListener and use it to receive asynchronous callbacks
43  * from the input service.
44  *
45  * @visibility partner
46  * @privilege http://tizen.org/privilege/ime
47  *
48  * The %IInputMethodListener provides a listener for the %InputMethod class to receive asynchronous callbacks from the input service.
49  *
50  * The following example demonstrates how to use the %IInputMethodListener interface.
51  * @code
52  * #include <FUi.h>
53  *
54  * class MyListener
55  *      : public IInputMethodListener
56  * {
57  *      ...
58  *      virtual void OnCursorPositionChanged(int position);
59  *      ...
60  * };
61  * @endcode
62  *
63  * @endif
64  */
65 class _OSP_EXPORT_ IInputMethodListener
66         : virtual public Tizen::Base::Runtime::IEventListener
67 {
68 public:
69         /** 
70         * @if VISPARTNER
71         * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this
72         * interface is called.
73         *
74         * @since 2.0
75         * @visibility partner
76         * @privilege http://tizen.org/privilege/ime
77         * @endif
78         */
79         virtual ~IInputMethodListener(void) {}
80
81         /** 
82         * @if VISPARTNER
83         * Called when the position of the cursor in an associated text input UI control changes.
84         *
85         * @since 2.0
86         * @visibility partner
87         * @privilege http://tizen.org/privilege/ime
88         *
89         * @param[in]    position The position of the cursor
90         * @endif
91         */
92         virtual void OnCursorPositionChanged(int position) {}
93
94         /** 
95         * @if VISPARTNER
96         * Called when an associated text input UI control responds to a request with the surrounding text.
97         *
98         * @since 2.0
99         * @visibility partner
100         * @privilege http://tizen.org/privilege/ime
101         *
102         * @param[in] text The surrounding text
103         * @param[in] cursorPosition The position of the cursor
104         * @remarks The surrounding text can be requested by the Tizen::Ui::Ime::InputMethod::RequestSurroundingText() method. The length of the
105         * surrounding text can be less than that requested by the user.
106         * @endif
107         */
108         virtual void OnSurroundingTextReceived(const Tizen::Base::String& text, int cursorPosition) {}
109
110 protected:
111         //
112         // This method is for internal use only. Using this method can cause behavioral, security-related,
113         // and consistency-related issues in the application.
114         //
115         // Following method is reserved and may change its name at any time without
116         // prior notice.
117         //
118         // @since 2.0
119         //
120         virtual void IInputMethodListener_Reserved1(void) {}
121
122         //
123         // This method is for internal use only. Using this method can cause behavioral, security-related,
124         // and consistency-related issues in the application.
125         //
126         // Following method is reserved and may change its name at any time without
127         // prior notice.
128         //
129         // @since 2.0
130         //
131         virtual void IInputMethodListener_Reserved2(void) {}
132
133         //
134         // This method is for internal use only. Using this method can cause behavioral, security-related,
135         // and consistency-related issues in the application.
136         //
137         // Following method is reserved and may change its name at any time without
138         // prior notice.
139         //
140         // @since 2.0
141         //
142         virtual void IInputMethodListener_Reserved3(void) {}
143
144         //
145         // This method is for internal use only. Using this method can cause behavioral, security-related,
146         // and consistency-related issues in the application.
147         //
148         // Following method is reserved and may change its name at any time without
149         // prior notice.
150         //
151         // @since 2.0
152         //
153         virtual void IInputMethodListener_Reserved4(void) {}
154
155         //
156         // This method is for internal use only. Using this method can cause behavioral, security-related,
157         // and consistency-related issues in the application.
158         //
159         // Following method is reserved and may change its name at any time without
160         // prior notice.
161         //
162         // @since 2.0
163         //
164         virtual void IInputMethodListener_Reserved5(void) {}
165 };
166
167 }}} // Tizen::Ui::Ime
168
169 #endif // _FUI_IME_IINPUT_METHOD_LISTENER_H_