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 public class InputMethod
24 private PanelLayoutType? _panelLayout = null;
25 private ActionButtonTitleType? _actionButton = null;
26 private AutoCapitalType? _autoCapital = null;
27 private int? _variation = null;
30 /// The default constructor.
32 /// <since_tizen> 3 </since_tizen>
38 /// Gets or sets the panel layout.
40 /// <since_tizen> 3 </since_tizen>
41 public PanelLayoutType PanelLayout
45 return _panelLayout ?? PanelLayoutType.Normal;
54 /// Gets or sets the action button.
56 /// <since_tizen> 3 </since_tizen>
57 public ActionButtonTitleType ActionButton
61 return _actionButton ?? ActionButtonTitleType.Default;
65 _actionButton = value;
70 /// Gets or sets the auto capital.
72 /// <since_tizen> 3 </since_tizen>
73 public AutoCapitalType AutoCapital
77 return _autoCapital ?? AutoCapitalType.None;
86 /// Gets or sets the variation.
88 /// <since_tizen> 3 </since_tizen>
93 return _variation ?? 0;
102 /// Gets or sets the variation for normal layout.
104 /// <since_tizen> 3 </since_tizen>
105 public NormalLayoutType NormalVariation
109 return (NormalLayoutType) (_variation ?? 0);
113 _variation = (int)value;
118 /// Gets or sets the variation for the number only layout.
120 /// <since_tizen> 3 </since_tizen>
121 public NumberOnlyLayoutType NumberOnlyVariation
125 return (NumberOnlyLayoutType) (_variation ?? 0);
129 _variation = (int)value;
134 /// Gets or sets the variation for the password layout.
136 /// <since_tizen> 3 </since_tizen>
137 public PasswordLayoutType PasswordVariation
141 return (PasswordLayoutType) (_variation ?? 0);
145 _variation = (int)value;
149 private PropertyMap ComposingInputMethodMap()
151 PropertyMap _outputMap = new PropertyMap();
152 if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); }
153 if (_actionButton != null) { _outputMap.Add("ACTION_BUTTON", new PropertyValue((int)_actionButton)); }
154 if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALISE", new PropertyValue((int)_autoCapital)); }
155 if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); }
160 /// Gets the input method map.
162 /// <since_tizen> 3 </since_tizen>
163 public PropertyMap OutputMap
167 return ComposingInputMethodMap();
172 /// SetType that can be changed in the system input method.
174 /// <since_tizen> 3 </since_tizen>
175 public enum CategoryType
178 /// Set the keyboard layout.
182 /// Set the action button title.
186 /// Set the auto capitalise of input.
190 /// Set the variation.
196 /// Autocapitalization Types.
198 /// <since_tizen> 3 </since_tizen>
199 public enum AutoCapitalType
202 /// No auto-capitalization when typing.
206 /// Autocapitalize each word typed.
210 /// Autocapitalize the start of each sentence.
214 /// Autocapitalize all letters.
220 /// Input panel (virtual keyboard) layout types..
222 /// <since_tizen> 3 </since_tizen>
223 public enum PanelLayoutType
242 /// Phone number layout.
258 /// Hexadecimal layout.
262 /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization).
266 /// Like normal, but no auto-correct, no auto-capitalization etc.
270 /// Date and time layout.
280 /// Specifies what the Input Method "action" button functionality is set to.
282 /// <since_tizen> 3 </since_tizen>
283 public enum ActionButtonTitleType
326 /// Unspecified action.
336 /// Available variation for the normal layout.
338 /// <since_tizen> 3 </since_tizen>
339 public enum NormalLayoutType
342 /// The plain normal layout.
346 /// Filename layout. sysbols such as '/' should be disabled.
350 /// The name of a person.
356 /// Available variation for the number only layout.
358 /// <since_tizen> 3 </since_tizen>
359 public enum NumberOnlyLayoutType
362 /// The plain normal number layout.
366 /// The number layout to allow a positive or negative sign at the start.
370 /// The number layout to allow decimal point to provide fractional value.
374 /// The number layout to allow decimal point and negative sign.
380 /// Available variation for the password layout.
382 /// <since_tizen> 3 </since_tizen>
383 public enum PasswordLayoutType
386 /// The normal password layout.
390 /// The password layout to allow only number.