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.
37 /// Gets or sets the panel layout.
39 public PanelLayoutType PanelLayout
43 return _panelLayout ?? PanelLayoutType.Normal;
52 /// Gets or sets the action button.
54 public ActionButtonTitleType ActionButton
58 return _actionButton ?? ActionButtonTitleType.Default;
62 _actionButton = value;
67 /// Gets or sets the auto capital.
69 public AutoCapitalType AutoCapital
73 return _autoCapital ?? AutoCapitalType.None;
82 /// Gets or sets the variation.
88 return _variation ?? 0;
97 /// Gets or sets the variation for normal layout.
99 public NormalLayoutType NormalVariation
103 return (NormalLayoutType) (_variation ?? 0);
107 _variation = (int)value;
112 /// Gets or sets the variation for the number only layout.
114 public NumberOnlyLayoutType NumberOnlyVariation
118 return (NumberOnlyLayoutType) (_variation ?? 0);
122 _variation = (int)value;
127 /// Gets or sets the variation for the password layout.
129 public PasswordLayoutType PasswordVariation
133 return (PasswordLayoutType) (_variation ?? 0);
137 _variation = (int)value;
141 private PropertyMap ComposingInputMethodMap()
143 PropertyMap _outputMap = new PropertyMap();
144 if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); }
145 if (_actionButton != null) { _outputMap.Add("ACTION_BUTTON", new PropertyValue((int)_actionButton)); }
146 if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALISE", new PropertyValue((int)_autoCapital)); }
147 if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); }
152 /// Gets the input method map.
154 public PropertyMap OutputMap
158 return ComposingInputMethodMap();
163 /// SetType that can be changed in the system input method.
165 public enum CategoryType
168 /// Set the keyboard layout.
172 /// Set the action button title.
176 /// Set the auto capitalise of input.
180 /// Set the variation.
186 /// Autocapitalization Types.
188 public enum AutoCapitalType
191 /// No auto-capitalization when typing.
195 /// Autocapitalize each word typed.
199 /// Autocapitalize the start of each sentence.
203 /// Autocapitalize all letters.
209 /// Input panel (virtual keyboard) layout types..
211 public enum PanelLayoutType
230 /// Phone number layout.
246 /// Hexadecimal layout.
250 /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization).
254 /// Like normal, but no auto-correct, no auto-capitalization etc.
258 /// Date and time layout.
268 /// Specifies what the Input Method "action" button functionality is set to.
270 public enum ActionButtonTitleType
313 /// Unspecified action.
323 /// Available variation for the normal layout.
325 public enum NormalLayoutType
328 /// The plain normal layout.
332 /// Filename layout. sysbols such as '/' should be disabled.
336 /// The name of a person.
342 /// Available variation for the number only layout.
344 public enum NumberOnlyLayoutType
347 /// The plain normal number layout.
351 /// The number layout to allow a positive or negative sign at the start.
355 /// The number layout to allow decimal point to provide fractional value.
359 /// The number layout to allow decimal point and negative sign.
365 /// Available variation for the password layout.
367 public enum PasswordLayoutType
370 /// The normal password layout.
374 /// The password layout to allow only number.