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);
32 // By default, we do not want the position to use the anchor point
33 this.PositionUsesAnchorPoint = false;
36 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
37 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
41 DisposeQueue.Instance.Add(this);
43 // Unregister this instance of view from the view registry.
44 ViewRegistry.UnregisterView(this);
47 public override void Dispose() {
48 if (!Stage.IsInstalled()) {
49 DisposeQueue.Instance.Add(this);
54 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
57 NDalicPINVOKE.delete_View(swigCPtr);
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 global::System.GC.SuppressFinalize(this);
67 * @brief Event arguments that passed via KeyInputFocusGained signal
70 public class KeyInputFocusGainedEventArgs : EventArgs
75 * @brief View - is the view that gets Key Input Focus
92 * @brief Event arguments that passed via KeyInputFocusLost signal
95 public class KeyInputFocusLostEventArgs : EventArgs
100 * @brief View - is the view that loses Key Input Focus
117 * @brief Event arguments that passed via Key signal
120 public class KeyEventArgs : EventArgs
126 * @brief View - is the view that recieves the key.
142 * @brief Key - is the key sent to the View.
159 * @brief Event arguments that passed via OnRelayout signal
162 public class OnRelayoutEventArgs : EventArgs
167 * @brief View - is the view that is being resized upon relayout
185 * @brief Event arguments that passed via Touch signal
188 public class TouchEventArgs : EventArgs
191 private Touch _touch;
194 * @brief View - is the view that is being touched
210 * @brief Touch - contains the information of touch points
227 * @brief Event arguments that passed via Hover signal
230 public class HoverEventArgs : EventArgs
233 private Hover _hover;
236 * @brief View - is the view that is being hovered
252 * @brief Hover - contains touch points that represent the points
253 * that are currently being hovered or the points where a hover has stopped
270 * @brief Event arguments that passed via Wheel signal
273 public class WheelEventArgs : EventArgs
276 private Wheel _wheel;
279 * @brief View - is the view that is being wheeled
295 * @brief Wheel - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL
312 * @brief Event arguments that passed via OnStage signal
315 public class OnStageEventArgs : EventArgs
320 * @brief View - is the view that is being connected to the stage
337 * @brief Event arguments that passed via OffStage signal
340 public class OffStageEventArgs : EventArgs
345 * @brief View - is the view that is being disconnected from the stage
361 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
362 private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
363 private DaliEventHandler<object,KeyInputFocusGainedEventArgs> _KeyInputFocusGainedEventHandler;
364 private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
366 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
367 private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
368 private DaliEventHandler<object,KeyInputFocusLostEventArgs> _KeyInputFocusLostEventHandler;
369 private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
371 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
372 private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr key);
373 private DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> _KeyHandler;
374 private KeyCallbackDelegate _KeyCallbackDelegate;
376 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
377 private delegate void OnRelayoutEventCallbackDelegate(IntPtr control);
378 private DaliEventHandler<object,OnRelayoutEventArgs> _viewOnRelayoutEventHandler;
379 private OnRelayoutEventCallbackDelegate _viewOnRelayoutEventCallbackDelegate;
381 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
382 private delegate bool TouchCallbackDelegate(IntPtr view, IntPtr touch);
383 private DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> _viewTouchHandler;
384 private TouchCallbackDelegate _viewTouchCallbackDelegate;
386 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
387 private delegate bool HoverCallbackDelegate(IntPtr view, IntPtr hover);
388 private DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> _viewHoverHandler;
389 private HoverCallbackDelegate _viewHoverCallbackDelegate;
391 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
392 private delegate bool WheelCallbackDelegate(IntPtr view, IntPtr wheel);
393 private DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> _viewWheelHandler;
394 private WheelCallbackDelegate _viewWheelCallbackDelegate;
396 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
397 private delegate void OnStageEventCallbackDelegate(IntPtr control);
398 private DaliEventHandler<object,OnStageEventArgs> _viewOnStageEventHandler;
399 private OnStageEventCallbackDelegate _viewOnStageEventCallbackDelegate;
401 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
402 private delegate void OffStageEventCallbackDelegate(IntPtr control);
403 private DaliEventHandler<object,OffStageEventArgs> _viewOffStageEventHandler;
404 private OffStageEventCallbackDelegate _viewOffStageEventCallbackDelegate;
407 * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
408 * (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler<object,KeyInputFocusGainedEventArgs>)
409 * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
411 public event DaliEventHandler<object,KeyInputFocusGainedEventArgs> KeyInputFocusGained
417 // Restricted to only one listener
418 if (_KeyInputFocusGainedEventHandler == null)
420 _KeyInputFocusGainedEventHandler += value;
421 Console.WriteLine("View Key EVENT Locked....");
422 _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
423 this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
432 if (_KeyInputFocusGainedEventHandler != null)
434 this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
437 _KeyInputFocusGainedEventHandler -= value;
442 private void OnKeyInputFocusGained(IntPtr view)
444 KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
445 Console.WriteLine("View Key ....");
446 // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
447 e.View = Dali.View.GetViewFromPtr(view);
449 if (_KeyInputFocusGainedEventHandler != null)
451 //here we send all data to user event handlers
452 _KeyInputFocusGainedEventHandler(this, e);
458 * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
459 * (in the type of KeyInputFocusLostEventHandler-DaliEventHandler<object,KeyInputFocusLostEventArgs>)
460 * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
462 public event DaliEventHandler<object,KeyInputFocusLostEventArgs> KeyInputFocusLost
468 // Restricted to only one listener
469 if (_KeyInputFocusLostEventHandler == null)
471 _KeyInputFocusLostEventHandler += value;
473 _KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
474 this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
483 if (_KeyInputFocusLostEventHandler != null)
485 this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
488 _KeyInputFocusLostEventHandler -= value;
493 private void OnKeyInputFocusLost(IntPtr view)
495 KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
497 // Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
498 e.View = Dali.View.GetViewFromPtr(view);
500 if (_KeyInputFocusLostEventHandler != null)
502 //here we send all data to user event handlers
503 _KeyInputFocusLostEventHandler(this, e);
508 * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
509 * (in the type of KeyHandler-DaliEventHandlerWithReturnType<object,KeyEventArgs,bool>)
510 * provided by the user. KeyPressed signal is emitted when key event is received.
512 public event DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> KeyPressed
518 // Restricted to only one listener
519 if (_KeyHandler == null)
521 _KeyHandler += value;
523 _KeyCallbackDelegate = new KeyCallbackDelegate(OnKey);
524 this.KeyEventSignal().Connect(_KeyCallbackDelegate);
533 if (_KeyHandler != null)
535 this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
538 _KeyHandler -= value;
543 private bool OnKey(IntPtr view, IntPtr key)
545 KeyEventArgs e = new KeyEventArgs();
547 // Populate all members of "e" (KeyEventArgs) with real data
548 e.View = Dali.View.GetViewFromPtr(view);
549 e.Key = Dali.Key.GetKeyFromPtr(key);
551 if (_KeyHandler != null)
553 //here we send all data to user event handlers
554 return _KeyHandler(this, e);
561 * @brief Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler
562 * (in the type of OnRelayoutEventHandler) provided by the user.
563 * OnRelayout signal is emitted after the size has been set on the view during relayout.
565 public event DaliEventHandler<object,OnRelayoutEventArgs> OnRelayoutEvent
571 // Restricted to only one listener
572 if (_viewOnRelayoutEventHandler == null)
574 _viewOnRelayoutEventHandler += value;
575 Console.WriteLine("View OnRelayoutEventArgs Locked....");
576 _viewOnRelayoutEventCallbackDelegate = new OnRelayoutEventCallbackDelegate(OnRelayout);
577 this.OnRelayoutSignal().Connect(_viewOnRelayoutEventCallbackDelegate);
586 if (_viewOnRelayoutEventHandler != null)
588 this.OnRelayoutSignal().Disconnect(_viewOnRelayoutEventCallbackDelegate);
591 _viewOnRelayoutEventHandler -= value;
596 // Callback for View OnRelayout signal
597 private void OnRelayout(IntPtr data)
599 OnRelayoutEventArgs e = new OnRelayoutEventArgs();
600 Console.WriteLine("View OnRelayoutEventArgs....");
601 // Populate all members of "e" (OnRelayoutEventArgs) with real data
602 e.View = View.GetViewFromPtr(data);
604 if (_viewOnRelayoutEventHandler != null)
606 //here we send all data to user event handlers
607 _viewOnRelayoutEventHandler(this, e);
612 * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler
613 * (in the type of TouchHandler-DaliEventHandlerWithReturnType<object,TouchEventArgs,bool>)
614 * provided by the user. Touched signal is emitted when touch input is received.
616 public event DaliEventHandlerWithReturnType<object,TouchEventArgs,bool> Touched
622 // Restricted to only one listener
623 if (_viewTouchHandler == null)
625 _viewTouchHandler += value;
626 Console.WriteLine("View Touch EVENT LOCKED....");
627 _viewTouchCallbackDelegate = new TouchCallbackDelegate(OnTouch);
628 this.TouchSignal().Connect(_viewTouchCallbackDelegate);
637 if (_viewTouchHandler != null)
639 this.TouchSignal().Disconnect(_viewTouchCallbackDelegate);
642 _viewTouchHandler -= value;
647 // Callback for View TouchSignal
648 private bool OnTouch(IntPtr view, IntPtr touch)
650 TouchEventArgs e = new TouchEventArgs();
651 Console.WriteLine("View Touch EVENT....");
652 // Populate all members of "e" (TouchEventArgs) with real data
653 e.View = View.GetViewFromPtr(view);
654 e.Touch = Dali.Touch.GetTouchFromPtr(touch);
656 if (_viewTouchHandler != null)
658 //here we send all data to user event handlers
659 return _viewTouchHandler(this, e);
666 * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler
667 * (in the type of HoverHandler-DaliEventHandlerWithReturnType<object,HoverEventArgs,bool>)
668 * provided by the user. Hovered signal is emitted when hover input is received.
670 public event DaliEventHandlerWithReturnType<object,HoverEventArgs,bool> Hovered
676 // Restricted to only one listener
677 if (_viewHoverHandler == null)
679 _viewHoverHandler += value;
681 _viewHoverCallbackDelegate = new HoverCallbackDelegate(OnHover);
682 this.HoveredSignal().Connect(_viewHoverCallbackDelegate);
691 if (_viewHoverHandler != null)
693 this.HoveredSignal().Disconnect(_viewHoverCallbackDelegate);
696 _viewHoverHandler -= value;
701 // Callback for View Hover signal
702 private bool OnHover(IntPtr view, IntPtr hover)
704 HoverEventArgs e = new HoverEventArgs();
706 // Populate all members of "e" (HoverEventArgs) with real data
707 e.View = View.GetViewFromPtr(view);
708 e.Hover = Dali.Hover.GetHoverFromPtr(hover);
710 if (_viewHoverHandler != null)
712 //here we send all data to user event handlers
713 return _viewHoverHandler(this, e);
720 * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler
721 * (in the type of WheelHandler-DaliEventHandlerWithReturnType<object,WheelEventArgs,bool>)
722 * provided by the user. WheelMoved signal is emitted when wheel event is received.
724 public event DaliEventHandlerWithReturnType<object,WheelEventArgs,bool> WheelMoved
730 // Restricted to only one listener
731 if (_viewWheelHandler == null)
733 _viewWheelHandler += value;
734 Console.WriteLine("View Wheel EVENT LOCKED....");
735 _viewWheelCallbackDelegate = new WheelCallbackDelegate(OnWheel);
736 this.WheelEventSignal().Connect(_viewWheelCallbackDelegate);
745 if (_viewWheelHandler != null)
747 this.WheelEventSignal().Disconnect(_viewWheelCallbackDelegate);
750 _viewWheelHandler -= value;
755 // Callback for View Wheel signal
756 private bool OnWheel(IntPtr view, IntPtr wheel)
758 WheelEventArgs e = new WheelEventArgs();
759 Console.WriteLine("View Wheel EVENT ....");
760 // Populate all members of "e" (WheelEventArgs) with real data
761 e.View = View.GetViewFromPtr(view);
762 e.Wheel = Dali.Wheel.GetWheelFromPtr(wheel);
764 if (_viewWheelHandler != null)
766 //here we send all data to user event handlers
767 return _viewWheelHandler(this, e);
774 * @brief Event for OnStage signal which can be used to subscribe/unsubscribe the event handler
775 * (in the type of OnStageEventHandler) provided by the user.
776 * OnStage signal is emitted after the view has been connected to the stage.
778 public event DaliEventHandler<object,OnStageEventArgs> OnStageEvent
784 // Restricted to only one listener
785 if (_viewOnStageEventHandler == null)
787 _viewOnStageEventHandler += value;
789 _viewOnStageEventCallbackDelegate = new OnStageEventCallbackDelegate(OnStage);
790 this.OnStageSignal().Connect(_viewOnStageEventCallbackDelegate);
799 if (_viewOnStageEventHandler != null)
801 this.OnStageSignal().Disconnect(_viewOnStageEventCallbackDelegate);
804 _viewOnStageEventHandler -= value;
809 // Callback for View OnStage signal
810 private void OnStage(IntPtr data)
812 OnStageEventArgs e = new OnStageEventArgs();
814 // Populate all members of "e" (OnStageEventArgs) with real data
815 e.View = View.GetViewFromPtr(data);
817 //Console.WriteLine("############# OnStage()! e.View.Name=" + e.View.Name);
819 if (_viewOnStageEventHandler != null)
821 //here we send all data to user event handlers
822 _viewOnStageEventHandler(this, e);
827 * @brief Event for OffStage signal which can be used to subscribe/unsubscribe the event handler
828 * (in the type of OffStageEventHandler) provided by the user.
829 * OffStage signal is emitted after the view has been disconnected from the stage.
831 public event DaliEventHandler<object,OffStageEventArgs> OffStageEvent
837 // Restricted to only one listener
838 if (_viewOffStageEventHandler == null)
840 _viewOffStageEventHandler += value;
842 _viewOffStageEventCallbackDelegate = new OffStageEventCallbackDelegate(OffStage);
843 this.OnStageSignal().Connect(_viewOffStageEventCallbackDelegate);
852 if (_viewOffStageEventHandler != null)
854 this.OnStageSignal().Disconnect(_viewOffStageEventCallbackDelegate);
857 _viewOffStageEventHandler -= value;
862 // Callback for View OffStage signal
863 private void OffStage(IntPtr data)
865 OffStageEventArgs e = new OffStageEventArgs();
867 // Populate all members of "e" (OffStageEventArgs) with real data
868 e.View = View.GetViewFromPtr(data);
870 if (_viewOffStageEventHandler != null)
872 //here we send all data to user event handlers
873 _viewOffStageEventHandler(this, e);
877 public static View GetViewFromPtr(global::System.IntPtr cPtr) {
878 View ret = new View(cPtr, false);
879 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
883 public class Property : global::System.IDisposable {
884 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
885 protected bool swigCMemOwn;
887 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
888 swigCMemOwn = cMemoryOwn;
889 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
892 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
893 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
900 public virtual void Dispose() {
902 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
905 NDalicPINVOKE.delete_View_Property(swigCPtr);
907 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
909 global::System.GC.SuppressFinalize(this);
913 public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
914 public static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
915 public static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
916 public static readonly int LEFT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
917 public static readonly int RIGHT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
918 public static readonly int UP_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
919 public static readonly int DOWN_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
921 public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
922 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
925 public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
926 public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
927 public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
928 public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
929 public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
933 public class KeyboardFocus : global::System.IDisposable {
934 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
935 protected bool swigCMemOwn;
937 internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
938 swigCMemOwn = cMemoryOwn;
939 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
942 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
943 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
950 public virtual void Dispose() {
952 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
955 NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
957 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
959 global::System.GC.SuppressFinalize(this);
963 public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
964 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
967 public enum Direction {
977 public View () : this (NDalicPINVOKE.View_New(), true) {
978 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
981 public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
982 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
985 public View Assign(View handle) {
986 View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
987 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
991 private new static View DownCast(BaseHandle handle) {
992 View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
993 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
997 public static T DownCast<T>(Actor actor) where T : View
999 return (T)( ViewRegistry.GetViewFromActor( actor ) );
1002 private View ConvertIdToView(uint id)
1008 actor = Parent.FindChildById(id);
1013 actor = Stage.Instance.GetRootLayer().FindChildById(id);
1016 return View.DownCast<View>(actor);
1019 public void SetKeyInputFocus() {
1020 NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
1021 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1024 public bool HasKeyInputFocus() {
1025 bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
1026 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1030 public void ClearKeyInputFocus() {
1031 NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
1032 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1035 public PinchGestureDetector GetPinchGestureDetector() {
1036 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
1037 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1041 public PanGestureDetector GetPanGestureDetector() {
1042 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
1043 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1047 public TapGestureDetector GetTapGestureDetector() {
1048 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
1049 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053 public LongPressGestureDetector GetLongPressGestureDetector() {
1054 LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
1055 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059 public void SetStyleName(string styleName) {
1060 NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
1061 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1064 public string GetStyleName() {
1065 string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
1066 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1070 public void SetBackgroundColor(Vector4 color) {
1071 NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1072 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1075 public Vector4 GetBackgroundColor() {
1076 Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
1077 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1081 public void SetBackgroundImage(Image image) {
1082 NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
1083 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1086 public void ClearBackground() {
1087 NDalicPINVOKE.View_ClearBackground(swigCPtr);
1088 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1091 public ControlKeySignal KeyEventSignal() {
1092 ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
1093 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1097 public KeyInputFocusSignal KeyInputFocusGainedSignal() {
1098 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
1099 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1103 public KeyInputFocusSignal KeyInputFocusLostSignal() {
1104 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
1105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1109 public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
1110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1113 public enum PropertyRange {
1114 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
1115 CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
1116 CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000
1119 public string StyleName
1124 GetProperty( View.Property.STYLE_NAME).Get( out temp );
1129 SetProperty( View.Property.STYLE_NAME, new Dali.Property.Value( value ) );
1133 public Vector4 BackgroundColor
1137 Vector4 backgroundColor = new Vector4(0.0f,0.0f,0.0f,0.0f);
1139 Dali.Property.Map background = Background;
1141 background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
1142 if(visualType == (int)Dali.Constants.Visual.Type.Color)
1144 background.Find( Dali.Constants.ColorVisualProperty.MixColor ).Get( backgroundColor );
1147 return backgroundColor;
1151 SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1155 public string BackgroundImage
1159 string backgroundImage = "";
1161 Dali.Property.Map background = Background;
1163 background.Find( Dali.Constants.Visual.Property.Type ).Get( ref visualType );
1164 if(visualType == (int)Dali.Constants.Visual.Type.Image)
1166 background.Find( Dali.Constants.ImageVisualProperty.URL ).Get( out backgroundImage );
1169 return backgroundImage;
1173 SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1177 public bool KeyInputFocus
1182 GetProperty( View.Property.KEY_INPUT_FOCUS).Get( ref temp );
1187 SetProperty( View.Property.KEY_INPUT_FOCUS, new Dali.Property.Value( value ) );
1191 public Dali.Property.Map Background
1195 Dali.Property.Map temp = new Dali.Property.Map();
1196 GetProperty( View.Property.BACKGROUND).Get( temp );
1201 SetProperty( View.Property.BACKGROUND, new Dali.Property.Value( value ) );
1210 GetProperty( View.Property.STATE).Get( out temp );
1215 SetProperty( View.Property.STATE, new Dali.Property.Value( value ) );
1219 public string SubState
1224 GetProperty( View.Property.SUB_STATE).Get( out temp );
1229 SetProperty( View.Property.SUB_STATE, new Dali.Property.Value( value ) );
1233 public Dali.Property.Map Tooltip
1237 Dali.Property.Map temp = new Dali.Property.Map();
1238 GetProperty( View.Property.TOOLTIP).Get( temp );
1243 SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
1247 public string TooltipText
1251 SetProperty( View.Property.TOOLTIP, new Dali.Property.Value( value ) );
1255 private int LeftFocusableActorId
1260 GetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID).Get( ref temp );
1265 SetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1269 private int RightFocusableActorId
1274 GetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID).Get( ref temp );
1279 SetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1283 private int UpFocusableActorId
1288 GetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID).Get( ref temp );
1293 SetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1297 private int DownFocusableActorId
1302 GetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID).Get( ref temp );
1307 SetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) );
1316 GetProperty( FlexContainer.ChildProperty.FLEX).Get( ref temp );
1321 SetProperty( FlexContainer.ChildProperty.FLEX, new Dali.Property.Value( value ) );
1325 public int AlignSelf
1330 GetProperty( FlexContainer.ChildProperty.ALIGN_SELF).Get( ref temp );
1335 SetProperty( FlexContainer.ChildProperty.ALIGN_SELF, new Dali.Property.Value( value ) );
1339 public Vector4 FlexMargin
1343 Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);
1344 GetProperty( FlexContainer.ChildProperty.FLEX_MARGIN).Get( temp );
1349 SetProperty( FlexContainer.ChildProperty.FLEX_MARGIN, new Dali.Property.Value( value ) );
1353 public Vector2 CellIndex
1357 Vector2 temp = new Vector2(0.0f,0.0f);
1358 GetProperty( TableView.ChildProperty.CELL_INDEX).Get( temp );
1363 SetProperty( TableView.ChildProperty.CELL_INDEX, new Dali.Property.Value( value ) );
1367 public float RowSpan
1372 GetProperty( TableView.ChildProperty.ROW_SPAN).Get( ref temp );
1377 SetProperty( TableView.ChildProperty.ROW_SPAN, new Dali.Property.Value( value ) );
1381 public float ColumnSpan
1386 GetProperty( TableView.ChildProperty.COLUMN_SPAN).Get( ref temp );
1391 SetProperty( TableView.ChildProperty.COLUMN_SPAN, new Dali.Property.Value( value ) );
1395 public string CellHorizontalAlignment
1400 GetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get( out temp );
1405 SetProperty( TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Dali.Property.Value( value ) );
1409 public string CellVerticalAlignment
1414 GetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get( out temp );
1419 SetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Dali.Property.Value( value ) );
1424 * @brief The left focusable view.
1425 * @note This will return NULL if not set.
1426 * This will also return NULL if the specified left focusable view is not on stage.
1429 public View LeftFocusableView
1431 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1434 if (LeftFocusableActorId >= 0)
1436 return ConvertIdToView((uint)LeftFocusableActorId);
1442 LeftFocusableActorId = (int)value.GetId();
1447 * @brief The right focusable view.
1448 * @note This will return NULL if not set.
1449 * This will also return NULL if the specified right focusable view is not on stage.
1452 public View RightFocusableView
1454 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1457 if (RightFocusableActorId >= 0)
1459 return ConvertIdToView((uint)RightFocusableActorId);
1465 RightFocusableActorId = (int)value.GetId();
1470 * @brief The up focusable view.
1471 * @note This will return NULL if not set.
1472 * This will also return NULL if the specified up focusable view is not on stage.
1475 public View UpFocusableView
1477 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1480 if (UpFocusableActorId >= 0)
1482 return ConvertIdToView((uint)UpFocusableActorId);
1488 UpFocusableActorId = (int)value.GetId();
1493 * @brief The down focusable view.
1494 * @note This will return NULL if not set.
1495 * This will also return NULL if the specified down focusable view is not on stage.
1498 public View DownFocusableView
1500 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1503 if (DownFocusableActorId >= 0)
1505 return ConvertIdToView((uint)DownFocusableActorId);
1511 DownFocusableActorId = (int)value.GetId();