1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
20 /// A class encapsulating the input method map.
22 /// <since_tizen> 3 </since_tizen>
23 public class InputMethod
25 private PanelLayoutType? _panelLayout = null;
26 private ActionButtonTitleType? _actionButton = null;
27 private AutoCapitalType? _autoCapital = null;
28 private int? _variation = null;
31 /// The default constructor.
33 /// <since_tizen> 3 </since_tizen>
39 /// SetType that can be changed in the system input method.
41 /// <since_tizen> 3 </since_tizen>
42 public enum CategoryType
45 /// Set the keyboard layout.
49 /// Set the action button title.
53 /// Set the auto capitalise of input.
57 /// Set the variation.
63 /// Autocapitalization Types.
65 /// <since_tizen> 3 </since_tizen>
66 public enum AutoCapitalType
69 /// No auto-capitalization when typing.
73 /// Autocapitalize each word typed.
77 /// Autocapitalize the start of each sentence.
81 /// Autocapitalize all letters.
87 /// Input panel (virtual keyboard) layout types..
89 /// <since_tizen> 3 </since_tizen>
90 public enum PanelLayoutType
109 /// Phone number layout.
125 /// Hexadecimal layout.
129 /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization).
133 /// Like normal, but no auto-correct, no auto-capitalization etc.
137 /// Date and time layout.
147 /// Specifies what the Input Method "action" button functionality is set to.
149 /// <since_tizen> 3 </since_tizen>
150 public enum ActionButtonTitleType
193 /// Unspecified action.
203 /// Available variation for the normal layout.
205 /// <since_tizen> 3 </since_tizen>
206 public enum NormalLayoutType
209 /// The plain normal layout.
213 /// Filename layout. sysbols such as '/' should be disabled.
217 /// The name of a person.
223 /// Available variation for the number only layout.
225 /// <since_tizen> 3 </since_tizen>
226 public enum NumberOnlyLayoutType
229 /// The plain normal number layout.
233 /// The number layout to allow a positive or negative sign at the start.
237 /// The number layout to allow decimal point to provide fractional value.
241 /// The number layout to allow decimal point and negative sign.
247 /// Available variation for the password layout.
249 /// <since_tizen> 3 </since_tizen>
250 public enum PasswordLayoutType
253 /// The normal password layout.
257 /// The password layout to allow only number.
263 /// Gets or sets the panel layout.
265 /// <since_tizen> 3 </since_tizen>
266 public PanelLayoutType PanelLayout
270 return _panelLayout ?? PanelLayoutType.Normal;
274 _panelLayout = value;
279 /// Gets or sets the action button.
281 /// <since_tizen> 3 </since_tizen>
282 public ActionButtonTitleType ActionButton
286 return _actionButton ?? ActionButtonTitleType.Default;
290 _actionButton = value;
295 /// Gets or sets the auto capital.
297 /// <since_tizen> 3 </since_tizen>
298 public AutoCapitalType AutoCapital
302 return _autoCapital ?? AutoCapitalType.None;
306 _autoCapital = value;
311 /// Gets or sets the variation.
313 /// <since_tizen> 3 </since_tizen>
318 return _variation ?? 0;
327 /// Gets or sets the variation for normal layout.
329 /// <since_tizen> 3 </since_tizen>
330 public NormalLayoutType NormalVariation
334 return (NormalLayoutType) (_variation ?? 0);
338 _variation = (int)value;
343 /// Gets or sets the variation for the number only layout.
345 /// <since_tizen> 3 </since_tizen>
346 public NumberOnlyLayoutType NumberOnlyVariation
350 return (NumberOnlyLayoutType) (_variation ?? 0);
354 _variation = (int)value;
359 /// Gets or sets the variation for the password layout.
361 /// <since_tizen> 3 </since_tizen>
362 public PasswordLayoutType PasswordVariation
366 return (PasswordLayoutType) (_variation ?? 0);
370 _variation = (int)value;
375 /// Gets the input method map.
377 /// <since_tizen> 3 </since_tizen>
378 public PropertyMap OutputMap
382 return ComposingInputMethodMap();
386 private PropertyMap ComposingInputMethodMap()
388 PropertyMap _outputMap = new PropertyMap();
389 if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); }
390 if (_actionButton != null) { _outputMap.Add("BUTTON_ACTION", new PropertyValue((int)_actionButton)); }
391 if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALIZE", new PropertyValue((int)_autoCapital)); }
392 if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); }