1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
20 using System.Runtime.InteropServices;
23 public class View : CustomActor {
24 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26 internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) {
27 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29 // Register this instance of view in the view registry.
30 ViewRegistry.RegisterView(this);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
38 DisposeQueue.Instance.Add(this);
40 // Unregister this instance of view from the view registry.
41 ViewRegistry.UnregisterView(this);
44 public override void Dispose() {
45 if (!Stage.IsInstalled()) {
46 DisposeQueue.Instance.Add(this);
51 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
54 NDalicPINVOKE.delete_View(swigCPtr);
56 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58 global::System.GC.SuppressFinalize(this);
64 * @brief Event arguments that passed via KeyInputFocusGained signal
67 public class KeyInputFocusGainedEventArgs : EventArgs
72 * @brief View - is the view that gets Key Input Focus
89 * @brief Event arguments that passed via KeyInputFocusLost signal
92 public class KeyInputFocusLostEventArgs : EventArgs
97 * @brief View - is the view that loses Key Input Focus
114 * @brief Event arguments that passed via Key signal
117 public class KeyEventArgs : EventArgs
123 * @brief View - is the view that recieves the key.
139 * @brief Key - is the key sent to the View.
156 * @brief Event arguments that passed via OnRelayout signal
159 public class OnRelayoutEventArgs : EventArgs
164 * @brief View - is the view that is being resized upon relayout
182 * @brief Event arguments that passed via Touch signal
185 public class TouchEventArgs : EventArgs
188 private Touch _touch;
191 * @brief View - is the view that is being touched
207 * @brief Touch - contains the information of touch points
224 * @brief Event arguments that passed via Hover signal
227 public class HoverEventArgs : EventArgs
230 private Hover _hover;
233 * @brief View - is the view that is being hovered
249 * @brief Hover - contains touch points that represent the points
250 * that are currently being hovered or the points where a hover has stopped
267 * @brief Event arguments that passed via Wheel signal
270 public class WheelEventArgs : EventArgs
273 private Wheel _wheel;
276 * @brief View - is the view that is being wheeled
292 * @brief Wheel - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL
309 * @brief Event arguments that passed via OnStage signal
312 public class OnStageEventArgs : EventArgs
317 * @brief View - is the view that is being connected to the stage
334 * @brief Event arguments that passed via OffStage signal
337 public class OffStageEventArgs : EventArgs
342 * @brief View - is the view that is being disconnected from the stage
358 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
359 private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
360 private DaliEventHandler<object,KeyInputFocusGainedEventArgs> _KeyInputFocusGainedEventHandler;
361 private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
363 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
364 private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
365 private DaliEventHandler<object,KeyInputFocusLostEventArgs> _KeyInputFocusLostEventHandler;
366 private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
368 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
369 private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr key);
370 private DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> _KeyHandler;
371 private KeyCallbackDelegate _KeyCallbackDelegate;
373 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
374 private delegate void OnRelayoutEventCallbackDelegate(IntPtr control);
375 private DaliEventHandler<object,OnRelayoutEventArgs> _viewOnRelayoutEventHandler;
376 private OnRelayoutEventCallbackDelegate _viewOnRelayoutEventCallbackDelegate;
378 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
379 private delegate bool TouchCallbackDelegate(IntPtr view, IntPtr touch);
380 private DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> _viewTouchHandler;
381 private TouchCallbackDelegate _viewTouchCallbackDelegate;
383 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
384 private delegate bool HoverCallbackDelegate(IntPtr view, IntPtr hover);
385 private DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> _viewHoverHandler;
386 private HoverCallbackDelegate _viewHoverCallbackDelegate;
388 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
389 private delegate bool WheelCallbackDelegate(IntPtr view, IntPtr wheel);
390 private DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> _viewWheelHandler;
391 private WheelCallbackDelegate _viewWheelCallbackDelegate;
393 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
394 private delegate void OnStageEventCallbackDelegate(IntPtr control);
395 private DaliEventHandler<object,OnStageEventArgs> _viewOnStageEventHandler;
396 private OnStageEventCallbackDelegate _viewOnStageEventCallbackDelegate;
398 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
399 private delegate void OffStageEventCallbackDelegate(IntPtr control);
400 private DaliEventHandler<object,OffStageEventArgs> _viewOffStageEventHandler;
401 private OffStageEventCallbackDelegate _viewOffStageEventCallbackDelegate;
404 * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
405 * (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler<object,KeyInputFocusGainedEventArgs>)
406 * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
408 public event DaliEventHandler<object,KeyInputFocusGainedEventArgs> KeyInputFocusGained
414 // Restricted to only one listener
415 if (_KeyInputFocusGainedEventHandler == null)
417 _KeyInputFocusGainedEventHandler += value;
418 Console.WriteLine("View Key EVENT Locked....");
419 _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
420 this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
429 if (_KeyInputFocusGainedEventHandler != null)
431 this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
434 _KeyInputFocusGainedEventHandler -= value;
439 private void OnKeyInputFocusGained(IntPtr view)
441 KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
442 Console.WriteLine("View Key ....");
443 // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
444 e.View = Dali.View.GetViewFromPtr(view);
446 if (_KeyInputFocusGainedEventHandler != null)
448 //here we send all data to user event handlers
449 _KeyInputFocusGainedEventHandler(this, e);
455 * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
456 * (in the type of KeyInputFocusLostEventHandler-DaliEventHandler<object,KeyInputFocusLostEventArgs>)
457 * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
459 public event DaliEventHandler<object,KeyInputFocusLostEventArgs> KeyInputFocusLost
465 // Restricted to only one listener
466 if (_KeyInputFocusLostEventHandler == null)
468 _KeyInputFocusLostEventHandler += value;
470 _KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
471 this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
480 if (_KeyInputFocusLostEventHandler != null)
482 this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
485 _KeyInputFocusLostEventHandler -= value;
490 private void OnKeyInputFocusLost(IntPtr view)
492 KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
494 // Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
495 e.View = Dali.View.GetViewFromPtr(view);
497 if (_KeyInputFocusLostEventHandler != null)
499 //here we send all data to user event handlers
500 _KeyInputFocusLostEventHandler(this, e);
505 * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
506 * (in the type of KeyHandler-DaliEventHandlerWithReturnType<object,KeyEventArgs,bool>)
507 * provided by the user. KeyPressed signal is emitted when key event is received.
509 public event DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> KeyPressed
515 // Restricted to only one listener
516 if (_KeyHandler == null)
518 _KeyHandler += value;
520 _KeyCallbackDelegate = new KeyCallbackDelegate(OnKey);
521 this.KeyEventSignal().Connect(_KeyCallbackDelegate);
530 if (_KeyHandler != null)
532 this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
535 _KeyHandler -= value;
540 private bool OnKey(IntPtr view, IntPtr key)
542 KeyEventArgs e = new KeyEventArgs();
544 // Populate all members of "e" (KeyEventArgs) with real data
545 e.View = Dali.View.GetViewFromPtr(view);
546 e.Key = Dali.Key.GetKeyFromPtr(key);
548 if (_KeyHandler != null)
550 //here we send all data to user event handlers
551 return _KeyHandler(this, e);
558 * @brief Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler
559 * (in the type of OnRelayoutEventHandler) provided by the user.
560 * OnRelayout signal is emitted after the size has been set on the view during relayout.
562 public event DaliEventHandler<object,OnRelayoutEventArgs> OnRelayoutEvent
568 // Restricted to only one listener
569 if (_viewOnRelayoutEventHandler == null)
571 _viewOnRelayoutEventHandler += value;
572 Console.WriteLine("View OnRelayoutEventArgs Locked....");
573 _viewOnRelayoutEventCallbackDelegate = new OnRelayoutEventCallbackDelegate(OnRelayout);
574 this.OnRelayoutSignal().Connect(_viewOnRelayoutEventCallbackDelegate);
583 if (_viewOnRelayoutEventHandler != null)
585 this.OnRelayoutSignal().Disconnect(_viewOnRelayoutEventCallbackDelegate);
588 _viewOnRelayoutEventHandler -= value;
593 // Callback for View OnRelayout signal
594 private void OnRelayout(IntPtr data)
596 OnRelayoutEventArgs e = new OnRelayoutEventArgs();
597 Console.WriteLine("View OnRelayoutEventArgs....");
598 // Populate all members of "e" (OnRelayoutEventArgs) with real data
599 e.View = View.GetViewFromPtr(data);
601 if (_viewOnRelayoutEventHandler != null)
603 //here we send all data to user event handlers
604 _viewOnRelayoutEventHandler(this, e);
609 * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler
610 * (in the type of TouchHandler-DaliEventHandlerWithReturnType<object,TouchEventArgs,bool>)
611 * provided by the user. Touched signal is emitted when touch input is received.
613 public event DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> Touched
619 // Restricted to only one listener
620 if (_viewTouchHandler == null)
622 _viewTouchHandler += value;
623 Console.WriteLine("View Touch EVENT LOCKED....");
624 _viewTouchCallbackDelegate = new TouchCallbackDelegate(OnTouch);
625 this.TouchSignal().Connect(_viewTouchCallbackDelegate);
634 if (_viewTouchHandler != null)
636 this.TouchSignal().Disconnect(_viewTouchCallbackDelegate);
639 _viewTouchHandler -= value;
644 // Callback for View TouchSignal
645 private bool OnTouch(IntPtr view, IntPtr touch)
647 TouchEventArgs e = new TouchEventArgs();
648 Console.WriteLine("View Touch EVENT....");
649 // Populate all members of "e" (TouchEventArgs) with real data
650 e.View = View.GetViewFromPtr(view);
651 e.Touch = Dali.Touch.GetTouchFromPtr(touch);
653 if (_viewTouchHandler != null)
655 //here we send all data to user event handlers
656 return _viewTouchHandler(this, e);
663 * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler
664 * (in the type of HoverHandler-DaliEventHandlerWithReturnType<object,HoverEventArgs,bool>)
665 * provided by the user. Hovered signal is emitted when hover input is received.
667 public event DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> Hovered
673 // Restricted to only one listener
674 if (_viewHoverHandler == null)
676 _viewHoverHandler += value;
678 _viewHoverCallbackDelegate = new HoverCallbackDelegate(OnHover);
679 this.HoveredSignal().Connect(_viewHoverCallbackDelegate);
688 if (_viewHoverHandler != null)
690 this.HoveredSignal().Disconnect(_viewHoverCallbackDelegate);
693 _viewHoverHandler -= value;
698 // Callback for View Hover signal
699 private bool OnHover(IntPtr view, IntPtr hover)
701 HoverEventArgs e = new HoverEventArgs();
703 // Populate all members of "e" (HoverEventArgs) with real data
704 e.View = View.GetViewFromPtr(view);
705 e.Hover = Dali.Hover.GetHoverFromPtr(hover);
707 if (_viewHoverHandler != null)
709 //here we send all data to user event handlers
710 return _viewHoverHandler(this, e);
717 * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler
718 * (in the type of WheelHandler-DaliEventHandlerWithReturnType<object,WheelEventArgs,bool>)
719 * provided by the user. WheelMoved signal is emitted when wheel event is received.
721 public event DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> WheelMoved
727 // Restricted to only one listener
728 if (_viewWheelHandler == null)
730 _viewWheelHandler += value;
731 Console.WriteLine("View Wheel EVENT LOCKED....");
732 _viewWheelCallbackDelegate = new WheelCallbackDelegate(OnWheel);
733 this.WheelEventSignal().Connect(_viewWheelCallbackDelegate);
742 if (_viewWheelHandler != null)
744 this.WheelEventSignal().Disconnect(_viewWheelCallbackDelegate);
747 _viewWheelHandler -= value;
752 // Callback for View Wheel signal
753 private bool OnWheel(IntPtr view, IntPtr wheel)
755 WheelEventArgs e = new WheelEventArgs();
756 Console.WriteLine("View Wheel EVENT ....");
757 // Populate all members of "e" (WheelEventArgs) with real data
758 e.View = View.GetViewFromPtr(view);
759 e.Wheel = Dali.Wheel.GetWheelFromPtr(wheel);
761 if (_viewWheelHandler != null)
763 //here we send all data to user event handlers
764 return _viewWheelHandler(this, e);
771 * @brief Event for OnStage signal which can be used to subscribe/unsubscribe the event handler
772 * (in the type of OnStageEventHandler) provided by the user.
773 * OnStage signal is emitted after the view has been connected to the stage.
775 public event DaliEventHandler<object,OnStageEventArgs> OnStageEvent
781 // Restricted to only one listener
782 if (_viewOnStageEventHandler == null)
784 _viewOnStageEventHandler += value;
786 _viewOnStageEventCallbackDelegate = new OnStageEventCallbackDelegate(OnStage);
787 this.OnStageSignal().Connect(_viewOnStageEventCallbackDelegate);
796 if (_viewOnStageEventHandler != null)
798 this.OnStageSignal().Disconnect(_viewOnStageEventCallbackDelegate);
801 _viewOnStageEventHandler -= value;
806 // Callback for View OnStage signal
807 private void OnStage(IntPtr data)
809 OnStageEventArgs e = new OnStageEventArgs();
811 // Populate all members of "e" (OnStageEventArgs) with real data
812 e.View = View.GetViewFromPtr(data);
814 //Console.WriteLine("############# OnStage()! e.View.Name=" + e.View.Name);
816 if (_viewOnStageEventHandler != null)
818 //here we send all data to user event handlers
819 _viewOnStageEventHandler(this, e);
824 * @brief Event for OffStage signal which can be used to subscribe/unsubscribe the event handler
825 * (in the type of OffStageEventHandler) provided by the user.
826 * OffStage signal is emitted after the view has been disconnected from the stage.
828 public event DaliEventHandler<object,OffStageEventArgs> OffStageEvent
834 // Restricted to only one listener
835 if (_viewOffStageEventHandler == null)
837 _viewOffStageEventHandler += value;
839 _viewOffStageEventCallbackDelegate = new OffStageEventCallbackDelegate(OffStage);
840 this.OnStageSignal().Connect(_viewOffStageEventCallbackDelegate);
849 if (_viewOffStageEventHandler != null)
851 this.OnStageSignal().Disconnect(_viewOffStageEventCallbackDelegate);
854 _viewOffStageEventHandler -= value;
859 // Callback for View OffStage signal
860 private void OffStage(IntPtr data)
862 OffStageEventArgs e = new OffStageEventArgs();
864 // Populate all members of "e" (OffStageEventArgs) with real data
865 e.View = View.GetViewFromPtr(data);
867 if (_viewOffStageEventHandler != null)
869 //here we send all data to user event handlers
870 _viewOffStageEventHandler(this, e);
874 public static View GetViewFromPtr(global::System.IntPtr cPtr) {
875 View ret = new View(cPtr, false);
876 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
880 public class Property : global::System.IDisposable {
881 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
882 protected bool swigCMemOwn;
884 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
885 swigCMemOwn = cMemoryOwn;
886 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
889 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
890 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
897 public virtual void Dispose() {
899 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
902 NDalicPINVOKE.delete_View_Property(swigCPtr);
904 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
906 global::System.GC.SuppressFinalize(this);
910 public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
911 public static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
912 public static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
913 public static readonly int LEFT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
914 public static readonly int RIGHT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
915 public static readonly int UP_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
916 public static readonly int DOWN_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
918 public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
919 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
922 public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
923 public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
924 public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
925 public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
926 public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
930 public class KeyboardFocus : global::System.IDisposable {
931 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
932 protected bool swigCMemOwn;
934 internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
935 swigCMemOwn = cMemoryOwn;
936 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
939 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
940 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
947 public virtual void Dispose() {
949 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
952 NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
954 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
956 global::System.GC.SuppressFinalize(this);
960 public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
961 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
964 public enum Direction {
974 public View () : this (NDalicPINVOKE.View_New(), true) {
975 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
978 public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
979 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
982 public View Assign(View handle) {
983 View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
984 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
988 private new static View DownCast(BaseHandle handle) {
989 View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
990 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994 public static T DownCast<T>(Actor actor) where T : View
996 return (T)( ViewRegistry.GetViewFromActor( actor ) );
999 private View ConvertIdToView(uint id)
1005 actor = Parent.FindChildById(id);
1010 actor = Stage.Instance.GetRootLayer().FindChildById(id);
1013 return View.DownCast<View>(actor);
1016 public void SetKeyInputFocus() {
1017 NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
1018 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1021 public bool HasKeyInputFocus() {
1022 bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
1023 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1027 public void ClearKeyInputFocus() {
1028 NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
1029 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1032 public PinchGestureDetector GetPinchGestureDetector() {
1033 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
1034 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038 public PanGestureDetector GetPanGestureDetector() {
1039 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
1040 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1044 public TapGestureDetector GetTapGestureDetector() {
1045 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
1046 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1050 public LongPressGestureDetector GetLongPressGestureDetector() {
1051 LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
1052 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1056 public void SetStyleName(string styleName) {
1057 NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
1058 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1061 public string GetStyleName() {
1062 string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
1063 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1067 public void SetBackgroundColor(Vector4 color) {
1068 NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1069 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 public Vector4 GetBackgroundColor() {
1073 Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
1074 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078 public void SetBackgroundImage(Image image) {
1079 NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
1080 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1083 public void ClearBackground() {
1084 NDalicPINVOKE.View_ClearBackground(swigCPtr);
1085 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088 public ControlKeySignal KeyEventSignal() {
1089 ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
1090 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1094 public KeyInputFocusSignal KeyInputFocusGainedSignal() {
1095 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
1096 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1100 public KeyInputFocusSignal KeyInputFocusLostSignal() {
1101 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
1102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1106 public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
1107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1110 public enum PropertyRange {
1111 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
1112 CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
1113 CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000
1116 public string StyleName
1121 GetProperty( View.Property.STYLE_NAME).Get( out temp );
1126 SetProperty( View.Property.STYLE_NAME, new Dali.Property.Value( value ) );
1130 public Vector4 BackgroundColor
1134 Vector4 backgroundColor = new Vector4(0.0f,0.0f,0.0f,0.0f);
1136 Dali.Property.Map background = Background;
1138 background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
1139 if(visualType == (int)Dali.Constants.Visual.Type.Color)
1141 background.Find( Dali.Constants.ColorVisualProperty.MixColor ).Get( backgroundColor );
1144 return backgroundColor;
1148 SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1152 public string BackgroundImage
1156 string backgroundImage = "";
1158 Dali.Property.Map background = Background;
1160 background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
1161 if(visualType == (int)Dali.Constants.Visual.Type.Image)
1163 background.Find( Dali.Constants.ImageVisualProperty.URL ).Get( out backgroundImage );
1166 return backgroundImage;
1170 SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1174 public bool KeyInputFocus
1179 GetProperty( View.Property.KEY_INPUT_FOCUS).Get( ref temp );
1184 SetProperty( View.Property.KEY_INPUT_FOCUS, new Dali.Property.Value( value ) );
1188 public Dali.Property.Map Background
1192 Dali.Property.Map temp = new Dali.Property.Map();
1193 GetProperty( View.Property.BACKGROUND).Get( temp );
1198 SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1207 GetProperty( View.Property.STATE).Get( out temp );
1212 SetProperty( View.Property.STATE, new Dali.Property.Value( value ) );
1216 public string SubState
1221 GetProperty( View.Property.SUB_STATE).Get( out temp );
1226 SetProperty( View.Property.SUB_STATE, new Dali.Property.Value( value ) );
1230 public Dali.Property.Map Tooltip
1234 Dali.Property.Map temp = new Dali.Property.Map();
1235 GetProperty( View.Property.TOOLTIP).Get( temp );
1240 SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
1244 public string TooltipText
1248 SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
1252 private int LeftFocusableActorId
1257 GetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID).Get( ref temp );
1262 SetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1266 private int RightFocusableActorId
1271 GetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID).Get( ref temp );
1276 SetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1280 private int UpFocusableActorId
1285 GetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID).Get( ref temp );
1290 SetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1294 private int DownFocusableActorId
1299 GetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID).Get( ref temp );
1304 SetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1313 GetProperty( FlexContainer.ChildProperty.FLEX).Get( ref temp );
1318 SetProperty( FlexContainer.ChildProperty.FLEX, new Dali.Property.Value( value ) );
1322 public int AlignSelf
1327 GetProperty( FlexContainer.ChildProperty.ALIGN_SELF).Get( ref temp );
1332 SetProperty( FlexContainer.ChildProperty.ALIGN_SELF, new Dali.Property.Value( value ) );
1336 public Vector4 FlexMargin
1340 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
1341 GetProperty( FlexContainer.ChildProperty.FLEX_MARGIN).Get( temp );
1346 SetProperty( FlexContainer.ChildProperty.FLEX_MARGIN, new Dali.Property.Value( value ) );
1350 public Vector2 CellIndex
1354 Vector2 temp = new Vector2(0.0f,0.0f);
1355 GetProperty( TableView.ChildProperty.CELL_INDEX).Get( temp );
1360 SetProperty( TableView.ChildProperty.CELL_INDEX, new Dali.Property.Value( value ) );
1364 public float RowSpan
1369 GetProperty( TableView.ChildProperty.ROW_SPAN).Get( ref temp );
1374 SetProperty( TableView.ChildProperty.ROW_SPAN, new Dali.Property.Value( value ) );
1378 public float ColumnSpan
1383 GetProperty( TableView.ChildProperty.COLUMN_SPAN).Get( ref temp );
1388 SetProperty( TableView.ChildProperty.COLUMN_SPAN, new Dali.Property.Value( value ) );
1392 public string CellHorizontalAlignment
1397 GetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get( out temp );
1402 SetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Dali.Property.Value( value ) );
1406 public string CellVerticalAlignment
1411 GetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get( out temp );
1416 SetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Dali.Property.Value( value ) );
1421 * @brief The left focusable view.
1422 * @note This will return NULL if not set.
1423 * This will also return NULL if the specified left focusable view is not on stage.
1426 public View LeftFocusableView
1428 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1431 if (LeftFocusableActorId >= 0)
1433 return ConvertIdToView((uint)LeftFocusableActorId);
1439 LeftFocusableActorId = (int)value.GetId();
1444 * @brief The right focusable view.
1445 * @note This will return NULL if not set.
1446 * This will also return NULL if the specified right focusable view is not on stage.
1449 public View RightFocusableView
1451 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1454 if (RightFocusableActorId >= 0)
1456 return ConvertIdToView((uint)RightFocusableActorId);
1462 RightFocusableActorId = (int)value.GetId();
1467 * @brief The up focusable view.
1468 * @note This will return NULL if not set.
1469 * This will also return NULL if the specified up focusable view is not on stage.
1472 public View UpFocusableView
1474 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1477 if (UpFocusableActorId >= 0)
1479 return ConvertIdToView((uint)UpFocusableActorId);
1485 UpFocusableActorId = (int)value.GetId();
1490 * @brief The down focusable view.
1491 * @note This will return NULL if not set.
1492 * This will also return NULL if the specified down focusable view is not on stage.
1495 public View DownFocusableView
1497 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1500 if (DownFocusableActorId >= 0)
1502 return ConvertIdToView((uint)DownFocusableActorId);
1508 DownFocusableActorId = (int)value.GetId();