field.HiddenInputSettings = hiddenMap;
window.Add(field);
+ InputMethod inputMethod = new InputMethod();
+ inputMethod.PanelLayout = InputMethod.PanelLayoutType.Number;
+ inputMethod.ActionButton = InputMethod.ActionButtonTitleType.Go;
+ inputMethod.AutoCapital = InputMethod.AutoCapitalType.Word;
+ inputMethod.Variation = 1;
+
+ field.InputMethodSettings = inputMethod.OutputMap;
+
TextEditor editor = new TextEditor();
editor.Size2D = new Size2D(400, 100);
editor.Position2D = new Position2D(10, 550);
editor.BackgroundColor = Color.Magenta;
editor.PlaceholderText = "input someth...";
editor.PlaceholderTextColor = Color.Red;
+ editor.EnableScrollBar = true;
+ editor.Focusable = true;
+ FocusManager.Instance.SetCurrentFocusView(editor);
window.Add(editor);
editor.TextChanged += (obj, e) => {
Tizen.Log.Debug("NUI", "editor line count: " + e.TextEditor.LineCount);
};
+ editor.ScrollStateChanged += (obj, e)=> {
+ Tizen.Log.Debug("NUI", "editor scroll state:" + e.ScrollState);
+ };
+
Tizen.Log.Debug("NUI", "editor id: " + editor.ID);
}
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_StateChangedSignalType")]
public static extern void delete_StateChangedSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+ //manual pinvoke for text-editor ScrollStateChangedSignal
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextEditor_ScrollStateChangedSignal")]
+ public static extern global::System.IntPtr TextEditor_ScrollStateChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ScrollStateChangedSignal_Empty")]
+ public static extern bool ScrollStateChangedSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ScrollStateChangedSignal_GetConnectionCount")]
+ public static extern uint ScrollStateChangedSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ScrollStateChangedSignal_Connect")]
+ public static extern void ScrollStateChangedSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ScrollStateChangedSignal_Disconnect")]
+ public static extern void ScrollStateChangedSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ScrollStateChangedSignal_Emit")]
+ public static extern void ScrollStateChangedSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_ScrollStateChangedSignal")]
+ public static extern global::System.IntPtr new_ScrollStateChangedSignal();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ScrollStateChangedSignal")]
+ public static extern void delete_ScrollStateChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
}
}
--- /dev/null
+//------------------------------------------------------------------------------
+// <auto-generated />
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+
+ internal class ScrollStateChangedSignal : global::System.IDisposable
+ {
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal ScrollStateChangedSignal(global::System.IntPtr cPtr, bool cMemoryOwn)
+ {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollStateChangedSignal obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ //A Flag to check who called Dispose(). (By User or DisposeQueue)
+ private bool isDisposeQueued = false;
+ //A Flat to check if it is already disposed.
+ protected bool disposed = false;
+
+
+ ~ScrollStateChangedSignal()
+ {
+ if (!isDisposeQueued)
+ {
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
+ }
+ }
+
+ public void Dispose()
+ {
+ //Throw excpetion if Dispose() is called in separate thread.
+ if (!Window.IsInstalled())
+ {
+ throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+ }
+
+ if (isDisposeQueued)
+ {
+ Dispose(DisposeTypes.Implicit);
+ }
+ else
+ {
+ Dispose(DisposeTypes.Explicit);
+ System.GC.SuppressFinalize(this);
+ }
+ }
+
+ protected virtual void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+
+ }
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicManualPINVOKE.delete_ScrollStateChangedSignal(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ disposed = true;
+ }
+
+ public bool Empty()
+ {
+ bool ret = NDalicManualPINVOKE.ScrollStateChangedSignal_Empty(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public uint GetConnectionCount()
+ {
+ uint ret = NDalicManualPINVOKE.ScrollStateChangedSignal_GetConnectionCount(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public void Connect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+ {
+ NDalicManualPINVOKE.ScrollStateChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public void Disconnect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+ {
+ NDalicManualPINVOKE.ScrollStateChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public void Emit(View arg)
+ {
+ NDalicManualPINVOKE.ScrollStateChangedSignal_Emit(swigCPtr, View.getCPtr(arg));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public ScrollStateChangedSignal() : this(NDalicManualPINVOKE.new_ScrollStateChangedSignal(), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ }
+
+}
{
get
{
+ GetProperty(ImageView.Property.RESOURCE_URL).Get(out _url);
return _url;
}
set
}
+ /// <summary>
+ /// Event arguments that passed via ScrollStateChanged signal.
+ /// </summary>
+ public class ScrollStateChangedEventArgs : EventArgs
+ {
+ private TextEditor _textEditor;
+ private ScrollState _scrollState;
+
+ /// <summary>
+ /// TextEditor - is the texteditor control which has the scroll state changed.
+ /// </summary>
+ public TextEditor TextEditor
+ {
+ get
+ {
+ return _textEditor;
+ }
+ set
+ {
+ _textEditor = value;
+ }
+ }
+
+ /// <summary>
+ /// ScrollState - is the texteditor control scroll state.
+ /// </summary>
+ public ScrollState ScrollState
+ {
+ get
+ {
+ return _scrollState;
+ }
+ set
+ {
+ _scrollState = value;
+ }
+ }
+ }
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
+ private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
+ private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
+
+ /// <summary>
+ /// Event for ScrollStateChanged signal which can be used to subscribe/unsubscribe the event handler
+ /// provided by the user. ScrollStateChanged signal is emitted when the scroll state changes.<br>
+ /// </summary>
+ public event EventHandler<ScrollStateChangedEventArgs> ScrollStateChanged
+ {
+ add
+ {
+ if (_textEditorScrollStateChangedEventHandler == null)
+ {
+ _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
+ ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
+ }
+ _textEditorScrollStateChangedEventHandler += value;
+ }
+ remove
+ {
+ _textEditorScrollStateChangedEventHandler -= value;
+ if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
+ {
+ ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
+ }
+ }
+ }
+
+ private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
+ {
+ ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
+
+ if (textEditor != null)
+ {
+ // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
+ e.TextEditor = TextEditor.GetTextEditorFromPtr(textEditor);
+ e.ScrollState = state;
+ }
+
+ if (_textEditorScrollStateChangedEventHandler != null)
+ {
+ //here we send all data to user event handlers
+ _textEditorScrollStateChangedEventHandler(this, e);
+ }
+ }
+
internal static TextEditor GetTextEditorFromPtr(global::System.IntPtr cPtr)
{
TextEditor ret = new TextEditor(cPtr, false);
return ret;
}
+ internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor)
+ {
+ ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal()
{
SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(NDalicPINVOKE.TextEditor_InputStyleChangedSignal(swigCPtr), false);
--- /dev/null
+// 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
+{
+
+ /// <summary>
+ /// A class encapsulating the input method map.
+ /// </summary>
+ public class InputMethod
+ {
+ private PanelLayoutType? _panelLayout = null;
+ private ActionButtonTitleType? _actionButton = null;
+ private AutoCapitalType? _autoCapital = null;
+ private int? _variation = null;
+
+ /// <summary>
+ /// Default constructor.
+ /// </summary>
+ public InputMethod()
+ {
+ }
+
+ /// <summary>
+ /// Get or set panel layout.
+ /// </summary>
+ public PanelLayoutType PanelLayout
+ {
+ get
+ {
+ return _panelLayout ?? PanelLayoutType.Normal;
+ }
+ set
+ {
+ _panelLayout = value;
+ }
+ }
+
+ /// <summary>
+ /// Get or set action button.
+ /// </summary>
+ public ActionButtonTitleType ActionButton
+ {
+ get
+ {
+ return _actionButton ?? ActionButtonTitleType.Default;
+ }
+ set
+ {
+ _actionButton = value;
+ }
+ }
+
+ /// <summary>
+ /// Get or set auto capital.
+ /// </summary>
+ public AutoCapitalType AutoCapital
+ {
+ get
+ {
+ return _autoCapital ?? AutoCapitalType.None;
+ }
+ set
+ {
+ _autoCapital = value;
+ }
+ }
+
+ /// <summary>
+ /// Get or set variation.
+ /// </summary>
+ public int Variation
+ {
+ get
+ {
+ return _variation ?? 0;
+ }
+ set
+ {
+ _variation = value;
+ }
+ }
+
+ /// <summary>
+ /// Get or set variation for normal layout.
+ /// </summary>
+ public NormalLayoutType NormalVariation
+ {
+ get
+ {
+ return (NormalLayoutType) (_variation ?? 0);
+ }
+ set
+ {
+ _variation = (int)value;
+ }
+ }
+
+ /// <summary>
+ /// Get or set variation for number only layout.
+ /// </summary>
+ public NumberOnlyLayoutType NumberOnlyVariation
+ {
+ get
+ {
+ return (NumberOnlyLayoutType) (_variation ?? 0);
+ }
+ set
+ {
+ _variation = (int)value;
+ }
+ }
+
+ /// <summary>
+ /// Get or set variation for password layout.
+ /// </summary>
+ 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;
+ }
+
+ /// <summary>
+ /// Get the input method map.
+ /// </summary>
+ public PropertyMap OutputMap
+ {
+ get
+ {
+ return ComposingInputMethodMap();
+ }
+ }
+
+ /// <summary>
+ /// SetType that can be changed in the system Input Method.
+ /// </summary>
+ public enum CategoryType
+ {
+ /// <summary>
+ /// Set Keyboard layout.
+ /// </summary>
+ PanelLayout,
+ /// <summary>
+ /// Set Action button title.
+ /// </summary>
+ ActionButtonTitle,
+ /// <summary>
+ /// Set Auto capitalise of input.
+ /// </summary>
+ AutoCapitalise,
+ /// <summary>
+ /// Set variation.
+ /// </summary>
+ Variation
+ }
+
+ /// <summary>
+ /// Autocapitalization Types.
+ /// </summary>
+ public enum AutoCapitalType
+ {
+ /// <summary>
+ /// No auto-capitalization when typing.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Autocapitalize each word typed.
+ /// </summary>
+ Word,
+ /// <summary>
+ /// Autocapitalize the start of each sentence.
+ /// </summary>
+ Sentence,
+ /// <summary>
+ /// Autocapitalize all letters.
+ /// </summary>
+ Allcharacter
+ }
+
+ /// <summary>
+ /// Input panel (virtual keyboard) layout types..
+ /// </summary>
+ public enum PanelLayoutType
+ {
+ /// <summary>
+ /// Default layout.
+ /// </summary>
+ Normal,
+ /// <summary>
+ /// Number layout.
+ /// </summary>
+ Number,
+ /// <summary>
+ /// Email layout.
+ /// </summary>
+ Email,
+ /// <summary>
+ /// URL layout.
+ /// </summary>
+ URL,
+ /// <summary>
+ /// Phone number layout.
+ /// </summary>
+ PhoneNumber,
+ /// <summary>
+ /// IP layout.
+ /// </summary>
+ IP,
+ /// <summary>
+ /// Month layout.
+ /// </summary>
+ Month,
+ /// <summary>
+ /// Number layout.
+ /// </summary>
+ NumberOnly,
+ /// <summary>
+ /// Hexadecimal layout.
+ /// </summary>
+ HEX,
+ /// <summary>
+ /// Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization).
+ /// </summary>
+ Terminal,
+ /// <summary>
+ /// Like normal, but no auto-correct, no auto-capitalization etc.
+ /// </summary>
+ Password,
+ /// <summary>
+ /// Date and time layout.
+ /// </summary>
+ Datetime,
+ /// <summary>
+ /// Emoticon layout.
+ /// </summary>
+ Emoticon
+ }
+
+ /// <summary>
+ /// Specifies what the Input Method "action" button functionality is set to.
+ /// </summary>
+ public enum ActionButtonTitleType
+ {
+ /// <summary>
+ /// Default action.
+ /// </summary>
+ Default,
+ /// <summary>
+ /// Done.
+ /// </summary>
+ Done,
+ /// <summary>
+ /// Go action.
+ /// </summary>
+ Go,
+ /// <summary>
+ /// Join action.
+ /// </summary>
+ Join,
+ /// <summary>
+ /// Login action.
+ /// </summary>
+ Login,
+ /// <summary>
+ /// Next action.
+ /// </summary>
+ Next,
+ /// <summary>
+ /// Previous action.
+ /// </summary>
+ Previous,
+ /// <summary>
+ /// Search action.
+ /// </summary>
+ Search,
+ /// <summary>
+ /// Send action.
+ /// </summary>
+ Send,
+ /// <summary>
+ /// Sign in action.
+ /// </summary>
+ SignIn,
+ /// <summary>
+ /// Unspecified action.
+ /// </summary>
+ Unspecified,
+ /// <summary>
+ /// Nothing to do.
+ /// </summary>
+ None
+ }
+
+ /// <summary>
+ /// Available variation for Normal layout.
+ /// </summary>
+ public enum NormalLayoutType
+ {
+ /// <summary>
+ /// The plain normal layout.
+ /// </summary>
+ Normal,
+ /// <summary>
+ /// Filename layout. sysbols such as '/' should be disabled.
+ /// </summary>
+ WithFilename,
+ /// <summary>
+ /// The name of a person.
+ /// </summary>
+ WithPersonName
+ }
+
+ /// <summary>
+ /// Available variation for Number only layout.
+ /// </summary>
+ public enum NumberOnlyLayoutType
+ {
+ /// <summary>
+ /// The plain normal number layout.
+ /// </summary>
+ Normal,
+ /// <summary>
+ /// The number layout to allow a positive or negative sign at the start.
+ /// </summary>
+ WithSigned,
+ /// <summary>
+ /// The number layout to allow decimal point to provide fractional value.
+ /// </summary>
+ WithDecimal,
+ /// <summary>
+ /// The number layout to allow decimal point and negative sign.
+ /// </summary>
+ WithSignedAndDecimal
+ }
+
+ /// <summary>
+ /// Available variation for Password layout.
+ /// </summary>
+ public enum PasswordLayoutType
+ {
+ /// <summary>
+ /// The normal password layout.
+ /// </summary>
+ Normal,
+ /// <summary>
+ /// The password layout to allow only number.
+ /// </summary>
+ WithNumberOnly
+ }
+
+ }
+}
namespace Tizen.NUI
{
public enum ScrollModeType
- {
- XAxisScrollEnabled,
- XAxisSnapToInterval,
- XAxisScrollBoundary,
- YAxisScrollEnabled,
- YAxisSnapToInterval,
- YAxisScrollBoundary
+ {\r
+ XAxisScrollEnabled,\r
+ XAxisSnapToInterval,\r
+ XAxisScrollBoundary,\r
+ YAxisScrollEnabled,\r
+ YAxisSnapToInterval,\r
+ YAxisScrollBoundary
}
/// <summary>
/// <summary>
/// Actor will use its own color.
/// </summary>
- UseOwnColor,
- /// <summary>
+ UseOwnColor,\r
+ /// <summary>
/// Actor will use its parent color.
/// </summary>
UseParentColor,
/// <summary>
/// An enum of screen mode.
/// </summary>
- public enum ScreenMode {
+ public enum ScreenMode\r
+ {
/// <summary>
/// The mode which turns the screen off after a timeout.
/// </summary>
/// <summary>
/// An enum of notification window's priority level.
/// </summary>
- public enum NotificationLevel {
+ public enum NotificationLevel\r
+ {
/// <summary>
/// No notification level.<br>
/// Default level.<br>
/// <summary>
/// An enum of Window types.
/// </summary>
- public enum WindowType {
+ public enum WindowType\r
+ {
/// <summary>
/// A default window type.<br>
/// Indicates a normal, top-level window.
}
}
+ /// <summary>
+ /// An enum of scroll state of text eidtor.
+ /// </summary>
+ public enum ScrollState
+ {
+ /// <summary>
+ /// Scrolling is started.
+ /// </summary>
+ Started,
-
+ /// <summary>
+ /// Scrolling is finished.
+ /// </summary>
+ Finished
+ }
}