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 /// Default constructor.
37 /// Get or set panel layout.
39 public PanelLayoutType PanelLayout
43 return _panelLayout ?? PanelLayoutType.Normal;
52 /// Get or set action button.
54 public ActionButtonTitleType ActionButton
58 return _actionButton ?? ActionButtonTitleType.Default;
62 _actionButton = value;
67 /// Get or set auto capital.
69 public AutoCapitalType AutoCapital
73 return _autoCapital ?? AutoCapitalType.None;
82 /// Get or set variation.
88 return _variation ?? 0;
97 /// Get or set variation for normal layout.
99 public NormalLayoutType NormalVariation
103 return (NormalLayoutType) (_variation ?? 0);
107 _variation = (int)value;
112 /// Get or set variation for number only layout.
114 public NumberOnlyLayoutType NumberOnlyVariation
118 return (NumberOnlyLayoutType) (_variation ?? 0);
122 _variation = (int)value;
127 /// Get or set variation for 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 /// Get 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 Keyboard layout.
172 /// Set Action button title.
176 /// Set Auto capitalise of input.
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, 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 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 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 Password layout.
367 public enum PasswordLayoutType
370 /// The normal password layout.
374 /// The password layout to allow only number.