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 /// Gets or sets the panel layout.
41 /// <since_tizen> 3 </since_tizen>
42 public PanelLayoutType PanelLayout
46 return _panelLayout ?? PanelLayoutType.Normal;
55 /// Gets or sets the action button.
57 /// <since_tizen> 3 </since_tizen>
58 public ActionButtonTitleType ActionButton
62 return _actionButton ?? ActionButtonTitleType.Default;
66 _actionButton = value;
71 /// Gets or sets the auto capital.
73 /// <since_tizen> 3 </since_tizen>
74 public AutoCapitalType AutoCapital
78 return _autoCapital ?? AutoCapitalType.None;
87 /// Gets or sets the variation.
89 /// <since_tizen> 3 </since_tizen>
94 return _variation ?? 0;
103 /// Gets or sets the variation for normal layout.
105 /// <since_tizen> 3 </since_tizen>
106 public NormalLayoutType NormalVariation
110 return (NormalLayoutType) (_variation ?? 0);
114 _variation = (int)value;
119 /// Gets or sets the variation for the number only layout.
121 /// <since_tizen> 3 </since_tizen>
122 public NumberOnlyLayoutType NumberOnlyVariation
126 return (NumberOnlyLayoutType) (_variation ?? 0);
130 _variation = (int)value;
135 /// Gets or sets the variation for the password layout.
137 /// <since_tizen> 3 </since_tizen>
138 public PasswordLayoutType PasswordVariation
142 return (PasswordLayoutType) (_variation ?? 0);
146 _variation = (int)value;
150 private PropertyMap ComposingInputMethodMap()
152 PropertyMap _outputMap = new PropertyMap();
153 if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); }
154 if (_actionButton != null) { _outputMap.Add("BUTTON_ACTION", new PropertyValue((int)_actionButton)); }
155 if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALIZE", new PropertyValue((int)_autoCapital)); }
156 if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); }
161 /// Gets the input method map.
163 /// <since_tizen> 3 </since_tizen>
164 public PropertyMap OutputMap
168 return ComposingInputMethodMap();
173 /// SetType that can be changed in the system input method.
175 /// <since_tizen> 3 </since_tizen>
176 public enum CategoryType
179 /// Set the keyboard layout.
183 /// Set the action button title.
187 /// Set the auto capitalise of input.
191 /// Set the variation.
197 /// Autocapitalization Types.
199 /// <since_tizen> 3 </since_tizen>
200 public enum AutoCapitalType
203 /// No auto-capitalization when typing.
207 /// Autocapitalize each word typed.
211 /// Autocapitalize the start of each sentence.
215 /// Autocapitalize all letters.
221 /// Input panel (virtual keyboard) layout types..
223 /// <since_tizen> 3 </since_tizen>
224 public enum PanelLayoutType
243 /// Phone number layout.
259 /// Hexadecimal layout.
263 /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization).
267 /// Like normal, but no auto-correct, no auto-capitalization etc.
271 /// Date and time layout.
281 /// Specifies what the Input Method "action" button functionality is set to.
283 /// <since_tizen> 3 </since_tizen>
284 public enum ActionButtonTitleType
327 /// Unspecified action.
337 /// Available variation for the normal layout.
339 /// <since_tizen> 3 </since_tizen>
340 public enum NormalLayoutType
343 /// The plain normal layout.
347 /// Filename layout. sysbols such as '/' should be disabled.
351 /// The name of a person.
357 /// Available variation for the number only layout.
359 /// <since_tizen> 3 </since_tizen>
360 public enum NumberOnlyLayoutType
363 /// The plain normal number layout.
367 /// The number layout to allow a positive or negative sign at the start.
371 /// The number layout to allow decimal point to provide fractional value.
375 /// The number layout to allow decimal point and negative sign.
381 /// Available variation for the password layout.
383 /// <since_tizen> 3 </since_tizen>
384 public enum PasswordLayoutType
387 /// The normal password layout.
391 /// The password layout to allow only number.