2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using System.ComponentModel;
26 /// Provides the functionality of handling keyboard navigation and maintaining the two-dimensional keyboard focus chain.<br />
27 /// It provides functionality of setting the focus and moving the focus in four directions( i.e., left, right, up, and down).<br />
28 /// It also draws a highlight for the focused view and sends an event when the focus is changed.<br />
30 /// <since_tizen> 3 </since_tizen>
31 public class FocusManager : BaseHandle
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34 private CustomAlgorithmInterfaceWrapper _customAlgorithmInterfaceWrapper;
36 internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FocusManager_SWIGUpcast(cPtr), cMemoryOwn)
38 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FocusManager obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47 /// To make the FocusManager instance be disposed.
49 /// Please DO NOT use! This will be deprecated!
50 /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
51 /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
52 /// <since_tizen> 3 </since_tizen>
53 [EditorBrowsable(EditorBrowsableState.Never)]
54 protected override void Dispose(DisposeTypes type)
61 if (type == DisposeTypes.Explicit)
64 //Release your own managed resources here.
65 //You should release all of your own disposable objects here.
68 //Release your own unmanaged resources here.
69 //You should not access any managed member here except static instance.
70 //because the execution order of Finalizes is non-deterministic.
72 if (_focusedViewEnterKeyEventCallback2 != null)
74 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
77 if (_focusedViewEnterKeyEventCallback != null)
79 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
82 if (_focusGroupChangedEventCallback != null)
84 FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
87 if (_focusChangedEventCallback != null)
89 FocusChangedSignal().Disconnect(_focusChangedEventCallback);
92 if (_preFocusChangeCallback != null)
94 PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
97 if (swigCPtr.Handle != global::System.IntPtr.Zero)
102 NDalicManualPINVOKE.delete_FocusManager(swigCPtr);
104 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
112 /// Event arguments that passed via the PreFocusChange signal.
114 /// <since_tizen> 3 </since_tizen>
115 public class PreFocusChangeEventArgs : EventArgs
117 private View _current;
118 private View _proposed;
119 private View.FocusDirection _direction;
122 /// The current focus view.
124 /// <since_tizen> 3 </since_tizen>
125 public View CurrentView
138 /// The proposed view.
140 /// <since_tizen> 3 </since_tizen>
141 public View ProposedView
154 /// The focus move direction.
156 /// <since_tizen> 3 </since_tizen>
157 public View.FocusDirection Direction
170 private EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> _preFocusChangeEventHandler;
171 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
172 internal delegate IntPtr PreFocusChangeEventCallback(IntPtr current, IntPtr proposed, View.FocusDirection direction);
173 private PreFocusChangeEventCallback _preFocusChangeCallback;
176 /// PreFocusChange will be triggered before the focus is going to be changed.<br />
177 /// The FocusManager makes the best guess for which view to focus towards the given direction, but applications might want to change that.<br />
178 /// By connecting with this event, they can check the proposed view to focus and return a different view if they wish.<br />
179 /// This event is only triggered when the navigation key is pressed and KeyboardFocusManager tries to move the focus automatically.<br />
180 /// It won't be emitted for focus movement by calling the SetCurrentFocusView directly.<br />
182 /// <since_tizen> 3 </since_tizen>
183 public event EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> PreFocusChange
187 if (_preFocusChangeEventHandler == null)
190 Tizen.Log.Debug("NUI", "con1) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
191 Tizen.Log.Debug("NUI", "con2) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
193 _preFocusChangeCallback = OnPreFocusChange;
194 PreFocusChangeSignal().Connect(_preFocusChangeCallback);
196 Tizen.Log.Debug("NUI", "con3) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
197 Tizen.Log.Debug("NUI", "con4) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
200 _preFocusChangeEventHandler += value;
204 _preFocusChangeEventHandler -= value;
205 if (_preFocusChangeEventHandler == null && PreFocusChangeSignal().Empty() == false)
208 Tizen.Log.Debug("NUI", "discon1) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
209 Tizen.Log.Debug("NUI", "discon2) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
211 PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
213 Tizen.Log.Debug("NUI", "discon3) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
214 Tizen.Log.Debug("NUI", "discon4) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
220 private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.FocusDirection direction)
223 PreFocusChangeEventArgs e = new PreFocusChangeEventArgs();
225 if (current != global::System.IntPtr.Zero)
227 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
229 if (proposed != global::System.IntPtr.Zero)
231 e.ProposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View;
233 e.Direction = direction;
235 if (_preFocusChangeEventHandler != null)
237 view = _preFocusChangeEventHandler(this, e);
242 return view.GetPtrfromView();
246 //if (e.ProposedView) return proposed;
247 //else return current;
248 return current; //xb.teng
253 /// Event arguments that passed via the FocusChanged signal.
255 /// <since_tizen> 3 </since_tizen>
256 public class FocusChangedEventArgs : EventArgs
258 private View _current;
262 /// The current focus view.
264 /// <since_tizen> 3 </since_tizen>
265 public View CurrentView
277 /// The next focus view.
279 /// <since_tizen> 3 </since_tizen>
293 private EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
294 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
295 internal delegate void FocusChangedEventCallback(IntPtr current, IntPtr next);
296 private FocusChangedEventCallback _focusChangedEventCallback;
299 /// The FocusGroupChanged will be triggered after the current focused view has been changed.
301 /// <since_tizen> 3 </since_tizen>
302 public event EventHandler<FocusChangedEventArgs> FocusChanged
306 if (_focusChangedEventCallback == null)
308 _focusChangedEventCallback = OnFocusChanged;
309 FocusChangedSignal().Connect(_focusChangedEventCallback);
311 _focusChangedEventHandler += value;
315 _focusChangedEventHandler -= value;
317 if (_focusChangedEventCallback == null && FocusChangedSignal().Empty() == false)
319 FocusChangedSignal().Disconnect(_focusChangedEventCallback);
324 private void OnFocusChanged(IntPtr current, IntPtr next)
326 FocusChangedEventArgs e = new FocusChangedEventArgs();
328 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
329 e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View;
331 if (_focusChangedEventHandler != null)
333 _focusChangedEventHandler(this, e);
338 /// Event arguments that passed via the FocusGroupChanged signal.
340 /// <since_tizen> 3 </since_tizen>
341 public class FocusGroupChangedEventArgs : EventArgs
343 private View _current;
344 private bool _forwardDirection;
347 /// The current focus view.
349 /// <since_tizen> 3 </since_tizen>
350 public View CurrentView
363 /// The forward direction.
365 /// <since_tizen> 3 </since_tizen>
366 public bool ForwardDirection
370 return _forwardDirection;
374 _forwardDirection = value;
379 private EventHandler<FocusGroupChangedEventArgs> _focusGroupChangedEventHandler;
380 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
381 private delegate void FocusGroupChangedEventCallback(IntPtr current, bool forwardDirection);
382 private FocusGroupChangedEventCallback _focusGroupChangedEventCallback;
385 /// The FocusGroupChanged will be triggered when the focus group has been changed.<br />
386 /// If the current focus group has a parent layout control, the FocusManager will make the best guess for the next focus group to move the focus to in the given direction (forward or backward).<br />
387 /// If not, the application has to set the new focus.<br />
389 /// <since_tizen> 3 </since_tizen>
390 public event EventHandler<FocusGroupChangedEventArgs> FocusGroupChanged
394 if (_focusGroupChangedEventCallback == null)
396 _focusGroupChangedEventCallback = OnFocusGroupChanged;
397 FocusGroupChangedSignal().Connect(_focusGroupChangedEventCallback);
399 _focusGroupChangedEventHandler += value;
403 _focusGroupChangedEventHandler -= value;
405 if (_focusGroupChangedEventCallback == null && FocusGroupChangedSignal().Empty() == false)
407 FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
412 private void OnFocusGroupChanged(IntPtr current, bool forwardDirection)
414 FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
416 e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
417 e.ForwardDirection = forwardDirection;
419 if (_focusGroupChangedEventHandler != null)
421 _focusGroupChangedEventHandler(this, e);
426 /// Event arguments that passed via the FocusedViewEnterKey signal.
428 /// <since_tizen> 3 </since_tizen>
429 public class FocusedViewActivatedEventArgs : EventArgs
436 /// <since_tizen> 3 </since_tizen>
450 private EventHandler<FocusedViewActivatedEventArgs> _focusedViewEnterKeyEventHandler;
451 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
452 private delegate void FocusedViewEnterKeyEventCallback(IntPtr view);
453 private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback;
456 /// The FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it.
458 /// <since_tizen> 3 </since_tizen>
459 public event EventHandler<FocusedViewActivatedEventArgs> FocusedViewActivated
463 if (_focusedViewEnterKeyEventCallback == null)
465 _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey;
466 FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback);
468 _focusedViewEnterKeyEventHandler += value;
472 _focusedViewEnterKeyEventHandler -= value;
474 if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false)
476 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
481 private void OnFocusedViewEnterKey(IntPtr view)
483 FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
485 e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
487 if (_focusedViewEnterKeyEventHandler != null)
489 _focusedViewEnterKeyEventHandler(this, e);
494 internal FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true)
496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499 internal static FocusManager Get()
501 FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true);
502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507 /// Moves the keyboard focus to the given view.<br />
508 /// Only one view can be focused at the same time.<br />
509 /// The view must be in the stage already and keyboard focusable.<br />
511 /// <param name="view">The view to be focused.</param>
512 /// <returns>Whether the focus is successful or not.</returns>
513 /// <since_tizen> 3 </since_tizen>
514 public bool SetCurrentFocusView(View view)
518 throw new ArgumentNullException("the target view should not be null");
521 bool ret = NDalicManualPINVOKE.FocusManager_SetCurrentFocusActor(swigCPtr, View.getCPtr(view));
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 /// Gets the current focused view.
529 /// <returns>A handle to the current focused view or an empty handle if no view is focused.</returns>
530 /// <since_tizen> 3 </since_tizen>
531 public View GetCurrentFocusView()
533 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr);
535 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
540 /// Moves the focus to the next focusable view in the focus chain in the given direction (according to the focus traversal order).
542 /// <param name="direction">The direction of the focus movement.</param>
543 /// <returns>True if the movement was successful.</returns>
544 /// <since_tizen> 3 </since_tizen>
545 public bool MoveFocus(View.FocusDirection direction)
547 bool ret = NDalicManualPINVOKE.FocusManager_MoveFocus(swigCPtr, (int)direction);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
553 /// Clears the focus from the current focused view if any, so that no view is focused in the focus chain.<br />
554 /// It will emit the FocusChanged event without the current focused view.<br />
556 /// <since_tizen> 3 </since_tizen>
557 public void ClearFocus()
559 NDalicManualPINVOKE.FocusManager_ClearFocus(swigCPtr);
560 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564 /// Move the focus to previous focused view.
566 /// <since_tizen> 3 </since_tizen>
567 public void MoveFocusBackward()
569 NDalicManualPINVOKE.FocusManager_MoveFocusBackward(swigCPtr);
570 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574 /// Gets or sets the status of whether the focus movement should be looped within the same focus group.<br />
575 /// The focus movement is not looped by default.<br />
577 /// <since_tizen> 3 </since_tizen>
578 public bool FocusGroupLoop
582 SetFocusGroupLoop(value);
586 return GetFocusGroupLoop();
590 internal void SetFocusGroupLoop(bool enabled)
592 NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled);
593 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596 internal bool GetFocusGroupLoop()
598 bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr);
599 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 /// Sets whether the view is a focus group that can limit the scope of the focus movement to its child views in the focus chain.<br />
605 /// Layout controls set themselves as focus groups by default.<br />
607 /// <param name="view">The view to be set as a focus group.</param>
608 /// <param name="isFocusGroup">Whether to set the view as a focus group or not.</param>
609 /// <since_tizen> 3 </since_tizen>
610 public void SetAsFocusGroup(View view, bool isFocusGroup)
612 NDalicManualPINVOKE.FocusManager_SetAsFocusGroup(swigCPtr, View.getCPtr(view), isFocusGroup);
613 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 /// Checks whether the view is set as a focus group or not.
619 /// <param name="view">The view to be checked.</param>
620 /// <returns>Whether the view is set as a focus group.</returns>
621 /// <since_tizen> 3 </since_tizen>
622 public bool IsFocusGroup(View view)
624 bool ret = NDalicManualPINVOKE.FocusManager_IsFocusGroup(swigCPtr, View.getCPtr(view));
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 /// Returns the closest ancestor of the given view that is a focus group.
632 /// <param name="view">The view to be checked for its focus group.</param>
633 /// <returns>The focus group the given view belongs to or an empty handle if the given view.</returns>
634 /// <since_tizen> 3 </since_tizen>
635 public View GetFocusGroup(View view)
637 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view));
639 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
642 /*View ret = new View(NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view)), true);
643 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644 if (ret.HasBody() == false)
653 /// Gets or sets the focus indicator view.<br />
654 /// This will replace the default focus indicator view in the FocusManager and will be added to the focused view as a highlight.<br />
656 /// <since_tizen> 3 </since_tizen>
657 public View FocusIndicator
661 SetFocusIndicatorView(value);
665 return GetFocusIndicatorView();
669 internal void SetFocusIndicatorView(View indicator)
671 NDalicManualPINVOKE.FocusManager_SetFocusIndicatorActor(swigCPtr, View.getCPtr(indicator));
672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675 internal View GetFocusIndicatorView()
677 IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr);
679 View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
685 /// Provides the implementation of a custom focus algorithm interface to allow the application to define the focus logic.<br />
687 /// <param name="arg0">The user's implementation of ICustomFocusAlgorithm.</param>
688 /// <since_tizen> 3 </since_tizen>
689 public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0)
691 _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
692 _customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
694 NDalicPINVOKE.SetCustomAlgorithm(swigCPtr, CustomAlgorithmInterface.getCPtr(_customAlgorithmInterfaceWrapper));
695 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698 internal PreFocusChangeSignal PreFocusChangeSignal()
700 PreFocusChangeSignal ret = new PreFocusChangeSignal(NDalicManualPINVOKE.FocusManager_PreFocusChangeSignal(swigCPtr), false);
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 internal FocusChangedSignal FocusChangedSignal()
707 FocusChangedSignal ret = new FocusChangedSignal(NDalicManualPINVOKE.FocusManager_FocusChangedSignal(swigCPtr), false);
708 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
712 internal FocusGroupChangedSignal FocusGroupChangedSignal()
714 FocusGroupChangedSignal ret = new FocusGroupChangedSignal(NDalicManualPINVOKE.FocusManager_FocusGroupChangedSignal(swigCPtr), false);
715 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
719 internal ViewSignal FocusedViewEnterKeySignal()
721 ViewSignal ret = new ViewSignal(NDalicManualPINVOKE.FocusManager_FocusedActorEnterKeySignal(swigCPtr), false);
722 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
726 private static readonly FocusManager instance = FocusManager.Get();
729 /// Gets the singleton of the FocusManager object.
731 /// <since_tizen> 3 </since_tizen>
732 public static FocusManager Instance
741 /// ICustomFocusAlgorithm is used to provide the custom keyboard focus algorithm for retrieving the next focusable view.<br />
742 /// The application can implement the interface and override the keyboard focus behavior.<br />
743 /// If the focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.<br />
744 /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine the next focusable actor.<br />
745 /// If focusable properties are not set, then the keyboard FocusManager calls the GetNextFocusableView() method of this interface.<br />
747 /// <since_tizen> 3 </since_tizen>
748 public interface ICustomFocusAlgorithm
751 /// Get the next focus actor.
753 /// <param name="current">The current focus view.</param>
754 /// <param name="proposed">The proposed focus view</param>
755 /// <param name="direction">The focus move direction</param>
756 /// <returns>The next focus actor.</returns>
757 /// <since_tizen> 3 </since_tizen>
758 View GetNextFocusableView(View current, View proposed, View.FocusDirection direction);
761 private class CustomAlgorithmInterfaceWrapper : CustomAlgorithmInterface
763 private FocusManager.ICustomFocusAlgorithm _customFocusAlgorithm;
765 public CustomAlgorithmInterfaceWrapper()
769 public void SetFocusAlgorithm(FocusManager.ICustomFocusAlgorithm customFocusAlgorithm)
771 _customFocusAlgorithm = customFocusAlgorithm;
774 public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
776 return _customFocusAlgorithm.GetNextFocusableView(current, proposed, direction);
782 /// Please do not use! this will be deprecated
784 /// <since_tizen> 3 </since_tizen>
785 /// Please do not use! this will be deprecated.
786 /// Instead please use FocusedViewActivatedEventArgs.
787 [EditorBrowsable(EditorBrowsableState.Never)]
788 public class FocusedViewEnterKeyEventArgs : EventArgs
795 /// <since_tizen> 3 </since_tizen>
809 private EventHandler<FocusedViewEnterKeyEventArgs> _focusedViewEnterKeyEventHandler2;
810 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
811 private delegate void FocusedViewEnterKeyEventCallback2(IntPtr view);
812 private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2;
815 /// [Obsolete("Please do not use! this will be deprecated")]
817 /// <since_tizen> 3 </since_tizen>
818 /// Please do not use! this will be deprecated!
819 /// Instead please use FocusedViewActivated.
820 [Obsolete("Please DO NOT use! This will be deprecated, instead please USE Tizen.NUI.FocusManager.FocusedViewActivated!")]
821 [EditorBrowsable(EditorBrowsableState.Never)]
822 public event EventHandler<FocusedViewEnterKeyEventArgs> FocusedViewEnterKeyPressed
826 if (_focusedViewEnterKeyEventCallback2 == null)
828 _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2;
829 FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2);
831 _focusedViewEnterKeyEventHandler2 += value;
835 _focusedViewEnterKeyEventHandler2 -= value;
837 if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false)
839 FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
844 /// Please do not use! this will be deprecated!
846 /// Please do not use! this will be deprecated!
847 /// Instead please use OnFocusedViewEnterKey.
848 [Obsolete("Please DO NOT use! This will be deprecated, instead please USE Tizen.NUI.FocusManager.OnFocusedViewEnterKey")]
849 [EditorBrowsable(EditorBrowsableState.Never)]
850 private void OnFocusedViewEnterKey2(IntPtr view)
852 FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
854 e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
856 if (_focusedViewEnterKeyEventHandler != null)
858 _focusedViewEnterKeyEventHandler(this, e);