// Copyright (c) 2017 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // namespace Tizen.NUI { /// /// A class encapsulating the input method map. /// /// 3 public class InputMethod { private PanelLayoutType? _panelLayout = null; private ActionButtonTitleType? _actionButton = null; private AutoCapitalType? _autoCapital = null; private int? _variation = null; /// /// The default constructor. /// /// 3 public InputMethod() { } /// /// Gets or sets the panel layout. /// /// 3 public PanelLayoutType PanelLayout { get { return _panelLayout ?? PanelLayoutType.Normal; } set { _panelLayout = value; } } /// /// Gets or sets the action button. /// /// 3 public ActionButtonTitleType ActionButton { get { return _actionButton ?? ActionButtonTitleType.Default; } set { _actionButton = value; } } /// /// Gets or sets the auto capital. /// /// 3 public AutoCapitalType AutoCapital { get { return _autoCapital ?? AutoCapitalType.None; } set { _autoCapital = value; } } /// /// Gets or sets the variation. /// /// 3 public int Variation { get { return _variation ?? 0; } set { _variation = value; } } /// /// Gets or sets the variation for normal layout. /// /// 3 public NormalLayoutType NormalVariation { get { return (NormalLayoutType) (_variation ?? 0); } set { _variation = (int)value; } } /// /// Gets or sets the variation for the number only layout. /// /// 3 public NumberOnlyLayoutType NumberOnlyVariation { get { return (NumberOnlyLayoutType) (_variation ?? 0); } set { _variation = (int)value; } } /// /// Gets or sets the variation for the password layout. /// /// 3 public PasswordLayoutType PasswordVariation { get { return (PasswordLayoutType) (_variation ?? 0); } set { _variation = (int)value; } } private PropertyMap ComposingInputMethodMap() { PropertyMap _outputMap = new PropertyMap(); if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); } if (_actionButton != null) { _outputMap.Add("ACTION_BUTTON", new PropertyValue((int)_actionButton)); } if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALISE", new PropertyValue((int)_autoCapital)); } if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); } return _outputMap; } /// /// Gets the input method map. /// /// 3 public PropertyMap OutputMap { get { return ComposingInputMethodMap(); } } /// /// SetType that can be changed in the system input method. /// /// 3 public enum CategoryType { /// /// Set the keyboard layout. /// PanelLayout, /// /// Set the action button title. /// ActionButtonTitle, /// /// Set the auto capitalise of input. /// AutoCapitalise, /// /// Set the variation. /// Variation } /// /// Autocapitalization Types. /// /// 3 public enum AutoCapitalType { /// /// No auto-capitalization when typing. /// None, /// /// Autocapitalize each word typed. /// Word, /// /// Autocapitalize the start of each sentence. /// Sentence, /// /// Autocapitalize all letters. /// Allcharacter } /// /// Input panel (virtual keyboard) layout types.. /// /// 3 public enum PanelLayoutType { /// /// Default layout. /// Normal, /// /// Number layout. /// Number, /// /// Email layout. /// Email, /// /// URL layout. /// URL, /// /// Phone number layout. /// PhoneNumber, /// /// IP layout. /// IP, /// /// Month layout. /// Month, /// /// Number layout. /// NumberOnly, /// /// Hexadecimal layout. /// HEX, /// /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization). /// Terminal, /// /// Like normal, but no auto-correct, no auto-capitalization etc. /// Password, /// /// Date and time layout. /// Datetime, /// /// Emoticon layout. /// Emoticon } /// /// Specifies what the Input Method "action" button functionality is set to. /// /// 3 public enum ActionButtonTitleType { /// /// Default action. /// Default, /// /// Done. /// Done, /// /// Go action. /// Go, /// /// Join action. /// Join, /// /// Login action. /// Login, /// /// Next action. /// Next, /// /// Previous action. /// Previous, /// /// Search action. /// Search, /// /// Send action. /// Send, /// /// Sign in action. /// SignIn, /// /// Unspecified action. /// Unspecified, /// /// Nothing to do. /// None } /// /// Available variation for the normal layout. /// /// 3 public enum NormalLayoutType { /// /// The plain normal layout. /// Normal, /// /// Filename layout. sysbols such as '/' should be disabled. /// WithFilename, /// /// The name of a person. /// WithPersonName } /// /// Available variation for the number only layout. /// /// 3 public enum NumberOnlyLayoutType { /// /// The plain normal number layout. /// Normal, /// /// The number layout to allow a positive or negative sign at the start. /// WithSigned, /// /// The number layout to allow decimal point to provide fractional value. /// WithDecimal, /// /// The number layout to allow decimal point and negative sign. /// WithSignedAndDecimal } /// /// Available variation for the password layout. /// /// 3 public enum PasswordLayoutType { /// /// The normal password layout. /// Normal, /// /// The password layout to allow only number. /// WithNumberOnly } } }