Apply reviewed doxygen comments.
[platform/framework/native/ime.git] / inc / FUiImeIInputMethodProvider.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 FUiImeIInputMethodProvider.h
20  * @brief This is the header file for the %IInputMethodProvider interface.
21  *
22  * This header file contains the declarations of the %IInputMethodProvider interface.
23  */
24
25 #ifndef _FUI_IME_IINPUT_METHOD_PROVIDER_H_
26 #define _FUI_IME_IINPUT_METHOD_PROVIDER_H_
27
28 #include <FGrpRectangle.h>
29 #include <FLclLocale.h>
30 #include <FOspConfig.h>
31 #include <FUiInputConnectionTypes.h>
32
33 namespace Tizen { namespace Ui { namespace Ime {
34
35 /**
36  * @interface   IInputMethodProvider
37  * @brief       This interface is for the InputMethod class that interacts with the associated text input UI control.
38  * @since       2.1
39  *
40  * @remarks The IME application developers can implement a class derived from %IInputMethodProvider and set it as the provider of the InputMethod class.
41  * The IME application can then provide attributes for the soft input panel and operate according to the commands of the associated text input UI control. For
42  * example, when ShowInputPanel() or HideInputPanel() are called, the IME application's frame should either be hidden or made visible.
43  *
44  * The %IInputMethodProvider interface is for the InputMethod class that interacts with the associated text input UI control.
45  *
46  * The following example demonstrates how to use the %IInputMethodProvider interface.
47  * @code
48  * #include <FUi.h>
49  *
50  * class MyProvider
51  *      : public IInputMethodProvider
52  * {
53  *      //...
54  *      virtual Tizen::Graphics::Rectangle GetInputPanelBounds(void); 
55  *      virtual void HideInputPanel(void); 
56  *      virtual void ShowInputPanel(void); 
57  *      //...
58  * };
59  * @endcode
60  *
61  */
62 class _OSP_EXPORT_ IInputMethodProvider
63 {
64 public:
65         /**
66         * This polymorphic destructor should be overridden if required. @n This way, the destructors of the derived classes are called when the destructor of this
67         * interface is called.
68         *
69         * @since 2.1
70         * @privlevel partner
71         * @privilege %http://tizen.org/privilege/ime
72         */
73         virtual ~IInputMethodProvider(void) {}
74
75         /**
76         * Called when an associated text input UI control requests the enter key action of the input panel.
77         *
78         * @since 2.1
79         * @privlevel partner
80         * @privilege %http://tizen.org/privilege/ime
81         *
82         * @return The enter key action of the input panel
83         */
84         virtual Tizen::Ui::InputPanelAction GetEnterKeyAction(void)
85         {
86                 return Tizen::Ui::INPUT_PANEL_ACTION_ENTER;
87         }
88
89         /**
90         * Called when an associated text input UI control requests the position and size of the input panel.
91         *
92         * @since 2.1
93         * @privlevel partner
94         * @privilege %http://tizen.org/privilege/ime
95         *
96         * @return The position and size of the input panel
97         * @remarks The associated text input UI control can change its position on the screen to avoid becoming positioned behind the input panel.
98         */
99         virtual Tizen::Graphics::Rectangle GetInputPanelBounds(void) = 0;
100
101         /**
102         * Called when an associated text input UI control requests the style of the input panel.
103         *
104         * @since 2.1
105         * @privlevel partner
106         * @privilege %http://tizen.org/privilege/ime
107         *
108         * @return The style of the input panel
109         */
110         virtual Tizen::Ui::InputPanelStyle GetInputPanelStyle(void)
111         {
112                 return Tizen::Ui::INPUT_PANEL_STYLE_NORMAL;
113         }
114
115         /**
116         * Called when an associated text input UI control requests the language of the input method.
117         *
118         * @since 2.1
119         * @privlevel partner
120         * @privilege %http://tizen.org/privilege/ime
121         *
122         * @return The language of the input method
123         */
124         virtual Tizen::Locales::Locale GetLanguage(void)
125         {
126                 return Tizen::Locales::Locale(Tizen::Locales::LANGUAGE_ENG, Tizen::Locales::COUNTRY_US);
127         }
128
129         /**
130         * Called when an associated text input UI control requests the input panel to enable or disable the caps mode.
131         *
132         * @since 2.1
133         * @privlevel partner
134         * @privilege %http://tizen.org/privilege/ime
135         *
136         * @param[in] enable The state of the caps mode
137         */
138         virtual void SetCapsModeEnabled(bool enable) {}
139
140         /**
141         * Called when an associated text input UI control requests the input panel to set the enter key action. @n
142         * The input panel can show text on the enter button according to the enter key action.
143         *
144         * @since 2.1
145         * @privlevel partner
146         * @privilege %http://tizen.org/privilege/ime
147         *
148         * @param[in] action The enter key action
149         */
150         virtual void SetEnterKeyAction(Tizen::Ui::InputPanelAction action) {}
151
152         /**
153         * Called when an associated text input UI control requests the input panel to enable or disable the enter key action.
154         *
155         * @since 2.1
156         * @privlevel partner
157         * @privilege %http://tizen.org/privilege/ime
158         *
159         * @param[in] enable The state of the enter key action
160         */
161         virtual void SetEnterKeyActionEnabled(bool enable) {}
162
163         /**
164         * Called when an associated text input UI control requests the input panel to set its style.
165         *
166         * @since 2.1
167         * @privlevel partner
168         * @privilege %http://tizen.org/privilege/ime
169         *
170         * @param[in] style The style of the input panel
171         */
172         virtual void SetInputPanelStyle(Tizen::Ui::InputPanelStyle style) {}
173
174         /**
175         * Called when an associated text input UI control requests the input panel to hide itself.
176         *
177         * @since 2.1
178         * @privlevel partner
179         * @privilege %http://tizen.org/privilege/ime
180         */
181         virtual void HideInputPanel(void) = 0;
182
183         /**
184         * Called when an associated text input UI control checks whether the enter key action is enabled or not.
185         *
186         * @since 2.1
187         * @privlevel partner
188         * @privilege %http://tizen.org/privilege/ime
189         *
190         * @return The state of the enter key action
191         */
192         virtual bool IsEnterKeyActionEnabled(void)
193         {
194                 return false;
195         }
196
197         /**
198         * Called when an associated text input UI control requests the input panel to show itself.
199         *
200         * @since 2.1
201         * @privlevel partner
202         * @privilege %http://tizen.org/privilege/ime
203         */
204         virtual void ShowInputPanel(void) = 0;
205
206 protected:
207         //
208         // This method is for internal use only. Using this method can cause behavioral, security-related,
209         // and consistency-related issues in the application.
210         //
211         // This method is reserved and may change its name at any time without prior notice.
212         //
213         // @since 2.1
214         //
215         virtual void IInputMethodProvider_Reserved1(void) {}
216
217         //
218         // This method is for internal use only. Using this method can cause behavioral, security-related,
219         // and consistency-related issues in the application.
220         //
221         // This method is reserved and may change its name at any time without prior notice.
222         //
223         // @since 2.1
224         //
225         virtual void IInputMethodProvider_Reserved2(void) {}
226
227         //
228         // This method is for internal use only. Using this method can cause behavioral, security-related,
229         // and consistency-related issues in the application.
230         //
231         // This method is reserved and may change its name at any time without prior notice.
232         //
233         // @since 2.1
234         //
235         virtual void IInputMethodProvider_Reserved3(void) {}
236
237         //
238         // This method is for internal use only. Using this method can cause behavioral, security-related,
239         // and consistency-related issues in the application.
240         //
241         // This method is reserved and may change its name at any time without prior notice.
242         //
243         // @since 2.1
244         //
245         virtual void IInputMethodProvider_Reserved4(void) {}
246 };
247
248 }}} // Tizen::Ui::Ime
249
250 #endif // _FUI_IME_IINPUT_METHOD_PROVIDER_H_