Ejemplo n.º 1
0
        public void ActivatedSignalTypeEmit()
        {
            tlog.Debug(tag, $"ActivatedSignalTypeEmit START");
            var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
            var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;

            tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");

            using (InputMethodContext context = new InputMethodContext())
            {
                var testingTarget = new ActivatedSignalType();
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <ActivatedSignalType>(testingTarget, "Should be an Instance of ActivatedSignalType!");

                try
                {
                    testingTarget.Emit(context);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception: Failed!");
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ActivatedSignalTypeEmit END (OK)");
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Emits the signal.
 /// </summary>
 /// <param name="arg">The first value to pass to callbacks</param>
 /// <since_tizen> 5 </since_tizen>
 public void Emit(InputMethodContext arg)
 {
     Interop.ActivatedSignalType.ActivatedSignalType_Emit(swigCPtr, InputMethodContext.getCPtr(arg));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 3
0
        public void InputMethodContextgetCPtr()
        {
            tlog.Debug(tag, $"InputMethodContextgetCPtr START");
            InputMethodContext a1 = new InputMethodContext();

            global::System.Runtime.InteropServices.HandleRef p1 = InputMethodContext.getCPtr(a1);
            tlog.Debug(tag, $"InputMethodContextgetCPtr END (OK)");
            Assert.Pass("InputMethodContextgetCPtr");
        }
Ejemplo n.º 4
0
        public void InputMethodContextAssign()
        {
            tlog.Debug(tag, $"InputMethodContextAssign START");
            InputMethodContext a1 = new InputMethodContext();
            InputMethodContext b1 = a1;

            tlog.Debug(tag, $"InputMethodContextAssign END (OK)");
            Assert.Pass("InputMethodContextAssign");
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Emits the signal.
 /// </summary>
 /// <param name="arg1">The first value to pass to callbacks</param>
 /// <param name="arg2">The second value to pass to callbacks</param>
 /// <returns>The value returned by the last callback, or a default constructed value if no callbacks are connected</returns>
 /// <since_tizen> 5 </since_tizen>
 public InputMethodContext.CallbackData Emit(InputMethodContext arg1, InputMethodContext.EventData arg2)
 {
     InputMethodContext.CallbackData ret = new InputMethodContext.CallbackData(Interop.KeyboardEventSignalType.Emit(SwigCPtr, InputMethodContext.getCPtr(arg1), InputMethodContext.EventData.getCPtr(arg2)), true);
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
     return(ret);
 }
Ejemplo n.º 6
0
        public void InputMethodContextGetInputPanelState()
        {
            tlog.Debug(tag, $"InputMethodContextGetInputPanelState START");
            InputMethodContext a1 = new InputMethodContext();

            a1.GetInputPanelState();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextGetInputPanelState END (OK)");
            Assert.Pass("InputMethodContextGetInputPanelState");
        }
Ejemplo n.º 7
0
        public void InputMethodContextGetInputPanelUserData()
        {
            tlog.Debug(tag, $"InputMethodContextGetInputPanelUserData START");
            InputMethodContext a1 = new InputMethodContext();

            a1.GetInputPanelUserData(out string b1);
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextGetInputPanelUserData END (OK)");
            Assert.Pass("InputMethodContextGetInputPanelUserData");
        }
Ejemplo n.º 8
0
        public void InputMethodContextGetInputMethodArea()
        {
            tlog.Debug(tag, $"InputMethodContextGetInputMethodArea START");
            InputMethodContext a1 = new InputMethodContext();

            a1.GetInputMethodArea();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextGetInputMethodArea END (OK)");
            Assert.Pass("InputMethodContextGetInputMethodArea");
        }
Ejemplo n.º 9
0
        public void InputMethodContextGetTextDirection()
        {
            tlog.Debug(tag, $"InputMethodContextGetTextDirection START");
            InputMethodContext a1 = new InputMethodContext();

            a1.GetTextDirection();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextGetTextDirection END (OK)");
            Assert.Pass("InputMethodContextGetTextDirection");
        }
Ejemplo n.º 10
0
        public void InputMethodContextNotifyTextInputMultiLine()
        {
            tlog.Debug(tag, $"InputMethodContextNotifyTextInputMultiLine START");
            InputMethodContext a1 = new InputMethodContext();

            a1.NotifyTextInputMultiLine(true);
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextNotifyTextInputMultiLine END (OK)");
            Assert.Pass("InputMethodContextNotifyTextInputMultiLine");
        }
Ejemplo n.º 11
0
        public void InputMethodContextGetSurroundingText()
        {
            tlog.Debug(tag, $"InputMethodContextGetSurroundingText START");
            InputMethodContext a1 = new InputMethodContext();

            a1.GetSurroundingText();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextGetSurroundingText END (OK)");
            Assert.Pass("InputMethodContextGetSurroundingText");
        }
Ejemplo n.º 12
0
        public void InputMethodContextReset()
        {
            tlog.Debug(tag, $"InputMethodContextReset START");
            InputMethodContext a1 = new InputMethodContext();

            a1.Reset();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextReset END (OK)");
            Assert.Pass("InputMethodContextReset");
        }
Ejemplo n.º 13
0
        public void InputMethodContextSetRestoreAfterFocusLost()
        {
            tlog.Debug(tag, $"InputMethodContextSetRestoreAfterFocusLost START");
            InputMethodContext a1 = new InputMethodContext();

            a1.SetRestoreAfterFocusLost(true);
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextSetRestoreAfterFocusLost END (OK)");
            Assert.Pass("InputMethodContextSetRestoreAfterFocusLost");
        }
Ejemplo n.º 14
0
        private InputMethodContext.CallbackData A1_EventReceived(object source, InputMethodContext.EventReceivedEventArgs e)
        {
            InputMethodContext a1 = e.InputMethodContext;

            e.InputMethodContext = a1;

            InputMethodContext.EventData b1 = e.EventData;
            e.EventData = b1;

            return(null);
        }
Ejemplo n.º 15
0
        public void InputMethodContextDownCast()
        {
            tlog.Debug(tag, $"InputMethodContextDownCast START");
            BaseHandle handle = new BaseHandle();

            InputMethodContext a1 = InputMethodContext.DownCast(handle);

            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextDownCast END (OK)");
            Assert.Pass("InputMethodContextDownCast");
        }
Ejemplo n.º 16
0
        public void InputMethodContextShowInputPanel()
        {
            tlog.Debug(tag, $"InputMethodContextShowInputPanel START");
            InputMethodContext a1 = new InputMethodContext();

            a1.ShowInputPanel();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextShowInputPanel END (OK)");
            Assert.Pass("InputMethodContextShowInputPanel");
        }
Ejemplo n.º 17
0
        public void InputMethodContextSetCursorPosition()
        {
            tlog.Debug(tag, $"InputMethodContextSetCursorPosition START");
            InputMethodContext a1 = new InputMethodContext();

            a1.SetCursorPosition(5);
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextSetCursorPosition END (OK)");
            Assert.Pass("InputMethodContextSetCursorPosition");
        }
Ejemplo n.º 18
0
        public void InputMethodContextSetReturnKeyState()
        {
            tlog.Debug(tag, $"InputMethodContextSetReturnKeyState START");
            InputMethodContext a1 = new InputMethodContext();

            a1.SetReturnKeyState(true);
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextSetReturnKeyState END (OK)");
            Assert.Pass("InputMethodContextSetReturnKeyState");
        }
Ejemplo n.º 19
0
        public void InputMethodContextContentReceivedSignal()
        {
            tlog.Debug(tag, $"InputMethodContextContentReceivedSignal START");

            InputMethodContext a1 = new InputMethodContext();

            a1.ContentReceivedSignal();
            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextContentReceivedSignal END (OK)");
            Assert.Pass("InputMethodContextContentReceivedSignal");
        }
Ejemplo n.º 20
0
        public void InputMethodContextKeyboardTypeChangedSignal()
        {
            tlog.Debug(tag, $"InputMethodContextKeyboardTypeChangedSignal START");

            InputMethodContext a1 = new InputMethodContext();

            a1.KeyboardTypeChangedSignal();
            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextKeyboardTypeChangedSignal END (OK)");
            Assert.Pass("InputMethodContextKeyboardTypeChangedSignal");
        }
Ejemplo n.º 21
0
        public void InputMethodContextDeactivate()
        {
            tlog.Debug(tag, $"InputMethodContextDeactivate START");
            InputMethodContext a1 = new InputMethodContext();

            a1.Activate();
            a1.Deactivate();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextDeactivate END (OK)");
            Assert.Pass("InputMethodContextDeactivate");
        }
Ejemplo n.º 22
0
        public void InputMethodContextApplyOptions()
        {
            tlog.Debug(tag, $"InputMethodContextApplyOptions START");

            InputMethodContext a1     = new InputMethodContext();
            InputMethodOptions option = new InputMethodOptions();

            a1.ApplyOptions(option);
            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextApplyOptions END (OK)");
            Assert.Pass("InputMethodContextApplyOptions");
        }
Ejemplo n.º 23
0
        public void InputMethodContextConstructor()
        {
            tlog.Debug(tag, $"InputMethodContextConstructor START");
            InputMethodContext a1 = new InputMethodContext();
            InputMethodContext b1 = new InputMethodContext(a1);

            b1.Dispose();
            a1.Dispose();

            tlog.Debug(tag, $"InputMethodContextConstructor END (OK)");
            Assert.Pass("InputMethodContextConstructor");
        }
Ejemplo n.º 24
0
 /// <summary>
 /// Get the InputMethodContext instance.
 /// </summary>
 /// <returns>The InputMethodContext instance.</returns>
 /// <since_tizen> 5 </since_tizen>
 public InputMethodContext GetInputMethodContext()
 {
     if (inputMethodCotext == null)
     {
         /*Avoid raising InputMethodContext reference count.*/
         inputMethodCotext = new InputMethodContext(Interop.TextField.TextField_GetInputMethodContext(swigCPtr), true);
         if (NDalicPINVOKE.SWIGPendingException.Pending)
         {
             throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
     }
     return(inputMethodCotext);
 }
Ejemplo n.º 25
0
        public EditorTest2Page()
        {
            InitializeComponent();
            viewFullSize = new Size2D(0, 0);

            // Text set to TextEditor
            editor.Text   = "Event result";
            editor.Margin = new Extents(20, 20, 20, 0);

            // Text set to TextEditor
            editor2.Text   = "Input";
            editor2.Margin = new Extents(20, 20, 20, 0);

            // TextChanged Event
            editor2.TextChanged += OnTextEditorTextChanged;

            underline.Margin  = new Extents(20, 20, 5, 20);
            underline2.Margin = new Extents(20, 20, 0, 10);

            // Set focus highlight to underline
            editor.FocusGained += (s, e) =>
            {
                underline.BackgroundColor = Color.Cyan;
            };

            editor.FocusLost += (s, e) =>
            {
                underline.BackgroundColor = Color.Gray;
            };

            editor2.FocusGained += (s, e) =>
            {
                underline2.BackgroundColor = Color.Cyan;
            };

            editor2.FocusLost += (s, e) =>
            {
                underline2.BackgroundColor = Color.Gray;
                editor.Text = "Editing completed";
            };

            // View size adjustment from ime state
            InputMethodContext imeEditor = editor.GetInputMethodContext();

            imeEditor.StatusChanged += OnImeStatusChanged;
            InputMethodContext imeEditor2 = editor2.GetInputMethodContext();

            imeEditor2.StatusChanged += OnImeStatusChanged;
        }
Ejemplo n.º 26
0
        public void InputMethodContextDownCast()
        {
            tlog.Debug(tag, $"InputMethodContextDownCast START");

            using (InputMethodContext context = new InputMethodContext())
            {
                var testingTarget = InputMethodContext.DownCast(context);
                Assert.IsNotNull(testingTarget, "Can't create success object InputMethodContext");
                Assert.IsInstanceOf <InputMethodContext>(testingTarget, "Should be an instance of InputMethodContext type.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"InputMethodContextDownCast END (OK)");
            Assert.Pass("InputMethodContextDownCast");
        }
Ejemplo n.º 27
0
        public void InputMethodContextKeyboardTypeChanged()
        {
            tlog.Debug(tag, $"InputMethodContextKeyboardTypeChanged START");
            InputMethodContext a1 = new InputMethodContext();

            a1.KeyboardTypeChanged += A1_KeyboardTypeChanged;
            a1.KeyboardTypeChanged -= A1_KeyboardTypeChanged;

            object o1 = new object();

            InputMethodContext.KeyboardTypeChangedEventArgs e = new InputMethodContext.KeyboardTypeChangedEventArgs();

            A1_KeyboardTypeChanged(o1, e);
            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextKeyboardTypeChanged END (OK)");
            Assert.Pass("InputMethodContextKeyboardTypeChanged");
        }
Ejemplo n.º 28
0
        public void InputMethodContextEventReceived()
        {
            tlog.Debug(tag, $"InputMethodContextEventReceived START");
            InputMethodContext a1 = new InputMethodContext();

            a1.EventReceived += A1_EventReceived;
            a1.EventReceived -= A1_EventReceived;

            object o1 = new object();

            InputMethodContext.EventReceivedEventArgs e = new InputMethodContext.EventReceivedEventArgs();

            A1_EventReceived(o1, e);
            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextActivated END (OK)");
            Assert.Pass("InputMethodContextActivated");
        }
Ejemplo n.º 29
0
        public EditorTest1Page()
        {
            InitializeComponent();
            viewFullSize = new Size2D(0, 0);

            // Text set to TextEditor
            editor.Text   = "This test is for testing Editor with very long text. This software is the confidential and proprietary information of Samsung Electronics, Inc. You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the license agreement you entered into with Samsung.";
            editor.Margin = new Extents(20, 20, 20, 0);

            // Text set to TextField
            field.Text      = "Please, input any sentence.";
            field.MaxLength = 999;

            underline.Margin  = new Extents(20, 20, 5, 20);
            underline2.Margin = new Extents(0, 0, 0, 10);

            // Set focus highlight to underline
            editor.FocusGained += (s, e) =>
            {
                underline.BackgroundColor = Color.Cyan;
            };

            editor.FocusLost += (s, e) =>
            {
                underline.BackgroundColor = Color.Gray;
            };

            field.FocusGained += (s, e) =>
            {
                underline2.BackgroundColor = Color.Cyan;
            };

            field.FocusLost += (s, e) =>
            {
                underline2.BackgroundColor = Color.Gray;
            };

            // View size adjustment from ime state
            InputMethodContext imeEditor = editor.GetInputMethodContext();

            imeEditor.StatusChanged += OnImeStatusChanged;
            InputMethodContext imeField = field.GetInputMethodContext();

            imeField.StatusChanged += OnImeStatusChanged;
        }
Ejemplo n.º 30
0
        /// <summary>
        /// InputField initialisation.
        /// </summary>
        private void OnIntialize()
        {
            imf = new InputMethodContext();
            imf.AutoEnableInputPanel(true);
            isImfVisible = false;

            // Add a _text label to the window
            _textField = new TextField();
            PropertyMap map = new PropertyMap();

            map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
            map.Insert((int)ImageVisualProperty.URL, new PropertyValue(textFieldBG));
            _textField.Background             = map;
            _textField.FontFamily             = "Samsung One 400";
            _textField.PrimaryCursorColor     = new Color(0, 129, 198, 100);
            _textField.SecondaryCursorColor   = new Color(0, 129, 198, 100);
            _textField.CursorWidth            = 2;
            _textField.PlaceholderText        = "Input your Name";
            _textField.PlaceholderTextFocused = "Input your Name";
            _textField.ParentOrigin           = ParentOrigin.TopLeft;
            _textField.PivotPoint             = PivotPoint.TopLeft;
            _textField.Position            = new Position(30, 18, 0);
            _textField.Size2D              = new Size2D(1000, 80);
            _textField.HorizontalAlignment = HorizontalAlignment.Begin;
            _textField.VerticalAlignment   = VerticalAlignment.Center;
            _textField.PointSize           = DeviceCheck.PointSize10;
            //_textField.PointSize = 10.0f;
            _textField.Focusable    = true;
            _textField.FocusGained += OnFocusGained;
            _textField.FocusLost   += OnFocusLost;
            //_textField.KeyEvent += OnIMEKeyEvent;

            // Create TextField's BackgroundView.
            PropertyMap bgMap = new PropertyMap();

            bgMap.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
            bgMap.Insert((int)ImageVisualProperty.URL, new PropertyValue(textFieldBG));
            bgView              = new View();
            bgView.Background   = bgMap;
            bgView.ParentOrigin = ParentOrigin.TopLeft;
            bgView.PivotPoint   = PivotPoint.TopLeft;
            bgView.Size2D       = new Size2D(1060, 116);
            bgView.Add(_textField);
        }