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