Add a HiddenInput struct to pass data of DALi HiddenInputSettings PropertyMap.
The HiddenInput struct can be used as an argument to
SetHiddenInput and GetHiddenInput methods.
// example
var hiddenInput = new Tizen.NUI.Text.HiddenInput();
hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
hiddenInput.SubstituteCharacter = '★';
hiddenInput.SubstituteCount = 0;
hiddenInput.ShowLastCharacterDuration = 1000;
field.SetHiddenInput(hiddenInput);
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
}
/// <summary>
+ /// Set HiddenInput to TextField. <br />
+ /// </summary>
+ /// <param name="hiddenInput">The HiddenInput</param>
+ /// <remarks>
+ /// SetHiddenInput specifies the requested font style through <see cref="Tizen.NUI.Text.HiddenInput"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetHiddenInput method.
+ /// <code>
+ /// var hiddenInput = new Tizen.NUI.Text.HiddenInput();
+ /// hiddenInput.Mode = HiddenInputModeType.ShowLastCharacter;
+ /// hiddenInput.SubstituteCharacter = '★';
+ /// hiddenInput.SubstituteCount = 0;
+ /// hiddenInput.ShowLastCharacterDuration = 1000;
+ /// field.SetHiddenInput(hiddenInput);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetHiddenInput(HiddenInput hiddenInput)
+ {
+ SetProperty(TextField.Property.HiddenInputSettings, new PropertyValue(TextUtils.GetHiddenInputMap(hiddenInput)));
+ NotifyPropertyChanged();
+ }
+
+ /// <summary>
+ /// Get HiddenInput from TextField. <br />
+ /// </summary>
+ /// <returns>The HiddenInput</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.HiddenInput"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public HiddenInput GetHiddenInput()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextField.Property.HiddenInputSettings).Get(map);
+ return TextUtils.GetHiddenInputStruct(map);
+ }
+
+ /// <summary>
/// The PixelSize property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
}
/// <summary>
+ /// This method converts a HiddenInput struct to a PropertyMap and returns it.
+ /// The returned map can be used for set HiddenInputSettings PropertyMap in the SetHiddenInput method.
+ /// <param name="hiddenInput">The HiddenInput struct value.</param>
+ /// <returns> A PropertyMap for HiddenInput property. </returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PropertyMap GetHiddenInputMap(HiddenInput hiddenInput)
+ {
+ var map = new PropertyMap();
+
+ map.Add(0, new PropertyValue((int)hiddenInput.Mode));
+
+ if (hiddenInput.SubstituteCharacter != null)
+ map.Add(1, new PropertyValue(Convert.ToInt32(hiddenInput.SubstituteCharacter)));
+
+ if (hiddenInput.SubstituteCount != null)
+ map.Add(2, new PropertyValue((int)hiddenInput.SubstituteCount));
+
+ if (hiddenInput.ShowLastCharacterDuration != null)
+ map.Add(3, new PropertyValue((int)hiddenInput.ShowLastCharacterDuration));
+
+ return map;
+ }
+
+ /// <summary>
+ /// This method converts a HiddenInputSettings map to a struct and returns it.
+ /// The returned struct can be returned to the user as a HiddenInput in the GetHiddenInput method.
+ /// <param name="map">The HiddenInput PropertyMap.</param>
+ /// <returns> A HiddenInput struct. </returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static HiddenInput GetHiddenInputStruct(PropertyMap map)
+ {
+ PropertyValue value = null;
+
+ var hiddenInput = new HiddenInput();
+
+ value = map.Find(0);
+ if (value != null)
+ {
+ value.Get(out int mode);
+ hiddenInput.Mode = (HiddenInputModeType)mode;
+ }
+
+ value = map.Find(1);
+ if (value != null)
+ {
+ value.Get(out int substituteCharacter);
+ hiddenInput.SubstituteCharacter = Convert.ToChar(substituteCharacter);
+ }
+
+ value = map.Find(2);
+ if (value != null)
+ {
+ value.Get(out int substituteCount);
+ hiddenInput.SubstituteCount = substituteCount;
+ }
+
+ value = map.Find(3);
+ if (value != null)
+ {
+ value.Get(out int showLastCharacterDuration);
+ hiddenInput.ShowLastCharacterDuration = showLastCharacterDuration;
+ }
+
+ return hiddenInput;
+ }
+
+ /// <summary>
/// Copy the previously selected text into the clipboard and return the copied value.
/// </summary>
/// <param name="textEditor">The textEditor control from which the text is copied.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Ellipsis { get; set; }
}
+
+ /// <summary>
+ /// A struct to pass data of HiddenInputSettings PropertyMap. <br />
+ /// </summary>
+ /// <remarks>
+ /// The HiddenInput struct is used as an argument to SetHiddenInput and GetHiddenInput methods. <br />
+ /// See <see cref="Tizen.NUI.BaseComponents.TextField.SetHiddenInput"/> and <see cref="Tizen.NUI.BaseComponents.TextField.GetHiddenInput"/>. <br />
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public struct HiddenInput
+ {
+ /// <summary>
+ /// The mode for input text display. <br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public HiddenInputModeType Mode { get; set; }
+
+ /// <summary>
+ /// All input characters are substituted by this character (if null, the default value is '*'). <br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public char? SubstituteCharacter { get; set; }
+
+ /// <summary>
+ /// Length of text to show or hide, available when HideCount/ShowCount mode is used (if null, the default value is 0). <br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? SubstituteCount { get; set; }
+
+ /// <summary>
+ /// Hide last character after this duration, available when ShowLastCharacter mode (if null, the default value is 1000). <br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? ShowLastCharacterDuration { get; set; }
+ }
}
}