2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FUiImeIInputMethodListener.h
20 * @brief This is the header file for the %IInputMethodListener interface.
22 * This header file contains the declarations of the %IInputMethodListener interface.
25 #ifndef _FUI_IME_IINPUT_METHOD_LISTENER_H_
26 #define _FUI_IME_IINPUT_METHOD_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseString.h>
30 #include <FGrpRectangle.h>
31 #include <FOspConfig.h>
32 #include <FUiInputConnectionTypes.h>
34 namespace Tizen { namespace Ui { namespace Ime {
37 * @interface IInputMethodListener
38 * @brief This interface provides a listener for the %InputMethod class to receive asynchronous callbacks from the input service.
41 * @remarks The IME application developers can implement a class that is derived from %IInputMethodListener and use it to receive asynchronous callbacks
42 * from the input service.
44 * The %IInputMethodListener interface provides a listener for the InputMethod class to receive asynchronous callbacks from the input service.
46 * The following example demonstrates how to use the %IInputMethodListener interface.
50 * using namespace Tizen::Ui::Ime;
53 * : public IInputMethodListener
55 * virtual void OnCursorPositionChanged(int position) {}
56 * virtual void OnOpaqueCommandReceived(const Tizen::Base::String& command) {}
57 * virtual void OnSurroundingTextReceived(const Tizen::Base::String& text, int cursorPosition) {}
62 class _OSP_EXPORT_ IInputMethodListener
63 : virtual public Tizen::Base::Runtime::IEventListener
67 * This polymorphic destructor should be overridden if required. @n This way, the destructors of the derived classes are called when the destructor of this
68 * interface is called.
72 * @privilege %http://tizen.org/privilege/ime
74 virtual ~IInputMethodListener(void) {}
77 * Called when the position of the cursor in an associated text input UI control changes.
81 * @privilege %http://tizen.org/privilege/ime
83 * @param[in] position The position of the cursor
85 virtual void OnCursorPositionChanged(int position) {}
88 * Called when a client of the input method sends the opaque command. @n
89 * The opaque command is the engaged command between the certain input method and their clients which know opaque commands. @n
90 * It is for additional options that the input method does not provide.
94 * @privilege %http://tizen.org/privilege/ime
96 * @param[in] command The opaque command that is a string format like "org.tizen.MyApp.OpaqueCommand=True"
98 virtual void OnOpaqueCommandReceived(const Tizen::Base::String& command) {}
101 * Called when an associated text input UI control responds to a request with the surrounding text. @n
102 * The surrounding text can be requested by the Tizen::Ui::Ime::InputMethod::RequestSurroundingText() method.
106 * @privilege %http://tizen.org/privilege/ime
108 * @param[in] text The surrounding text @n
109 * The length of the surrounding text can be less than that requested by the user.
110 * @param[in] cursorPosition The position of the cursor
112 virtual void OnSurroundingTextReceived(const Tizen::Base::String& text, int cursorPosition) {}
116 // This method is for internal use only. Using this method can cause behavioral, security-related,
117 // and consistency-related issues in the application.
119 // This method is reserved and may change its name at any time without prior notice.
123 virtual void IInputMethodListener_Reserved1(void) {}
126 // This method is for internal use only. Using this method can cause behavioral, security-related,
127 // and consistency-related issues in the application.
129 // This method is reserved and may change its name at any time without prior notice.
133 virtual void IInputMethodListener_Reserved2(void) {}
136 // This method is for internal use only. Using this method can cause behavioral, security-related,
137 // and consistency-related issues in the application.
139 // This method is reserved and may change its name at any time without prior notice.
143 virtual void IInputMethodListener_Reserved3(void) {}
146 // This method is for internal use only. Using this method can cause behavioral, security-related,
147 // and consistency-related issues in the application.
149 // This method is reserved and may change its name at any time without prior notice.
153 virtual void IInputMethodListener_Reserved4(void) {}
156 }}} // Tizen::Ui::Ime
158 #endif // _FUI_IME_IINPUT_METHOD_LISTENER_H_