2 * Copyright(c) 2018 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.
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
21 namespace Tizen.NUI.BaseComponents
24 /// View is the base class for all views.
26 /// <since_tizen> 3 </since_tizen>
27 public class View : Container
29 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32 internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn)
34 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37 PositionUsesPivotPoint = false;
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47 /// Event argument passed through ChildAdded event
49 /// <since_tizen> 5 </since_tizen>
50 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public class ChildAddedEventArgs : EventArgs
55 /// Added child View at moment
57 /// <since_tizen> 5 </since_tizen>
58 public View Added { get; set; }
62 /// Event when a child is added
64 /// <since_tizen> 5 </since_tizen>
65 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public new event EventHandler<ChildAddedEventArgs> ChildAdded;
69 // From Container Base class
71 /// Adds a child view to this view.
73 /// <seealso cref="Container.Add" />
74 /// <since_tizen> 4 </since_tizen>
75 public override void Add(View child)
77 Container oldParent = child.Parent;
78 if (oldParent != this)
80 if (oldParent != null)
82 oldParent.Remove(child);
85 LayoutItem layoutItem = new LayoutItem();
86 child.Layout = layoutItem;
88 NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
89 if (NDalicPINVOKE.SWIGPendingException.Pending)
90 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 if (ChildAdded != null)
95 ChildAddedEventArgs e = new ChildAddedEventArgs
105 /// Event argument passed through ChildRemoved event
107 /// <since_tizen> 5 </since_tizen>
108 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
109 [EditorBrowsable(EditorBrowsableState.Never)]
110 public class ChildRemovedEventArgs : EventArgs
113 /// Removed child View at moment
115 /// <since_tizen> 5 </since_tizen>
116 public View Removed { get; set; }
120 /// Event when a child is removed
122 /// <since_tizen> 5 </since_tizen>
123 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
124 [EditorBrowsable(EditorBrowsableState.Never)]
125 public new event EventHandler<ChildRemovedEventArgs> ChildRemoved;
129 /// Removes a child view from this View. If the view was not a child of this view, this is a no-op.
131 /// <seealso cref="Container.Remove" />
132 /// <since_tizen> 4 </since_tizen>
133 public override void Remove(View child)
135 NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
136 if (NDalicPINVOKE.SWIGPendingException.Pending)
137 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 Children.Remove(child);
141 if (ChildRemoved != null)
143 ChildRemovedEventArgs e = new ChildRemovedEventArgs
147 ChildRemoved(this, e);
152 /// Retrieves a child view by index.
154 /// <seealso cref="Container.GetChildAt" />
155 /// <since_tizen> 4 </since_tizen>
156 public override View GetChildAt(uint index)
158 if (index < Children.Count)
160 return Children[Convert.ToInt32(index)];
169 /// Retrieves the number of children held by the view.
171 /// <seealso cref="Container.GetChildCount" />
172 /// <since_tizen> 4 </since_tizen>
173 public override uint GetChildCount()
175 return Convert.ToUInt32(Children.Count);
179 /// Gets the views parent.
181 /// <seealso cref="Container.GetParent()" />
182 /// <since_tizen> 4 </since_tizen>
183 public override Container GetParent()
185 //to fix memory leak issue, match the handle count with native side.
186 IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
187 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
188 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
189 NDalicPINVOKE.delete_BaseHandle(CPtr);
190 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
192 if (NDalicPINVOKE.SWIGPendingException.Pending)
193 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 return basehandle as Container;
198 internal bool IsTopLevelView()
200 if (GetParent() is Layer)
208 /// you can override it to clean-up your own resources.
210 /// <param name="type">DisposeTypes</param>
211 /// <since_tizen> 3 </since_tizen>
212 protected override void Dispose(DisposeTypes type)
219 if (type == DisposeTypes.Explicit)
222 //Release your own managed resources here.
223 //You should release all of your own disposable objects here.
226 //Release your own unmanaged resources here.
227 //You should not access any managed member here except static instance.
228 //because the execution order of Finalizes is non-deterministic.
231 DisConnectFromSignals();
234 if (swigCPtr.Handle != global::System.IntPtr.Zero)
239 NDalicPINVOKE.delete_View(swigCPtr);
241 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
248 private void DisConnectFromSignals()
250 // Save current CPtr.
251 global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
253 // Use BaseHandle CPtr as current might have been deleted already in derived classes.
254 swigCPtr = GetBaseHandleCPtrHandleRef;
256 if (_onRelayoutEventCallback != null)
258 this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
261 if (_offWindowEventCallback != null)
263 this.OffWindowSignal().Disconnect(_offWindowEventCallback);
266 if (_onWindowEventCallback != null)
268 this.OnWindowSignal().Disconnect(_onWindowEventCallback);
271 if (_wheelEventCallback != null)
273 this.WheelEventSignal().Disconnect(_wheelEventCallback);
276 if (_hoverEventCallback != null)
278 this.HoveredSignal().Disconnect(_hoverEventCallback);
281 if (_touchDataCallback != null)
283 this.TouchSignal().Disconnect(_touchDataCallback);
286 if (_ResourcesLoadedCallback != null)
288 this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
291 if (_offWindowEventCallback != null)
293 this.OffWindowSignal().Disconnect(_offWindowEventCallback);
296 if (_onWindowEventCallback != null)
298 this.OnWindowSignal().Disconnect(_onWindowEventCallback);
301 if (_wheelEventCallback != null)
303 this.WheelEventSignal().Disconnect(_wheelEventCallback);
306 if (_hoverEventCallback != null)
308 this.HoveredSignal().Disconnect(_hoverEventCallback);
311 if (_touchDataCallback != null)
313 this.TouchSignal().Disconnect(_touchDataCallback);
316 if (_onRelayoutEventCallback != null)
318 this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
321 if (_keyCallback != null)
323 this.KeyEventSignal().Disconnect(_keyCallback);
326 if (_keyInputFocusLostCallback != null)
328 this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
331 if (_keyInputFocusGainedCallback != null)
333 this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
336 // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
337 // Restore current CPtr.
338 swigCPtr = currentCPtr;
341 private EventHandler _keyInputFocusGainedEventHandler;
342 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
343 private delegate void KeyInputFocusGainedCallbackType(IntPtr control);
344 private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback;
347 /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
348 /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.<br />
350 /// <since_tizen> 3 </since_tizen>
351 public event EventHandler FocusGained
355 if (_keyInputFocusGainedEventHandler == null)
357 _keyInputFocusGainedCallback = OnKeyInputFocusGained;
358 this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback);
361 _keyInputFocusGainedEventHandler += value;
366 _keyInputFocusGainedEventHandler -= value;
368 if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false)
370 this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
375 private void OnKeyInputFocusGained(IntPtr view)
377 if (_keyInputFocusGainedEventHandler != null)
379 _keyInputFocusGainedEventHandler(this, null);
384 private EventHandler _keyInputFocusLostEventHandler;
385 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
386 private delegate void KeyInputFocusLostCallbackType(IntPtr control);
387 private KeyInputFocusLostCallbackType _keyInputFocusLostCallback;
390 /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
391 /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.<br />
393 /// <since_tizen> 3 </since_tizen>
394 public event EventHandler FocusLost
398 if (_keyInputFocusLostEventHandler == null)
400 _keyInputFocusLostCallback = OnKeyInputFocusLost;
401 this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback);
404 _keyInputFocusLostEventHandler += value;
409 _keyInputFocusLostEventHandler -= value;
411 if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false)
413 this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
418 private void OnKeyInputFocusLost(IntPtr view)
420 if (_keyInputFocusLostEventHandler != null)
422 _keyInputFocusLostEventHandler(this, null);
427 /// Event arguments that passed via the KeyEvent signal.
429 /// <since_tizen> 3 </since_tizen>
430 public class KeyEventArgs : EventArgs
435 /// Key - is the key sent to the view.
437 /// <since_tizen> 3 </since_tizen>
451 private EventHandlerWithReturnType<object, KeyEventArgs, bool> _keyEventHandler;
452 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
453 private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent);
454 private KeyCallbackType _keyCallback;
457 /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
458 /// The KeyPressed signal is emitted when the key event is received.<br />
460 /// <since_tizen> 3 </since_tizen>
461 public event EventHandlerWithReturnType<object, KeyEventArgs, bool> KeyEvent
465 if (_keyEventHandler == null)
467 _keyCallback = OnKeyEvent;
468 this.KeyEventSignal().Connect(_keyCallback);
471 _keyEventHandler += value;
476 _keyEventHandler -= value;
478 if (_keyEventHandler == null && KeyEventSignal().Empty() == false)
480 this.KeyEventSignal().Disconnect(_keyCallback);
485 private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
487 if (keyEvent == global::System.IntPtr.Zero)
489 NUILog.Error("keyEvent should not be null!");
493 KeyEventArgs e = new KeyEventArgs();
497 e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
499 if (_keyEventHandler != null)
501 Delegate[] delegateList = _keyEventHandler.GetInvocationList();
503 // Oring the result of each callback.
504 foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
506 result |= del(this, e);
513 private EventHandler _onRelayoutEventHandler;
514 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
515 private delegate void OnRelayoutEventCallbackType(IntPtr control);
516 private OnRelayoutEventCallbackType _onRelayoutEventCallback;
519 /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.<br />
520 /// The OnRelayout signal is emitted after the size has been set on the view during relayout.<br />
522 /// <since_tizen> 3 </since_tizen>
523 public event EventHandler Relayout
527 if (_onRelayoutEventHandler == null)
529 _onRelayoutEventCallback = OnRelayout;
530 this.OnRelayoutSignal().Connect(_onRelayoutEventCallback);
533 _onRelayoutEventHandler += value;
538 _onRelayoutEventHandler -= value;
540 if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
542 this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
548 // Callback for View OnRelayout signal
549 private void OnRelayout(IntPtr data)
551 if (_onRelayoutEventHandler != null)
553 _onRelayoutEventHandler(this, null);
558 /// Event arguments that passed via the touch signal.
560 /// <since_tizen> 3 </since_tizen>
561 public class TouchEventArgs : EventArgs
563 private Touch _touch;
566 /// Touch - contains the information of touch points.
568 /// <since_tizen> 3 </since_tizen>
582 private EventHandlerWithReturnType<object, TouchEventArgs, bool> _touchDataEventHandler;
583 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
584 private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData);
585 private TouchDataCallbackType _touchDataCallback;
588 /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
589 /// The touched signal is emitted when the touch input is received.<br />
591 /// <since_tizen> 3 </since_tizen>
592 public event EventHandlerWithReturnType<object, TouchEventArgs, bool> TouchEvent
596 if (_touchDataEventHandler == null)
598 _touchDataCallback = OnTouch;
599 this.TouchSignal().Connect(_touchDataCallback);
602 _touchDataEventHandler += value;
607 _touchDataEventHandler -= value;
609 if (_touchDataEventHandler == null && TouchSignal().Empty() == false)
611 this.TouchSignal().Disconnect(_touchDataCallback);
617 // Callback for View TouchSignal
618 private bool OnTouch(IntPtr view, IntPtr touchData)
620 if (touchData == global::System.IntPtr.Zero)
622 NUILog.Error("touchData should not be null!");
626 TouchEventArgs e = new TouchEventArgs();
628 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
630 if (_touchDataEventHandler != null)
632 return _touchDataEventHandler(this, e);
639 /// Event arguments that passed via the hover signal.
641 /// <since_tizen> 3 </since_tizen>
642 public class HoverEventArgs : EventArgs
644 private Hover _hover;
647 /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped.
649 /// <since_tizen> 3 </since_tizen>
663 private EventHandlerWithReturnType<object, HoverEventArgs, bool> _hoverEventHandler;
664 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
665 private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent);
666 private HoverEventCallbackType _hoverEventCallback;
669 /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
670 /// The hovered signal is emitted when the hover input is received.<br />
672 /// <since_tizen> 3 </since_tizen>
673 public event EventHandlerWithReturnType<object, HoverEventArgs, bool> HoverEvent
677 if (_hoverEventHandler == null)
679 _hoverEventCallback = OnHoverEvent;
680 this.HoveredSignal().Connect(_hoverEventCallback);
683 _hoverEventHandler += value;
688 _hoverEventHandler -= value;
690 if (_hoverEventHandler == null && HoveredSignal().Empty() == false)
692 this.HoveredSignal().Disconnect(_hoverEventCallback);
698 // Callback for View Hover signal
699 private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
701 if (hoverEvent == global::System.IntPtr.Zero)
703 NUILog.Error("hoverEvent should not be null!");
707 HoverEventArgs e = new HoverEventArgs();
709 e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
711 if (_hoverEventHandler != null)
713 return _hoverEventHandler(this, e);
720 /// Event arguments that passed via the wheel signal.
722 /// <since_tizen> 3 </since_tizen>
723 public class WheelEventArgs : EventArgs
725 private Wheel _wheel;
728 /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL.
730 /// <since_tizen> 3 </since_tizen>
744 private EventHandlerWithReturnType<object, WheelEventArgs, bool> _wheelEventHandler;
745 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
746 private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
747 private WheelEventCallbackType _wheelEventCallback;
750 /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
751 /// The WheelMoved signal is emitted when the wheel event is received.<br />
753 /// <since_tizen> 3 </since_tizen>
754 public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelEvent
758 if (_wheelEventHandler == null)
760 _wheelEventCallback = OnWheelEvent;
761 this.WheelEventSignal().Connect(_wheelEventCallback);
764 _wheelEventHandler += value;
769 _wheelEventHandler -= value;
771 if (_wheelEventHandler == null && WheelEventSignal().Empty() == false)
773 this.WheelEventSignal().Disconnect(_wheelEventCallback);
779 // Callback for View Wheel signal
780 private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent)
782 if (wheelEvent == global::System.IntPtr.Zero)
784 NUILog.Error("wheelEvent should not be null!");
788 WheelEventArgs e = new WheelEventArgs();
790 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
792 if (_wheelEventHandler != null)
794 return _wheelEventHandler(this, e);
800 private EventHandler _onWindowEventHandler;
801 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
802 private delegate void OnWindowEventCallbackType(IntPtr control);
803 private OnWindowEventCallbackType _onWindowEventCallback;
806 /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.<br />
807 /// The OnWindow signal is emitted after the view has been connected to the window.<br />
809 /// <since_tizen> 3 </since_tizen>
810 public event EventHandler AddedToWindow
814 if (_onWindowEventHandler == null)
816 _onWindowEventCallback = OnWindow;
817 this.OnWindowSignal().Connect(_onWindowEventCallback);
820 _onWindowEventHandler += value;
825 _onWindowEventHandler -= value;
827 if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false)
829 this.OnWindowSignal().Disconnect(_onWindowEventCallback);
834 // Callback for View OnWindow signal
835 private void OnWindow(IntPtr data)
837 if (_onWindowEventHandler != null)
839 _onWindowEventHandler(this, null);
844 private EventHandler _offWindowEventHandler;
845 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
846 private delegate void OffWindowEventCallbackType(IntPtr control);
847 private OffWindowEventCallbackType _offWindowEventCallback;
850 /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.<br />
851 /// OffWindow signal is emitted after the view has been disconnected from the window.<br />
853 /// <since_tizen> 3 </since_tizen>
854 public event EventHandler RemovedFromWindow
858 if (_offWindowEventHandler == null)
860 _offWindowEventCallback = OffWindow;
861 this.OffWindowSignal().Connect(_offWindowEventCallback);
864 _offWindowEventHandler += value;
869 _offWindowEventHandler -= value;
871 if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false)
873 this.OffWindowSignal().Disconnect(_offWindowEventCallback);
878 // Callback for View OffWindow signal
879 private void OffWindow(IntPtr data)
881 if (_offWindowEventHandler != null)
883 _offWindowEventHandler(this, null);
888 /// Event arguments of visibility changed.
890 /// <since_tizen> 3 </since_tizen>
891 public class VisibilityChangedEventArgs : EventArgs
894 private bool _visibility;
895 private VisibilityChangeType _type;
898 /// The view, or child of view, whose visibility has changed.
900 /// <since_tizen> 3 </since_tizen>
914 /// Whether the view is now visible or not.
916 /// <since_tizen> 3 </since_tizen>
917 public bool Visibility
930 /// Whether the view's visible property has changed or a parent's.
932 /// <since_tizen> 3 </since_tizen>
933 public VisibilityChangeType Type
946 private EventHandler<VisibilityChangedEventArgs> _visibilityChangedEventHandler;
947 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
948 private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type);
949 private VisibilityChangedEventCallbackType _visibilityChangedEventCallback;
952 /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.<br />
953 /// This signal is emitted when the visible property of this or a parent view is changed.<br />
955 /// <since_tizen> 3 </since_tizen>
956 public event EventHandler<VisibilityChangedEventArgs> VisibilityChanged
960 if (_visibilityChangedEventHandler == null)
962 _visibilityChangedEventCallback = OnVisibilityChanged;
963 VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback);
966 _visibilityChangedEventHandler += value;
971 _visibilityChangedEventHandler -= value;
973 if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false)
975 VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback);
980 // Callback for View visibility change signal
981 private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type)
983 VisibilityChangedEventArgs e = new VisibilityChangedEventArgs();
986 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
988 e.Visibility = visibility;
991 if (_visibilityChangedEventHandler != null)
993 _visibilityChangedEventHandler(this, e);
999 /// Event arguments of layout direction changed.
1001 /// <since_tizen> 4 </since_tizen>
1002 public class LayoutDirectionChangedEventArgs : EventArgs
1005 private ViewLayoutDirectionType _type;
1008 /// The view, or child of view, whose layout direction has changed.
1010 /// <since_tizen> 4 </since_tizen>
1024 /// Whether the view's layout direction property has changed or a parent's.
1026 /// <since_tizen> 4 </since_tizen>
1027 public ViewLayoutDirectionType Type
1040 private EventHandler<LayoutDirectionChangedEventArgs> _layoutDirectionChangedEventHandler;
1041 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1042 private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type);
1043 private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback;
1046 /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.<br />
1047 /// This signal is emitted when the layout direction property of this or a parent view is changed.<br />
1049 /// <since_tizen> 4 </since_tizen>
1050 public event EventHandler<LayoutDirectionChangedEventArgs> LayoutDirectionChanged
1054 if (_layoutDirectionChangedEventHandler == null)
1056 _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged;
1057 LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback);
1060 _layoutDirectionChangedEventHandler += value;
1065 _layoutDirectionChangedEventHandler -= value;
1067 if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false)
1069 LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback);
1074 // Callback for View layout direction change signal
1075 private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type)
1077 LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs();
1080 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
1084 if (_layoutDirectionChangedEventHandler != null)
1086 _layoutDirectionChangedEventHandler(this, e);
1096 // Resource Ready Signal
1098 private EventHandler _resourcesLoadedEventHandler;
1099 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
1100 private delegate void ResourcesLoadedCallbackType(IntPtr control);
1101 private ResourcesLoadedCallbackType _ResourcesLoadedCallback;
1104 /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
1105 /// This signal is emitted after all resources required by a view are loaded and ready.<br />
1107 /// <since_tizen> 3 </since_tizen>
1108 public event EventHandler ResourcesLoaded
1112 if (_resourcesLoadedEventHandler == null)
1114 _ResourcesLoadedCallback = OnResourcesLoaded;
1115 this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback);
1118 _resourcesLoadedEventHandler += value;
1123 _resourcesLoadedEventHandler -= value;
1125 if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
1127 this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
1132 private void OnResourcesLoaded(IntPtr view)
1134 if (_resourcesLoadedEventHandler != null)
1136 _resourcesLoadedEventHandler(this, null);
1140 internal IntPtr GetPtrfromView()
1142 return (IntPtr)swigCPtr;
1145 internal class Property
1147 internal static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
1148 internal static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
1149 internal static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
1150 internal static readonly int LEFT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
1151 internal static readonly int RIGHT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
1152 internal static readonly int UP_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
1153 internal static readonly int DOWN_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
1154 internal static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
1155 internal static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
1156 internal static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get();
1157 internal static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get();
1158 internal static readonly int SCREEN_POSITION = NDalicManualPINVOKE.Actor_Property_SCREEN_POSITION_get();
1159 internal static readonly int POSITION_USES_ANCHOR_POINT = NDalicManualPINVOKE.Actor_Property_POSITION_USES_ANCHOR_POINT_get();
1160 internal static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get();
1161 internal static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get();
1162 internal static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get();
1163 internal static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get();
1164 internal static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get();
1165 internal static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get();
1166 internal static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get();
1167 internal static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get();
1168 internal static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get();
1169 internal static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get();
1170 internal static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get();
1171 internal static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get();
1172 internal static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get();
1173 internal static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get();
1174 internal static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get();
1175 internal static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get();
1176 internal static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get();
1177 internal static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get();
1178 internal static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get();
1179 internal static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get();
1180 internal static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get();
1181 internal static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get();
1182 internal static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get();
1183 internal static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get();
1184 internal static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get();
1185 internal static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get();
1186 internal static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get();
1187 internal static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get();
1188 internal static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get();
1189 internal static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get();
1190 internal static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get();
1191 internal static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get();
1192 internal static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get();
1193 internal static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get();
1194 internal static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get();
1195 internal static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get();
1196 internal static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get();
1197 internal static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get();
1198 internal static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get();
1199 internal static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get();
1200 internal static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get();
1201 internal static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get();
1202 internal static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get();
1203 internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get();
1204 internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get();
1205 internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get();
1206 internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get();
1207 internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get();
1208 internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get();
1209 internal static readonly int PADDING = NDalicPINVOKE.View_Property_PADDING_get();
1213 /// Describes the direction to move the focus towards.
1215 /// <since_tizen> 3 </since_tizen>
1216 public enum FocusDirection
1219 /// Move keyboard focus towards the left direction.
1221 /// <since_tizen> 3 </since_tizen>
1224 /// Move keyboard focus towards the right direction.
1226 /// <since_tizen> 3 </since_tizen>
1229 /// Move keyboard focus towards the up direction.
1231 /// <since_tizen> 3 </since_tizen>
1234 /// Move keyboard focus towards the down direction.
1236 /// <since_tizen> 3 </since_tizen>
1239 /// Move keyboard focus towards the previous page direction.
1241 /// <since_tizen> 3 </since_tizen>
1244 /// Move keyboard focus towards the next page direction.
1246 /// <since_tizen> 3 </since_tizen>
1251 /// Creates a new instance of a view.
1253 /// <since_tizen> 3 </since_tizen>
1254 public View() : this(NDalicPINVOKE.View_New(), true)
1256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1259 internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true)
1261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1264 private View ConvertIdToView(uint id)
1267 if (GetParent() is View)
1269 View parentView = GetParent() as View;
1270 view = parentView.FindChildById(id);
1275 view = Window.Instance.GetRootLayer().FindChildById(id);
1281 internal void SetKeyInputFocus()
1283 NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
1284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1288 /// Queries whether the view has a focus.
1290 /// <returns>True if this view has a focus.</returns>
1291 /// <since_tizen> 3 </since_tizen>
1292 public bool HasFocus()
1294 bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
1295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1299 internal void ClearKeyInputFocus()
1301 NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
1302 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 internal PinchGestureDetector GetPinchGestureDetector()
1307 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
1308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1312 internal PanGestureDetector GetPanGestureDetector()
1314 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
1315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1319 internal TapGestureDetector GetTapGestureDetector()
1321 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
1322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1326 internal LongPressGestureDetector GetLongPressGestureDetector()
1328 LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
1329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1334 /// Sets the name of the style to be applied to the view.
1336 /// <param name="styleName">A string matching a style described in a stylesheet.</param>
1337 /// <since_tizen> 3 </since_tizen>
1338 public void SetStyleName(string styleName)
1340 NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
1341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1345 /// Retrieves the name of the style to be applied to the view (if any).
1347 /// <returns>A string matching a style, or an empty string.</returns>
1348 /// <since_tizen> 3 </since_tizen>
1349 public string GetStyleName()
1351 string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
1352 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1356 internal void SetBackgroundColor(Vector4 color)
1358 NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
1359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1362 internal Vector4 GetBackgroundColor()
1364 Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
1365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1369 internal void SetBackgroundImage(Image image)
1371 NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
1372 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1376 /// Clears the background.
1378 /// <since_tizen> 3 </since_tizen>
1379 public void ClearBackground()
1381 NDalicPINVOKE.View_ClearBackground(swigCPtr);
1382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1385 internal ControlKeySignal KeyEventSignal()
1387 ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
1388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1392 internal KeyInputFocusSignal KeyInputFocusGainedSignal()
1394 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
1395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1399 internal KeyInputFocusSignal KeyInputFocusLostSignal()
1401 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
1402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1406 internal View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true)
1408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1411 internal enum PropertyRange
1413 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
1414 CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
1415 CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000
1419 /// The StyleName, type string.
1421 /// <since_tizen> 3 </since_tizen>
1422 public string StyleName
1427 GetProperty(View.Property.STYLE_NAME).Get(out temp);
1432 SetProperty(View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue(value));
1433 NotifyPropertyChanged();
1438 /// The mutually exclusive with BACKGROUND_IMAGE and BACKGROUND type Vector4.
1440 /// <since_tizen> 3 </since_tizen>
1441 public Color BackgroundColor
1445 Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1447 Tizen.NUI.PropertyMap background = Background;
1449 background.Find(Visual.Property.Type)?.Get(out visualType);
1450 if (visualType == (int)Visual.Type.Color)
1452 background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
1455 return backgroundColor;
1459 SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
1460 NotifyPropertyChanged();
1465 /// Creates an animation to animate the background color visual. If there is no
1466 /// background visual, creates one with transparent black as it's mixColor.
1468 /// <since_tizen> 3 </since_tizen>
1469 public Animation AnimateBackgroundColor(object destinationValue,
1472 AlphaFunction.BuiltinFunctions? alphaFunction = null,
1473 object initialValue = null)
1475 Tizen.NUI.PropertyMap background = Background;
1477 if (background.Empty())
1479 // If there is no background yet, ensure there is a transparent
1481 BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
1482 background = Background;
1484 return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue);
1488 /// Creates an animation to animate the mixColor of the named visual.
1490 /// <since_tizen> 3 </since_tizen>
1491 public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null)
1493 Animation animation = null;
1495 PropertyMap _animator = new PropertyMap();
1496 if (alphaFunction != null)
1498 _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction)));
1501 PropertyMap _timePeriod = new PropertyMap();
1502 _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f));
1503 _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f));
1504 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
1506 PropertyMap _transition = new PropertyMap();
1507 _transition.Add("animator", new PropertyValue(_animator));
1508 _transition.Add("target", new PropertyValue(targetVisual));
1509 _transition.Add("property", new PropertyValue("mixColor"));
1511 if (initialColor != null)
1513 PropertyValue initValue = PropertyValue.CreateFromObject(initialColor);
1514 _transition.Add("initialValue", initValue);
1517 PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor);
1518 _transition.Add("targetValue", destValue);
1519 TransitionData _transitionData = new TransitionData(_transition);
1521 animation = new Animation(NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true);
1522 if (NDalicPINVOKE.SWIGPendingException.Pending)
1523 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1529 /// The mutually exclusive with BACKGROUND_COLOR and BACKGROUND type Map.
1531 /// <since_tizen> 3 </since_tizen>
1532 public string BackgroundImage
1536 string backgroundImage = "";
1538 Tizen.NUI.PropertyMap background = Background;
1540 background.Find(Visual.Property.Type)?.Get(out visualType);
1541 if (visualType == (int)Visual.Type.Image)
1543 background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
1546 return backgroundImage;
1550 SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
1551 NotifyPropertyChanged();
1556 /// The background of view.
1558 /// <since_tizen> 3 </since_tizen>
1559 public Tizen.NUI.PropertyMap Background
1563 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1564 GetProperty(View.Property.BACKGROUND).Get(temp);
1569 SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
1570 NotifyPropertyChanged();
1576 /// The current state of the view.
1578 /// <since_tizen> 3 </since_tizen>
1584 if (GetProperty(View.Property.STATE).Get(out temp) == false)
1586 NUILog.Error("State get error!");
1592 return States.Normal;
1596 return States.Focused;
1600 return States.Disabled;
1604 return States.Normal;
1610 SetProperty(View.Property.STATE, new Tizen.NUI.PropertyValue((int)value));
1611 NotifyPropertyChanged();
1616 /// The current sub state of the view.
1618 /// <since_tizen> 3 </since_tizen>
1619 public States SubState
1624 if (GetProperty(View.Property.SUB_STATE).Get(out temp) == false)
1626 NUILog.Error("subState get error!");
1631 return States.Normal;
1633 return States.Focused;
1635 return States.Disabled;
1637 return States.Normal;
1642 string valueToString = "";
1647 valueToString = "NORMAL";
1650 case States.Focused:
1652 valueToString = "FOCUSED";
1655 case States.Disabled:
1657 valueToString = "DISABLED";
1662 valueToString = "NORMAL";
1666 SetProperty(View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString));
1667 NotifyPropertyChanged();
1672 /// Displays a tooltip
1674 /// <since_tizen> 3 </since_tizen>
1675 public Tizen.NUI.PropertyMap Tooltip
1679 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1680 GetProperty(View.Property.TOOLTIP).Get(temp);
1685 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
1686 NotifyPropertyChanged();
1691 /// Displays a tooltip as a text.
1693 /// <since_tizen> 3 </since_tizen>
1694 public string TooltipText
1698 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
1699 NotifyPropertyChanged();
1703 private int LeftFocusableViewId
1708 GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp);
1713 SetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
1717 private int RightFocusableViewId
1722 GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp);
1727 SetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
1731 private int UpFocusableViewId
1736 GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp);
1741 SetProperty(View.Property.UP_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
1745 private int DownFocusableViewId
1750 GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp);
1755 SetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
1760 /// The Child property of FlexContainer.<br />
1761 /// The proportion of the free space in the container, the flex item will receive.<br />
1762 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
1764 /// <since_tizen> 3 </since_tizen>
1770 GetProperty(FlexContainer.ChildProperty.FLEX).Get(out temp);
1775 SetProperty(FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue(value));
1776 NotifyPropertyChanged();
1781 /// The Child property of FlexContainer.<br />
1782 /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.<br />
1784 /// <since_tizen> 3 </since_tizen>
1785 public int AlignSelf
1790 GetProperty(FlexContainer.ChildProperty.ALIGN_SELF).Get(out temp);
1795 SetProperty(FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue(value));
1796 NotifyPropertyChanged();
1801 /// The Child property of FlexContainer.<br />
1802 /// The space around the flex item.<br />
1804 /// <since_tizen> 3 </since_tizen>
1805 public Vector4 FlexMargin
1809 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1810 GetProperty(FlexContainer.ChildProperty.FLEX_MARGIN).Get(temp);
1815 SetProperty(FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue(value));
1816 NotifyPropertyChanged();
1821 /// The top-left cell this child occupies, if not set, the first available cell is used.
1823 /// <since_tizen> 3 </since_tizen>
1824 public Vector2 CellIndex
1828 Vector2 temp = new Vector2(0.0f, 0.0f);
1829 GetProperty(TableView.ChildProperty.CELL_INDEX).Get(temp);
1834 SetProperty(TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue(value));
1835 NotifyPropertyChanged();
1840 /// The number of rows this child occupies, if not set, the default value is 1.
1842 /// <since_tizen> 3 </since_tizen>
1843 public float RowSpan
1848 GetProperty(TableView.ChildProperty.ROW_SPAN).Get(out temp);
1853 SetProperty(TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue(value));
1854 NotifyPropertyChanged();
1859 /// The number of columns this child occupies, if not set, the default value is 1.
1861 /// <since_tizen> 3 </since_tizen>
1862 public float ColumnSpan
1867 GetProperty(TableView.ChildProperty.COLUMN_SPAN).Get(out temp);
1872 SetProperty(TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue(value));
1873 NotifyPropertyChanged();
1878 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1880 /// <since_tizen> 3 </since_tizen>
1881 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1886 if (GetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false)
1888 NUILog.Error("CellHorizontalAlignment get error!");
1894 return Tizen.NUI.HorizontalAlignmentType.Left;
1896 return Tizen.NUI.HorizontalAlignmentType.Center;
1898 return Tizen.NUI.HorizontalAlignmentType.Right;
1900 return Tizen.NUI.HorizontalAlignmentType.Left;
1905 string valueToString = "";
1908 case Tizen.NUI.HorizontalAlignmentType.Left:
1910 valueToString = "left";
1913 case Tizen.NUI.HorizontalAlignmentType.Center:
1915 valueToString = "center";
1918 case Tizen.NUI.HorizontalAlignmentType.Right:
1920 valueToString = "right";
1925 valueToString = "left";
1929 SetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
1930 NotifyPropertyChanged();
1935 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1937 /// <since_tizen> 3 </since_tizen>
1938 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1943 GetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp);
1945 NUILog.Error("CellVerticalAlignment get error!");
1951 return Tizen.NUI.VerticalAlignmentType.Top;
1953 return Tizen.NUI.VerticalAlignmentType.Center;
1955 return Tizen.NUI.VerticalAlignmentType.Bottom;
1957 return Tizen.NUI.VerticalAlignmentType.Top;
1962 string valueToString = "";
1965 case Tizen.NUI.VerticalAlignmentType.Top:
1967 valueToString = "top";
1970 case Tizen.NUI.VerticalAlignmentType.Center:
1972 valueToString = "center";
1975 case Tizen.NUI.VerticalAlignmentType.Bottom:
1977 valueToString = "bottom";
1982 valueToString = "top";
1986 SetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
1987 NotifyPropertyChanged();
1992 /// The left focusable view.<br />
1993 /// This will return null if not set.<br />
1994 /// This will also return null if the specified left focusable view is not on a window.<br />
1996 /// <since_tizen> 3 </since_tizen>
1997 public View LeftFocusableView
1999 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
2002 if (LeftFocusableViewId >= 0)
2004 return ConvertIdToView((uint)LeftFocusableViewId);
2012 LeftFocusableViewId = (int)value.GetId();
2016 LeftFocusableViewId = -1;
2018 NotifyPropertyChanged();
2023 /// The right focusable view.<br />
2024 /// This will return null if not set.<br />
2025 /// This will also return null if the specified right focusable view is not on a window.<br />
2027 /// <since_tizen> 3 </since_tizen>
2028 public View RightFocusableView
2030 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
2033 if (RightFocusableViewId >= 0)
2035 return ConvertIdToView((uint)RightFocusableViewId);
2043 RightFocusableViewId = (int)value.GetId();
2047 RightFocusableViewId = -1;
2049 NotifyPropertyChanged();
2054 /// The up focusable view.<br />
2055 /// This will return null if not set.<br />
2056 /// This will also return null if the specified up focusable view is not on a window.<br />
2058 /// <since_tizen> 3 </since_tizen>
2059 public View UpFocusableView
2061 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
2064 if (UpFocusableViewId >= 0)
2066 return ConvertIdToView((uint)UpFocusableViewId);
2074 UpFocusableViewId = (int)value.GetId();
2078 UpFocusableViewId = -1;
2080 NotifyPropertyChanged();
2085 /// The down focusable view.<br />
2086 /// This will return null if not set.<br />
2087 /// This will also return null if the specified down focusable view is not on a window.<br />
2089 /// <since_tizen> 3 </since_tizen>
2090 public View DownFocusableView
2092 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
2095 if (DownFocusableViewId >= 0)
2097 return ConvertIdToView((uint)DownFocusableViewId);
2105 DownFocusableViewId = (int)value.GetId();
2109 DownFocusableViewId = -1;
2111 NotifyPropertyChanged();
2116 /// Whether the view should be focusable by keyboard navigation.
2118 /// <since_tizen> 3 </since_tizen>
2119 public bool Focusable
2123 SetKeyboardFocusable(value);
2124 NotifyPropertyChanged();
2128 return IsKeyboardFocusable();
2133 /// Enumeration for describing the states of the view.
2135 /// <since_tizen> 3 </since_tizen>
2139 /// The normal state.
2143 /// The focused state.
2147 /// The disabled state.
2153 /// Retrieves the position of the view.<br />
2154 /// The coordinates are relative to the view's parent.<br />
2156 /// <since_tizen> 3 </since_tizen>
2157 public Position CurrentPosition
2161 return GetCurrentPosition();
2166 /// Sets the size of a view for the width and the height.<br />
2167 /// Geometry can be scaled to fit within this area.<br />
2168 /// This does not interfere with the view's scale factor.<br />
2169 /// The views default depth is the minimum of width and height.<br />
2171 /// <since_tizen> 3 </since_tizen>
2172 public Size2D Size2D
2176 Size temp = new Size(0.0f, 0.0f, 0.0f);
2177 GetProperty(View.Property.SIZE).Get(temp);
2178 Size2D size = new Size2D((int)temp.Width, (int)temp.Height);
2183 SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size(value)));
2184 NotifyPropertyChanged();
2189 /// Retrieves the size of the view.<br />
2190 /// The coordinates are relative to the view's parent.<br />
2192 /// <since_tizen> 3 </since_tizen>
2193 public Size2D CurrentSize
2197 return GetCurrentSize();
2202 /// Retrieves and sets the view's opacity.<br />
2204 /// <since_tizen> 3 </since_tizen>
2205 public float Opacity
2210 GetProperty(View.Property.OPACITY).Get(out temp);
2215 SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value));
2216 NotifyPropertyChanged();
2221 /// Sets the position of the view for X and Y.<br />
2222 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
2223 /// If the position inheritance is disabled, sets the world position.<br />
2225 /// <since_tizen> 3 </since_tizen>
2226 public Position2D Position2D
2230 Position temp = new Position(0.0f, 0.0f, 0.0f);
2231 GetProperty(View.Property.POSITION).Get(temp);
2232 return new Position2D(temp);
2236 SetProperty(View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position(value)));
2237 NotifyPropertyChanged();
2242 /// Retrieves the screen postion of the view.<br />
2244 /// <since_tizen> 3 </since_tizen>
2245 public Vector2 ScreenPosition
2249 Vector2 temp = new Vector2(0.0f, 0.0f);
2250 GetProperty(View.Property.SCREEN_POSITION).Get(temp);
2256 /// Determines whether the pivot point should be used to determine the position of the view.
2257 /// This is true by default.
2259 /// <remarks>If false, then the top-left of the view is used for the position.
2260 /// Setting this to false will allow scaling or rotation around the anchor-point without affecting the view's position.
2262 /// <since_tizen> 3 </since_tizen>
2263 public bool PositionUsesPivotPoint
2268 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
2273 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
2274 NotifyPropertyChanged();
2279 /// Please do not use! this will be deprecated.
2281 /// Please do not use! this will be deprecated!
2282 /// Instead please use PositionUsesPivotPoint.
2283 /// <since_tizen> 3 </since_tizen>
2284 [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " +
2286 "View view = new View(); " +
2287 "view.PivotPoint = PivotPoint.Center; " +
2288 "view.PositionUsesPivotPoint = true;")]
2289 [EditorBrowsable(EditorBrowsableState.Never)]
2290 public bool PositionUsesAnchorPoint
2295 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
2300 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
2301 NotifyPropertyChanged();
2305 internal bool FocusState
2309 return IsKeyboardFocusable();
2313 SetKeyboardFocusable(value);
2318 /// Queries whether the view is connected to the stage.<br />
2319 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
2321 /// <since_tizen> 3 </since_tizen>
2322 public bool IsOnWindow
2331 /// Gets the depth in the hierarchy for the view.
2333 /// <since_tizen> 3 </since_tizen>
2334 public int HierarchyDepth
2338 return GetHierarchyDepth();
2343 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
2346 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
2347 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
2348 /// The values set by this property will likely change.
2350 /// <since_tizen> 3 </since_tizen>
2351 public int SiblingOrder
2355 var parentChildren = GetParent()?.Children;
2356 int currentOrder = 0;
2357 if (parentChildren != null)
2359 currentOrder = parentChildren.IndexOf(this);
2361 if (currentOrder < 0)
2365 else if (currentOrder < parentChildren.Count)
2367 return currentOrder;
2377 NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
2380 var siblings = GetParent()?.Children;
2381 if (siblings != null)
2383 int currentOrder = siblings.IndexOf(this);
2384 if (value != currentOrder)
2390 else if (value < siblings.Count - 1)
2392 if (value > currentOrder)
2394 RaiseAbove(siblings[value]);
2398 LowerBelow(siblings[value]);
2407 NotifyPropertyChanged();
2412 /// Returns the natural size of the view.
2415 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
2417 /// /// Please do not use! this will be deprecated!
2418 /// Instead please use NaturalSize2D.
2419 /// <since_tizen> 3 </since_tizen>
2420 [Obsolete("Please do not use! This will be deprecated! Please use NaturalSize2D instead! " +
2422 "TextLabel label = new TextLabel(\"Hello World!\"); " +
2423 "Size2D size = label.NaturalSize2D;")]
2424 [EditorBrowsable(EditorBrowsableState.Never)]
2425 public Vector3 NaturalSize
2429 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true);
2430 if (NDalicPINVOKE.SWIGPendingException.Pending)
2431 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2437 /// Returns the natural size (Size2D) of the view.
2440 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
2442 /// <since_tizen> 4 </since_tizen>
2443 public Size2D NaturalSize2D
2447 Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true);
2448 if (NDalicPINVOKE.SWIGPendingException.Pending)
2449 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2451 return new Size2D((int)temp.Width, (int)temp.Height);
2456 /// Set the layout on this control.
2460 /// <since_tizen> 5 </since_tizen>
2461 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2462 [EditorBrowsable(EditorBrowsableState.Never)]
2463 public LayoutItem Layout
2467 IntPtr cPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(View.getCPtr(this));
2469 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2470 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2471 NDalicPINVOKE.delete_BaseHandle(CPtr);
2472 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2474 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2476 return basehandle as LayoutItem;
2480 Tizen.NUI.NDalicManualPINVOKE.SetLayout__SWIG_1(View.getCPtr(this), LayoutItem.getCPtr(value));
2488 /// This is an asynchronous method.
2490 /// <since_tizen> 3 </since_tizen>
2500 /// This is an asynchronous method.
2501 /// If the view is hidden, then the view and its children will not be rendered.
2502 /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown.
2504 /// <since_tizen> 3 </since_tizen>
2510 internal void Raise()
2512 var parentChildren = GetParent()?.Children;
2514 if (parentChildren != null)
2516 int currentIndex = parentChildren.IndexOf(this);
2518 // If the view is not already the last item in the list.
2519 if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1)
2521 View temp = parentChildren[currentIndex + 1];
2522 parentChildren[currentIndex + 1] = this;
2523 parentChildren[currentIndex] = temp;
2525 NDalicPINVOKE.Raise(swigCPtr);
2526 if (NDalicPINVOKE.SWIGPendingException.Pending)
2527 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2533 internal void Lower()
2535 var parentChildren = GetParent()?.Children;
2537 if (parentChildren != null)
2539 int currentIndex = parentChildren.IndexOf(this);
2541 // If the view is not already the first item in the list.
2542 if (currentIndex > 0 && currentIndex < parentChildren.Count)
2544 View temp = parentChildren[currentIndex - 1];
2545 parentChildren[currentIndex - 1] = this;
2546 parentChildren[currentIndex] = temp;
2548 NDalicPINVOKE.Lower(swigCPtr);
2549 if (NDalicPINVOKE.SWIGPendingException.Pending)
2550 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2556 /// Raises the view above all other views.
2559 /// Sibling order of views within the parent will be updated automatically.
2560 /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion.
2562 /// <since_tizen> 3 </since_tizen>
2563 public void RaiseToTop()
2565 var parentChildren = GetParent()?.Children;
2567 if (parentChildren != null)
2569 parentChildren.Remove(this);
2570 parentChildren.Add(this);
2572 NDalicPINVOKE.RaiseToTop(swigCPtr);
2573 if (NDalicPINVOKE.SWIGPendingException.Pending)
2574 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2580 /// Lowers the view to the bottom of all views.
2583 /// The sibling order of views within the parent will be updated automatically.
2584 /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
2586 /// <since_tizen> 3 </since_tizen>
2587 public void LowerToBottom()
2589 var parentChildren = GetParent()?.Children;
2591 if (parentChildren != null)
2593 parentChildren.Remove(this);
2594 parentChildren.Insert(0, this);
2596 NDalicPINVOKE.LowerToBottom(swigCPtr);
2597 if (NDalicPINVOKE.SWIGPendingException.Pending)
2598 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2603 /// Queries if all resources required by a view are loaded and ready.
2605 /// <remarks>Most resources are only loaded when the control is placed on the stage.
2607 /// <since_tizen> 3 </since_tizen>
2608 public bool IsResourceReady()
2610 bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr);
2611 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2616 /// Raises the view to above the target view.
2618 /// <remarks>The sibling order of views within the parent will be updated automatically.
2619 /// Views on the level above the target view will still be shown above this view.
2620 /// Raising this view above views with the same sibling order as each other will raise this view above them.
2621 /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
2623 /// <param name="target">Will be raised above this view.</param>
2624 internal void RaiseAbove(View target)
2626 var parentChildren = GetParent()?.Children;
2628 if (parentChildren != null)
2630 int currentIndex = parentChildren.IndexOf(this);
2631 int targetIndex = parentChildren.IndexOf(target);
2633 if (currentIndex < 0 || targetIndex < 0 ||
2634 currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
2636 NUILog.Error("index should be bigger than 0 and less than children of layer count");
2639 // If the currentIndex is less than the target index and the target has the same parent.
2640 if (currentIndex < targetIndex)
2642 parentChildren.Remove(this);
2643 parentChildren.Insert(targetIndex, this);
2645 NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target));
2646 if (NDalicPINVOKE.SWIGPendingException.Pending)
2647 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2654 /// Lowers the view to below the target view.
2656 /// <remarks>The sibling order of views within the parent will be updated automatically.
2657 /// Lowering this view below views with the same sibling order as each other will lower this view above them.
2658 /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
2660 /// <param name="target">Will be lowered below this view.</param>
2661 internal void LowerBelow(View target)
2663 var parentChildren = GetParent()?.Children;
2665 if (parentChildren != null)
2667 int currentIndex = parentChildren.IndexOf(this);
2668 int targetIndex = parentChildren.IndexOf(target);
2669 if (currentIndex < 0 || targetIndex < 0 ||
2670 currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
2672 NUILog.Error("index should be bigger than 0 and less than children of layer count");
2676 // If the currentIndex is not already the 0th index and the target has the same parent.
2677 if ((currentIndex != 0) && (targetIndex != -1) &&
2678 (currentIndex > targetIndex))
2680 parentChildren.Remove(this);
2681 parentChildren.Insert(targetIndex, this);
2683 NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target));
2684 if (NDalicPINVOKE.SWIGPendingException.Pending)
2685 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2691 internal string GetName()
2693 string ret = NDalicPINVOKE.Actor_GetName(swigCPtr);
2694 if (NDalicPINVOKE.SWIGPendingException.Pending)
2695 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2699 internal void SetName(string name)
2701 NDalicPINVOKE.Actor_SetName(swigCPtr, name);
2702 if (NDalicPINVOKE.SWIGPendingException.Pending)
2703 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2706 internal uint GetId()
2708 uint ret = NDalicPINVOKE.Actor_GetId(swigCPtr);
2709 if (NDalicPINVOKE.SWIGPendingException.Pending)
2710 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2714 internal bool IsRoot()
2716 bool ret = NDalicPINVOKE.Actor_IsRoot(swigCPtr);
2717 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2721 internal bool OnWindow()
2723 bool ret = NDalicPINVOKE.Actor_OnStage(swigCPtr);
2724 if (NDalicPINVOKE.SWIGPendingException.Pending)
2725 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2730 /// Gets the parent layer of this view.If a view has no parent, this method does nothing.
2732 /// <pre>The view has been initialized. </pre>
2733 /// <returns>the parent layer of view </returns>
2734 /// <since_tizen> 5 </since_tizen>
2735 public Layer GetLayer()
2737 //to fix memory leak issue, match the handle count with native side.
2738 IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
2739 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2740 Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer;
2741 NDalicPINVOKE.delete_BaseHandle(CPtr);
2742 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2744 if (NDalicPINVOKE.SWIGPendingException.Pending)
2745 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2750 /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing.
2752 /// <pre>The (child) view has been initialized. </pre>
2753 /// <since_tizen> 4 </since_tizen>
2754 public void Unparent()
2756 GetParent()?.Remove(this);
2760 /// Search through this view's hierarchy for a view with the given name.
2761 /// The view itself is also considered in the search.
2763 /// <pre>The view has been initialized.</pre>
2764 /// <param name="viewName">The name of the view to find.</param>
2765 /// <returns>A handle to the view if found, or an empty handle if not.</returns>
2766 /// <since_tizen> 3 </since_tizen>
2767 public View FindChildByName(string viewName)
2769 //to fix memory leak issue, match the handle count with native side.
2770 IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName);
2771 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2772 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
2773 NDalicPINVOKE.delete_BaseHandle(CPtr);
2774 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2776 if (NDalicPINVOKE.SWIGPendingException.Pending)
2777 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2781 internal View FindChildById(uint id)
2783 //to fix memory leak issue, match the handle count with native side.
2784 IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
2785 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2786 View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
2787 NDalicPINVOKE.delete_BaseHandle(CPtr);
2788 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2790 if (NDalicPINVOKE.SWIGPendingException.Pending)
2791 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2795 internal void SetParentOrigin(Vector3 origin)
2797 NDalicPINVOKE.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin));
2798 if (NDalicPINVOKE.SWIGPendingException.Pending)
2799 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2802 internal Vector3 GetCurrentParentOrigin()
2804 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentParentOrigin(swigCPtr), true);
2805 if (NDalicPINVOKE.SWIGPendingException.Pending)
2806 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2810 internal void SetAnchorPoint(Vector3 anchorPoint)
2812 NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
2813 if (NDalicPINVOKE.SWIGPendingException.Pending)
2814 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2817 internal Vector3 GetCurrentAnchorPoint()
2819 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentAnchorPoint(swigCPtr), true);
2820 if (NDalicPINVOKE.SWIGPendingException.Pending)
2821 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2825 internal void SetSize(float width, float height)
2827 NDalicPINVOKE.Actor_SetSize__SWIG_0(swigCPtr, width, height);
2828 if (NDalicPINVOKE.SWIGPendingException.Pending)
2829 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2832 internal void SetSize(float width, float height, float depth)
2834 NDalicPINVOKE.Actor_SetSize__SWIG_1(swigCPtr, width, height, depth);
2835 if (NDalicPINVOKE.SWIGPendingException.Pending)
2836 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2839 internal void SetSize(Vector2 size)
2841 NDalicPINVOKE.Actor_SetSize__SWIG_2(swigCPtr, Vector2.getCPtr(size));
2842 if (NDalicPINVOKE.SWIGPendingException.Pending)
2843 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2846 internal void SetSize(Vector3 size)
2848 NDalicPINVOKE.Actor_SetSize__SWIG_3(swigCPtr, Vector3.getCPtr(size));
2849 if (NDalicPINVOKE.SWIGPendingException.Pending)
2850 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2853 internal Vector3 GetTargetSize()
2855 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetTargetSize(swigCPtr), true);
2856 if (NDalicPINVOKE.SWIGPendingException.Pending)
2857 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2861 internal Size2D GetCurrentSize()
2863 Size ret = new Size(NDalicPINVOKE.Actor_GetCurrentSize(swigCPtr), true);
2864 if (NDalicPINVOKE.SWIGPendingException.Pending)
2865 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2866 Size2D size = new Size2D((int)ret.Width, (int)ret.Height);
2870 internal Vector3 GetNaturalSize()
2872 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true);
2873 if (NDalicPINVOKE.SWIGPendingException.Pending)
2874 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2878 internal void SetPosition(float x, float y)
2880 NDalicPINVOKE.Actor_SetPosition__SWIG_0(swigCPtr, x, y);
2881 if (NDalicPINVOKE.SWIGPendingException.Pending)
2882 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2885 internal void SetPosition(float x, float y, float z)
2887 NDalicPINVOKE.Actor_SetPosition__SWIG_1(swigCPtr, x, y, z);
2888 if (NDalicPINVOKE.SWIGPendingException.Pending)
2889 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2892 internal void SetPosition(Vector3 position)
2894 NDalicPINVOKE.Actor_SetPosition__SWIG_2(swigCPtr, Vector3.getCPtr(position));
2895 if (NDalicPINVOKE.SWIGPendingException.Pending)
2896 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2899 internal void SetX(float x)
2901 NDalicPINVOKE.Actor_SetX(swigCPtr, x);
2902 if (NDalicPINVOKE.SWIGPendingException.Pending)
2903 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2906 internal void SetY(float y)
2908 NDalicPINVOKE.Actor_SetY(swigCPtr, y);
2909 if (NDalicPINVOKE.SWIGPendingException.Pending)
2910 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2913 internal void SetZ(float z)
2915 NDalicPINVOKE.Actor_SetZ(swigCPtr, z);
2916 if (NDalicPINVOKE.SWIGPendingException.Pending)
2917 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2920 internal void TranslateBy(Vector3 distance)
2922 NDalicPINVOKE.Actor_TranslateBy(swigCPtr, Vector3.getCPtr(distance));
2923 if (NDalicPINVOKE.SWIGPendingException.Pending)
2924 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2927 internal Position GetCurrentPosition()
2929 Position ret = new Position(NDalicPINVOKE.Actor_GetCurrentPosition(swigCPtr), true);
2930 if (NDalicPINVOKE.SWIGPendingException.Pending)
2931 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2935 internal Vector3 GetCurrentWorldPosition()
2937 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentWorldPosition(swigCPtr), true);
2938 if (NDalicPINVOKE.SWIGPendingException.Pending)
2939 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2943 internal void SetInheritPosition(bool inherit)
2945 NDalicPINVOKE.Actor_SetInheritPosition(swigCPtr, inherit);
2946 if (NDalicPINVOKE.SWIGPendingException.Pending)
2947 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2950 internal bool IsPositionInherited()
2952 bool ret = NDalicPINVOKE.Actor_IsPositionInherited(swigCPtr);
2953 if (NDalicPINVOKE.SWIGPendingException.Pending)
2954 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2958 internal void SetOrientation(Degree angle, Vector3 axis)
2960 NDalicPINVOKE.Actor_SetOrientation__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
2961 if (NDalicPINVOKE.SWIGPendingException.Pending)
2962 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2965 internal void SetOrientation(Radian angle, Vector3 axis)
2967 NDalicPINVOKE.Actor_SetOrientation__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
2968 if (NDalicPINVOKE.SWIGPendingException.Pending)
2969 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2972 internal void SetOrientation(Rotation orientation)
2974 NDalicPINVOKE.Actor_SetOrientation__SWIG_2(swigCPtr, Rotation.getCPtr(orientation));
2975 if (NDalicPINVOKE.SWIGPendingException.Pending)
2976 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2979 internal void RotateBy(Degree angle, Vector3 axis)
2981 NDalicPINVOKE.Actor_RotateBy__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
2982 if (NDalicPINVOKE.SWIGPendingException.Pending)
2983 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2986 internal void RotateBy(Radian angle, Vector3 axis)
2988 NDalicPINVOKE.Actor_RotateBy__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
2989 if (NDalicPINVOKE.SWIGPendingException.Pending)
2990 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
2993 internal void RotateBy(Rotation relativeRotation)
2995 NDalicPINVOKE.Actor_RotateBy__SWIG_2(swigCPtr, Rotation.getCPtr(relativeRotation));
2996 if (NDalicPINVOKE.SWIGPendingException.Pending)
2997 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3000 internal Rotation GetCurrentOrientation()
3002 Rotation ret = new Rotation(NDalicPINVOKE.Actor_GetCurrentOrientation(swigCPtr), true);
3003 if (NDalicPINVOKE.SWIGPendingException.Pending)
3004 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3008 internal void SetInheritOrientation(bool inherit)
3010 NDalicPINVOKE.Actor_SetInheritOrientation(swigCPtr, inherit);
3011 if (NDalicPINVOKE.SWIGPendingException.Pending)
3012 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3015 internal bool IsOrientationInherited()
3017 bool ret = NDalicPINVOKE.Actor_IsOrientationInherited(swigCPtr);
3018 if (NDalicPINVOKE.SWIGPendingException.Pending)
3019 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3023 internal Rotation GetCurrentWorldOrientation()
3025 Rotation ret = new Rotation(NDalicPINVOKE.Actor_GetCurrentWorldOrientation(swigCPtr), true);
3026 if (NDalicPINVOKE.SWIGPendingException.Pending)
3027 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3031 internal void SetScale(float scale)
3033 NDalicPINVOKE.Actor_SetScale__SWIG_0(swigCPtr, scale);
3034 if (NDalicPINVOKE.SWIGPendingException.Pending)
3035 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3038 internal void SetScale(float scaleX, float scaleY, float scaleZ)
3040 NDalicPINVOKE.Actor_SetScale__SWIG_1(swigCPtr, scaleX, scaleY, scaleZ);
3041 if (NDalicPINVOKE.SWIGPendingException.Pending)
3042 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3045 internal void SetScale(Vector3 scale)
3047 NDalicPINVOKE.Actor_SetScale__SWIG_2(swigCPtr, Vector3.getCPtr(scale));
3048 if (NDalicPINVOKE.SWIGPendingException.Pending)
3049 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3052 internal void ScaleBy(Vector3 relativeScale)
3054 NDalicPINVOKE.Actor_ScaleBy(swigCPtr, Vector3.getCPtr(relativeScale));
3055 if (NDalicPINVOKE.SWIGPendingException.Pending)
3056 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3059 internal Vector3 GetCurrentScale()
3061 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentScale(swigCPtr), true);
3062 if (NDalicPINVOKE.SWIGPendingException.Pending)
3063 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3067 internal Vector3 GetCurrentWorldScale()
3069 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentWorldScale(swigCPtr), true);
3070 if (NDalicPINVOKE.SWIGPendingException.Pending)
3071 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3075 internal void SetInheritScale(bool inherit)
3077 NDalicPINVOKE.Actor_SetInheritScale(swigCPtr, inherit);
3078 if (NDalicPINVOKE.SWIGPendingException.Pending)
3079 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3082 internal bool IsScaleInherited()
3084 bool ret = NDalicPINVOKE.Actor_IsScaleInherited(swigCPtr);
3085 if (NDalicPINVOKE.SWIGPendingException.Pending)
3086 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3090 internal Matrix GetCurrentWorldMatrix()
3092 Matrix ret = new Matrix(NDalicPINVOKE.Actor_GetCurrentWorldMatrix(swigCPtr), true);
3093 if (NDalicPINVOKE.SWIGPendingException.Pending)
3094 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3098 internal void SetVisible(bool visible)
3100 NDalicPINVOKE.Actor_SetVisible(swigCPtr, visible);
3101 if (NDalicPINVOKE.SWIGPendingException.Pending)
3102 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3105 internal bool IsVisible()
3107 bool ret = NDalicPINVOKE.Actor_IsVisible(swigCPtr);
3108 if (NDalicPINVOKE.SWIGPendingException.Pending)
3109 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3113 internal void SetOpacity(float opacity)
3115 NDalicPINVOKE.Actor_SetOpacity(swigCPtr, opacity);
3116 if (NDalicPINVOKE.SWIGPendingException.Pending)
3117 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3120 internal float GetCurrentOpacity()
3122 float ret = NDalicPINVOKE.Actor_GetCurrentOpacity(swigCPtr);
3123 if (NDalicPINVOKE.SWIGPendingException.Pending)
3124 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3128 internal void SetColor(Vector4 color)
3130 NDalicPINVOKE.Actor_SetColor(swigCPtr, Vector4.getCPtr(color));
3131 if (NDalicPINVOKE.SWIGPendingException.Pending)
3132 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3135 internal Vector4 GetCurrentColor()
3137 Vector4 ret = new Vector4(NDalicPINVOKE.Actor_GetCurrentColor(swigCPtr), true);
3138 if (NDalicPINVOKE.SWIGPendingException.Pending)
3139 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3143 internal void SetColorMode(ColorMode colorMode)
3145 NDalicPINVOKE.Actor_SetColorMode(swigCPtr, (int)colorMode);
3146 if (NDalicPINVOKE.SWIGPendingException.Pending)
3147 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3150 internal ColorMode GetColorMode()
3152 ColorMode ret = (ColorMode)NDalicPINVOKE.Actor_GetColorMode(swigCPtr);
3153 if (NDalicPINVOKE.SWIGPendingException.Pending)
3154 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3158 internal Vector4 GetCurrentWorldColor()
3160 Vector4 ret = new Vector4(NDalicPINVOKE.Actor_GetCurrentWorldColor(swigCPtr), true);
3161 if (NDalicPINVOKE.SWIGPendingException.Pending)
3162 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3166 internal void SetDrawMode(DrawModeType drawMode)
3168 NDalicPINVOKE.Actor_SetDrawMode(swigCPtr, (int)drawMode);
3169 if (NDalicPINVOKE.SWIGPendingException.Pending)
3170 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3173 internal DrawModeType GetDrawMode()
3175 DrawModeType ret = (DrawModeType)NDalicPINVOKE.Actor_GetDrawMode(swigCPtr);
3176 if (NDalicPINVOKE.SWIGPendingException.Pending)
3177 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3182 /// Converts screen coordinates into the view's coordinate system using the default camera.
3184 /// <pre>The view has been initialized.</pre>
3185 /// <remarks>The view coordinates are relative to the top-left(0.0, 0.0, 0.5).</remarks>
3186 /// <param name="localX">On return, the X-coordinate relative to the view.</param>
3187 /// <param name="localY">On return, the Y-coordinate relative to the view.</param>
3188 /// <param name="screenX">The screen X-coordinate.</param>
3189 /// <param name="screenY">The screen Y-coordinate.</param>
3190 /// <returns>True if the conversion succeeded.</returns>
3191 /// <since_tizen> 3 </since_tizen>
3192 public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY)
3194 bool ret = NDalicPINVOKE.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY);
3195 if (NDalicPINVOKE.SWIGPendingException.Pending)
3196 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3200 internal void SetKeyboardFocusable(bool focusable)
3202 NDalicPINVOKE.Actor_SetKeyboardFocusable(swigCPtr, focusable);
3203 if (NDalicPINVOKE.SWIGPendingException.Pending)
3204 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3207 internal bool IsKeyboardFocusable()
3209 bool ret = NDalicPINVOKE.Actor_IsKeyboardFocusable(swigCPtr);
3210 if (NDalicPINVOKE.SWIGPendingException.Pending)
3211 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3215 internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
3217 NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension);
3218 if (NDalicPINVOKE.SWIGPendingException.Pending)
3219 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3222 internal ResizePolicyType GetResizePolicy(DimensionType dimension)
3224 ResizePolicyType ret = (ResizePolicyType)NDalicPINVOKE.Actor_GetResizePolicy(swigCPtr, (int)dimension);
3225 if (NDalicPINVOKE.SWIGPendingException.Pending)
3226 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3231 /// Sets the relative to parent size factor of the view.<br />
3232 /// This factor is only used when ResizePolicy is set to either:
3233 /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.<br />
3234 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.<br />
3236 /// <pre>The view has been initialized.</pre>
3237 /// <param name="factor">A Vector3 representing the relative factor to be applied to each axis.</param>
3238 /// <since_tizen> 3 </since_tizen>
3239 public void SetSizeModeFactor(Vector3 factor)
3241 NDalicPINVOKE.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor));
3242 if (NDalicPINVOKE.SWIGPendingException.Pending)
3243 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3246 internal Vector3 GetSizeModeFactor()
3248 Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetSizeModeFactor(swigCPtr), true);
3249 if (NDalicPINVOKE.SWIGPendingException.Pending)
3250 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3255 /// Calculates the height of the view given a width.<br />
3256 /// The natural size is used for default calculation.<br />
3257 /// Size 0 is treated as aspect ratio 1:1.<br />
3259 /// <param name="width">The width to use.</param>
3260 /// <returns>The height based on the width.</returns>
3261 /// <since_tizen> 3 </since_tizen>
3262 public float GetHeightForWidth(float width)
3264 float ret = NDalicPINVOKE.Actor_GetHeightForWidth(swigCPtr, width);
3265 if (NDalicPINVOKE.SWIGPendingException.Pending)
3266 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3271 /// Calculates the width of the view given a height.<br />
3272 /// The natural size is used for default calculation.<br />
3273 /// Size 0 is treated as aspect ratio 1:1.<br />
3275 /// <param name="height">The height to use.</param>
3276 /// <returns>The width based on the height.</returns>
3277 /// <since_tizen> 3 </since_tizen>
3278 public float GetWidthForHeight(float height)
3280 float ret = NDalicPINVOKE.Actor_GetWidthForHeight(swigCPtr, height);
3281 if (NDalicPINVOKE.SWIGPendingException.Pending)
3282 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3287 /// Return the amount of size allocated for relayout.
3289 /// <param name="dimension">The dimension to retrieve.</param>
3290 /// <returns>Return the size.</returns>
3291 /// <since_tizen> 3 </since_tizen>
3292 public float GetRelayoutSize(DimensionType dimension)
3294 float ret = NDalicPINVOKE.Actor_GetRelayoutSize(swigCPtr, (int)dimension);
3295 if (NDalicPINVOKE.SWIGPendingException.Pending)
3296 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3301 /// Set the padding for the view.
3303 /// <param name="padding">Padding for the view.</param>
3304 /// <since_tizen> 3 </since_tizen>
3305 public void SetPadding(PaddingType padding)
3307 NDalicPINVOKE.Actor_SetPadding(swigCPtr, PaddingType.getCPtr(padding));
3308 if (NDalicPINVOKE.SWIGPendingException.Pending)
3309 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3313 /// Return the value of padding for the view.
3315 /// <param name="paddingOut">the value of padding for the view</param>
3316 /// <since_tizen> 3 </since_tizen>
3317 public void GetPadding(PaddingType paddingOut)
3319 NDalicPINVOKE.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut));
3320 if (NDalicPINVOKE.SWIGPendingException.Pending)
3321 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3324 internal void SetMinimumSize(Vector2 size)
3326 NDalicPINVOKE.Actor_SetMinimumSize(swigCPtr, Vector2.getCPtr(size));
3327 if (NDalicPINVOKE.SWIGPendingException.Pending)
3328 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3331 internal Vector2 GetMinimumSize()
3333 Vector2 ret = new Vector2(NDalicPINVOKE.Actor_GetMinimumSize(swigCPtr), true);
3334 if (NDalicPINVOKE.SWIGPendingException.Pending)
3335 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3339 internal void SetMaximumSize(Vector2 size)
3341 NDalicPINVOKE.Actor_SetMaximumSize(swigCPtr, Vector2.getCPtr(size));
3342 if (NDalicPINVOKE.SWIGPendingException.Pending)
3343 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3346 internal Vector2 GetMaximumSize()
3348 Vector2 ret = new Vector2(NDalicPINVOKE.Actor_GetMaximumSize(swigCPtr), true);
3349 if (NDalicPINVOKE.SWIGPendingException.Pending)
3350 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3354 internal int GetHierarchyDepth()
3356 int ret = NDalicPINVOKE.Actor_GetHierarchyDepth(swigCPtr);
3357 if (NDalicPINVOKE.SWIGPendingException.Pending)
3358 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3362 /// <since_tizen> 3 </since_tizen>
3363 public uint AddRenderer(Renderer renderer)
3365 uint ret = NDalicPINVOKE.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer));
3366 if (NDalicPINVOKE.SWIGPendingException.Pending)
3367 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3371 internal uint GetRendererCount()
3373 uint ret = NDalicPINVOKE.Actor_GetRendererCount(swigCPtr);
3374 if (NDalicPINVOKE.SWIGPendingException.Pending)
3375 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3379 /// <since_tizen> 3 </since_tizen>
3380 public Renderer GetRendererAt(uint index)
3382 //to fix memory leak issue, match the handle count with native side.
3383 IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
3384 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
3385 Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
3386 NDalicPINVOKE.delete_BaseHandle(CPtr);
3387 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
3389 if (NDalicPINVOKE.SWIGPendingException.Pending)
3390 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3394 /// <since_tizen> 3 </since_tizen>
3395 public void RemoveRenderer(Renderer renderer)
3397 NDalicPINVOKE.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer));
3398 if (NDalicPINVOKE.SWIGPendingException.Pending)
3399 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3402 /// <since_tizen> 3 </since_tizen>
3403 public void RemoveRenderer(uint index)
3405 NDalicPINVOKE.Actor_RemoveRenderer__SWIG_1(swigCPtr, index);
3406 if (NDalicPINVOKE.SWIGPendingException.Pending)
3407 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3410 internal TouchDataSignal TouchSignal()
3412 TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(swigCPtr), false);
3413 if (NDalicPINVOKE.SWIGPendingException.Pending)
3414 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3418 internal HoverSignal HoveredSignal()
3420 HoverSignal ret = new HoverSignal(NDalicPINVOKE.Actor_HoveredSignal(swigCPtr), false);
3421 if (NDalicPINVOKE.SWIGPendingException.Pending)
3422 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3426 internal WheelSignal WheelEventSignal()
3428 WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(swigCPtr), false);
3429 if (NDalicPINVOKE.SWIGPendingException.Pending)
3430 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3434 internal ViewSignal OnWindowSignal()
3436 ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OnStageSignal(swigCPtr), false);
3437 if (NDalicPINVOKE.SWIGPendingException.Pending)
3438 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3442 internal ViewSignal OffWindowSignal()
3444 ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OffStageSignal(swigCPtr), false);
3445 if (NDalicPINVOKE.SWIGPendingException.Pending)
3446 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3450 internal ViewSignal OnRelayoutSignal()
3452 ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OnRelayoutSignal(swigCPtr), false);
3453 if (NDalicPINVOKE.SWIGPendingException.Pending)
3454 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3458 internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view)
3460 ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(NDalicPINVOKE.VisibilityChangedSignal(View.getCPtr(view)), false);
3461 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3466 internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view)
3468 ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false);
3469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3474 internal ViewSignal ResourcesLoadedSignal()
3476 ViewSignal ret = new ViewSignal(NDalicPINVOKE.ResourceReadySignal(swigCPtr), false);
3477 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3482 /// Gets or sets the origin of a view within its parent's area.<br />
3483 /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
3484 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
3485 /// A view's position is the distance between this origin and the view's anchor-point.<br />
3487 /// <pre>The view has been initialized.</pre>
3488 /// <since_tizen> 3 </since_tizen>
3489 public Position ParentOrigin
3493 Position temp = new Position(0.0f, 0.0f, 0.0f);
3494 GetProperty(View.Property.PARENT_ORIGIN).Get(temp);
3499 SetProperty(View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue(value));
3500 NotifyPropertyChanged();
3504 internal float ParentOriginX
3509 GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp);
3514 SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value));
3515 NotifyPropertyChanged();
3519 internal float ParentOriginY
3524 GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp);
3529 SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value));
3530 NotifyPropertyChanged();
3534 internal float ParentOriginZ
3539 GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp);
3544 SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value));
3545 NotifyPropertyChanged();
3550 /// Gets or sets the anchor-point of a view.<br />
3551 /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
3552 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
3553 /// A view position is the distance between its parent-origin and this anchor-point.<br />
3554 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
3555 /// <pre>The view has been initialized.</pre>
3557 /// <since_tizen> 3 </since_tizen>
3558 public Position PivotPoint
3562 Position temp = new Position(0.0f, 0.0f, 0.0f);
3563 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
3568 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
3569 NotifyPropertyChanged();
3573 internal float PivotPointX
3578 GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp);
3583 SetProperty(View.Property.ANCHOR_POINT_X, new Tizen.NUI.PropertyValue(value));
3587 internal float PivotPointY
3592 GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp);
3597 SetProperty(View.Property.ANCHOR_POINT_Y, new Tizen.NUI.PropertyValue(value));
3601 internal float PivotPointZ
3606 GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp);
3611 SetProperty(View.Property.ANCHOR_POINT_Z, new Tizen.NUI.PropertyValue(value));
3616 /// Gets or sets the size width of the view.
3618 /// <since_tizen> 3 </since_tizen>
3619 public float SizeWidth
3624 GetProperty(View.Property.SIZE_WIDTH).Get(out temp);
3629 SetProperty(View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue(value));
3630 NotifyPropertyChanged();
3635 /// Gets or sets the size height of the view.
3637 /// <since_tizen> 3 </since_tizen>
3638 public float SizeHeight
3643 GetProperty(View.Property.SIZE_HEIGHT).Get(out temp);
3648 SetProperty(View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue(value));
3649 NotifyPropertyChanged();
3654 /// Gets or sets the position of the view.<br />
3655 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
3656 /// If the position inheritance is disabled, sets the world position.<br />
3658 /// <since_tizen> 3 </since_tizen>
3659 public Position Position
3663 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
3664 GetProperty(View.Property.POSITION).Get(temp);
3669 SetProperty(View.Property.POSITION, new Tizen.NUI.PropertyValue(value));
3670 NotifyPropertyChanged();
3675 /// Gets or sets the position X of the view.
3677 /// <since_tizen> 3 </since_tizen>
3678 public float PositionX
3683 GetProperty(View.Property.POSITION_X).Get(out temp);
3688 SetProperty(View.Property.POSITION_X, new Tizen.NUI.PropertyValue(value));
3689 NotifyPropertyChanged();
3694 /// Gets or sets the position Y of the view.
3696 /// <since_tizen> 3 </since_tizen>
3697 public float PositionY
3702 GetProperty(View.Property.POSITION_Y).Get(out temp);
3707 SetProperty(View.Property.POSITION_Y, new Tizen.NUI.PropertyValue(value));
3708 NotifyPropertyChanged();
3713 /// Gets or sets the position Z of the view.
3715 /// <since_tizen> 3 </since_tizen>
3716 public float PositionZ
3721 GetProperty(View.Property.POSITION_Z).Get(out temp);
3726 SetProperty(View.Property.POSITION_Z, new Tizen.NUI.PropertyValue(value));
3727 NotifyPropertyChanged();
3732 /// Gets or sets the world position of the view.
3734 /// <since_tizen> 3 </since_tizen>
3735 public Vector3 WorldPosition
3739 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
3740 GetProperty(View.Property.WORLD_POSITION).Get(temp);
3745 internal float WorldPositionX
3750 GetProperty(View.Property.WORLD_POSITION_X).Get(out temp);
3755 internal float WorldPositionY
3760 GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp);
3765 internal float WorldPositionZ
3770 GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp);
3776 /// Gets or sets the orientation of the view.<br />
3777 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
3779 /// <remarks>This is an asynchronous method.</remarks>
3780 /// <since_tizen> 3 </since_tizen>
3781 public Rotation Orientation
3785 Rotation temp = new Rotation();
3786 GetProperty(View.Property.ORIENTATION).Get(temp);
3791 SetProperty(View.Property.ORIENTATION, new Tizen.NUI.PropertyValue(value));
3792 NotifyPropertyChanged();
3797 /// Gets or sets the world orientation of the view.<br />
3799 /// <since_tizen> 3 </since_tizen>
3800 public Rotation WorldOrientation
3804 Rotation temp = new Rotation();
3805 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
3811 /// Gets or sets the scale factor applied to the view.<br />
3813 /// <since_tizen> 3 </since_tizen>
3814 public Vector3 Scale
3818 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
3819 GetProperty(View.Property.SCALE).Get(temp);
3824 SetProperty(View.Property.SCALE, new Tizen.NUI.PropertyValue(value));
3825 NotifyPropertyChanged();
3830 /// Gets or sets the scale X factor applied to the view.
3832 /// <since_tizen> 3 </since_tizen>
3838 GetProperty(View.Property.SCALE_X).Get(out temp);
3843 SetProperty(View.Property.SCALE_X, new Tizen.NUI.PropertyValue(value));
3844 NotifyPropertyChanged();
3849 /// Gets or sets the scale Y factor applied to the view.
3851 /// <since_tizen> 3 </since_tizen>
3857 GetProperty(View.Property.SCALE_Y).Get(out temp);
3862 SetProperty(View.Property.SCALE_Y, new Tizen.NUI.PropertyValue(value));
3863 NotifyPropertyChanged();
3868 /// Gets or sets the scale Z factor applied to the view.
3870 /// <since_tizen> 3 </since_tizen>
3876 GetProperty(View.Property.SCALE_Z).Get(out temp);
3881 SetProperty(View.Property.SCALE_Z, new Tizen.NUI.PropertyValue(value));
3882 NotifyPropertyChanged();
3887 /// Gets the world scale of the view.
3889 /// <since_tizen> 3 </since_tizen>
3890 public Vector3 WorldScale
3894 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
3895 GetProperty(View.Property.WORLD_SCALE).Get(temp);
3901 /// Retrieves the visibility flag of the view.
3904 /// If the view is not visible, then the view and its children will not be rendered.
3905 /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true.
3907 /// <since_tizen> 3 </since_tizen>
3908 public bool Visibility
3913 GetProperty(View.Property.VISIBLE).Get(out temp);
3919 /// Gets the view's world color.
3921 /// <since_tizen> 3 </since_tizen>
3922 public Vector4 WorldColor
3926 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
3927 GetProperty(View.Property.WORLD_COLOR).Get(temp);
3932 internal Matrix WorldMatrix
3936 Matrix temp = new Matrix();
3937 GetProperty(View.Property.WORLD_MATRIX).Get(temp);
3943 /// Gets or sets the view's name.
3945 /// <since_tizen> 3 </since_tizen>
3951 GetProperty(View.Property.NAME).Get(out temp);
3956 SetProperty(View.Property.NAME, new Tizen.NUI.PropertyValue(value));
3957 NotifyPropertyChanged();
3962 /// Get the number of children held by the view.
3964 /// <since_tizen> 3 </since_tizen>
3965 public new uint ChildCount
3969 return GetChildCount();
3974 /// Gets the view's ID.
3977 /// <since_tizen> 3 </since_tizen>
3987 /// Gets or sets the status of whether the view should emit touch or hover signals.
3989 /// <since_tizen> 3 </since_tizen>
3990 public bool Sensitive
3995 GetProperty(View.Property.SENSITIVE).Get(out temp);
4000 SetProperty(View.Property.SENSITIVE, new Tizen.NUI.PropertyValue(value));
4001 NotifyPropertyChanged();
4006 /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view.
4008 /// <since_tizen> 3 </since_tizen>
4009 public bool LeaveRequired
4014 GetProperty(View.Property.LEAVE_REQUIRED).Get(out temp);
4019 SetProperty(View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue(value));
4020 NotifyPropertyChanged();
4025 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
4027 /// <since_tizen> 3 </since_tizen>
4028 public bool InheritOrientation
4033 GetProperty(View.Property.INHERIT_ORIENTATION).Get(out temp);
4038 SetProperty(View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue(value));
4039 NotifyPropertyChanged();
4044 /// Gets or sets the status of whether a child view inherits it's parent's scale.
4046 /// <since_tizen> 3 </since_tizen>
4047 public bool InheritScale
4052 GetProperty(View.Property.INHERIT_SCALE).Get(out temp);
4057 SetProperty(View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue(value));
4058 NotifyPropertyChanged();
4063 /// Gets or sets the status of how the view and its children should be drawn.<br />
4064 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
4065 /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.<br />
4066 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
4067 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
4068 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
4070 /// <since_tizen> 3 </since_tizen>
4071 public DrawModeType DrawMode
4076 if (GetProperty(View.Property.DRAW_MODE).Get(out temp) == false)
4078 NUILog.Error("DrawMode get error!");
4083 return DrawModeType.Normal;
4085 return DrawModeType.Overlay2D;
4087 return DrawModeType.Stencil;
4089 return DrawModeType.Normal;
4094 SetProperty(View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)value));
4095 NotifyPropertyChanged();
4100 /// Gets or sets the relative to parent size factor of the view.<br />
4101 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
4102 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
4104 /// <since_tizen> 3 </since_tizen>
4105 public Vector3 SizeModeFactor
4109 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
4110 GetProperty(View.Property.SIZE_MODE_FACTOR).Get(temp);
4115 SetProperty(View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue(value));
4116 NotifyPropertyChanged();
4121 /// Gets or sets the width resize policy to be used.
4123 /// <since_tizen> 3 </since_tizen>
4124 public ResizePolicyType WidthResizePolicy
4129 if (GetProperty(View.Property.WIDTH_RESIZE_POLICY).Get(out temp) == false)
4131 NUILog.Error("WidthResizePolicy get error!");
4136 return ResizePolicyType.Fixed;
4137 case "USE_NATURAL_SIZE":
4138 return ResizePolicyType.UseNaturalSize;
4139 case "FILL_TO_PARENT":
4140 return ResizePolicyType.FillToParent;
4141 case "SIZE_RELATIVE_TO_PARENT":
4142 return ResizePolicyType.SizeRelativeToParent;
4143 case "SIZE_FIXED_OFFSET_FROM_PARENT":
4144 return ResizePolicyType.SizeFixedOffsetFromParent;
4145 case "FIT_TO_CHILDREN":
4146 return ResizePolicyType.FitToChildren;
4147 case "DIMENSION_DEPENDENCY":
4148 return ResizePolicyType.DimensionDependency;
4149 case "USE_ASSIGNED_SIZE":
4150 return ResizePolicyType.UseAssignedSize;
4152 return ResizePolicyType.Fixed;
4157 SetProperty(View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)value));
4158 NotifyPropertyChanged();
4163 /// Gets or sets the height resize policy to be used.
4165 /// <since_tizen> 3 </since_tizen>
4166 public ResizePolicyType HeightResizePolicy
4171 if (GetProperty(View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false)
4173 NUILog.Error("HeightResizePolicy get error!");
4178 return ResizePolicyType.Fixed;
4179 case "USE_NATURAL_SIZE":
4180 return ResizePolicyType.UseNaturalSize;
4181 case "FILL_TO_PARENT":
4182 return ResizePolicyType.FillToParent;
4183 case "SIZE_RELATIVE_TO_PARENT":
4184 return ResizePolicyType.SizeRelativeToParent;
4185 case "SIZE_FIXED_OFFSET_FROM_PARENT":
4186 return ResizePolicyType.SizeFixedOffsetFromParent;
4187 case "FIT_TO_CHILDREN":
4188 return ResizePolicyType.FitToChildren;
4189 case "DIMENSION_DEPENDENCY":
4190 return ResizePolicyType.DimensionDependency;
4191 case "USE_ASSIGNED_SIZE":
4192 return ResizePolicyType.UseAssignedSize;
4194 return ResizePolicyType.Fixed;
4199 SetProperty(View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)value));
4200 NotifyPropertyChanged();
4205 /// Gets or sets the policy to use when setting size with size negotiation.<br />
4206 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
4208 /// <since_tizen> 3 </since_tizen>
4209 public SizeScalePolicyType SizeScalePolicy
4214 if (GetProperty(View.Property.SIZE_SCALE_POLICY).Get(out temp) == false)
4216 NUILog.Error("SizeScalePolicy get error!");
4220 case "USE_SIZE_SET":
4221 return SizeScalePolicyType.UseSizeSet;
4222 case "FIT_WITH_ASPECT_RATIO":
4223 return SizeScalePolicyType.FitWithAspectRatio;
4224 case "FILL_WITH_ASPECT_RATIO":
4225 return SizeScalePolicyType.FillWithAspectRatio;
4227 return SizeScalePolicyType.UseSizeSet;
4232 string valueToString = "";
4235 case SizeScalePolicyType.UseSizeSet:
4237 valueToString = "USE_SIZE_SET";
4240 case SizeScalePolicyType.FitWithAspectRatio:
4242 valueToString = "FIT_WITH_ASPECT_RATIO";
4245 case SizeScalePolicyType.FillWithAspectRatio:
4247 valueToString = "FILL_WITH_ASPECT_RATIO";
4252 valueToString = "USE_SIZE_SET";
4256 SetProperty(View.Property.SIZE_SCALE_POLICY, new Tizen.NUI.PropertyValue(valueToString));
4257 NotifyPropertyChanged();
4262 /// Gets or sets the status of whether the width size is dependent on the height size.
4264 /// <since_tizen> 3 </since_tizen>
4265 public bool WidthForHeight
4270 GetProperty(View.Property.WIDTH_FOR_HEIGHT).Get(out temp);
4275 SetProperty(View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue(value));
4276 NotifyPropertyChanged();
4281 /// Gets or sets the status of whether the height size is dependent on the width size.
4283 /// <since_tizen> 3 </since_tizen>
4284 public bool HeightForWidth
4289 GetProperty(View.Property.HEIGHT_FOR_WIDTH).Get(out temp);
4294 SetProperty(View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue(value));
4295 NotifyPropertyChanged();
4300 /// Gets or sets the padding for use in layout.
4302 /// <since_tizen> 5 </since_tizen>
4303 public Extents Padding
4307 Extents temp = new Extents(0, 0, 0, 0);
4308 GetProperty(View.Property.PADDING).Get(temp);
4313 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
4314 NotifyPropertyChanged();
4319 /// Gets or sets the minimum size the view can be assigned in size negotiation.
4321 /// <since_tizen> 3 </since_tizen>
4322 public Size2D MinimumSize
4326 Size2D temp = new Size2D(0, 0);
4327 GetProperty(View.Property.MINIMUM_SIZE).Get(temp);
4332 SetProperty(View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue(value));
4333 NotifyPropertyChanged();
4338 /// Gets or sets the maximum size the view can be assigned in size negotiation.
4340 /// <since_tizen> 3 </since_tizen>
4341 public Size2D MaximumSize
4345 Size2D temp = new Size2D(0, 0);
4346 GetProperty(View.Property.MAXIMUM_SIZE).Get(temp);
4351 SetProperty(View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue(value));
4352 NotifyPropertyChanged();
4357 /// Gets or sets whether a child view inherits it's parent's position.<br />
4358 /// Default is to inherit.<br />
4359 /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.<br />
4361 /// <since_tizen> 3 </since_tizen>
4362 public bool InheritPosition
4367 GetProperty(View.Property.INHERIT_POSITION).Get(out temp);
4372 SetProperty(View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue(value));
4373 NotifyPropertyChanged();
4378 /// Gets or sets the clipping behavior (mode) of it's children.
4380 /// <since_tizen> 3 </since_tizen>
4381 public ClippingModeType ClippingMode
4386 if (GetProperty(View.Property.CLIPPING_MODE).Get(out temp) == false)
4388 NUILog.Error("ClippingMode get error!");
4393 return ClippingModeType.Disabled;
4394 case "CLIP_CHILDREN":
4395 return ClippingModeType.ClipChildren;
4396 case "CLIP_TO_BOUNDING_BOX":
4397 return ClippingModeType.ClipToBoundingBox;
4399 return ClippingModeType.Disabled;
4404 SetProperty(View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)value));
4405 NotifyPropertyChanged();
4410 /// Gets the number of renderers held by the view.
4412 /// <since_tizen> 3 </since_tizen>
4413 public uint RendererCount
4417 return GetRendererCount();
4422 /// [Obsolete("Please do not use! this will be deprecated")]
4424 /// <since_tizen> 3 </since_tizen>
4425 /// Please do not use! this will be deprecated!
4426 /// Instead please use PivotPoint.
4427 [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " +
4429 "View view = new View(); " +
4430 "view.PivotPoint = PivotPoint.Center; " +
4431 "view.PositionUsesPivotPoint = true;")]
4432 [EditorBrowsable(EditorBrowsableState.Never)]
4433 public Position AnchorPoint
4437 Position temp = new Position(0.0f, 0.0f, 0.0f);
4438 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
4443 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
4444 NotifyPropertyChanged();
4449 /// [Obsolete("Please do not use! this will be deprecated")]
4451 /// <since_tizen> 3 </since_tizen>
4452 [Obsolete("Please do not use! This will be deprecated! Please use Size2D instead! " +
4454 "View view = new View(); " +
4455 "view.Size2D = new Size2D(100, 100);")]
4456 [EditorBrowsable(EditorBrowsableState.Never)]
4461 Size temp = new Size(0.0f, 0.0f, 0.0f);
4462 GetProperty(View.Property.SIZE).Get(temp);
4467 SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value));
4468 NotifyPropertyChanged();
4473 /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!"
4475 /// <since_tizen> 3 </since_tizen>
4476 [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " +
4478 "Container parent = view.GetParent(); " +
4479 "View view = parent as View;")]
4480 [EditorBrowsable(EditorBrowsableState.Never)]
4481 public new View Parent
4486 IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
4487 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
4488 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
4490 if (basehandle is Layer layer)
4492 ret = new View(Layer.getCPtr(layer).Handle, false);
4493 NUILog.Error("This Parent property is deprecated, shoud do not be used");
4497 ret = basehandle as View;
4500 NDalicPINVOKE.delete_BaseHandle(CPtr);
4501 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
4503 if (NDalicPINVOKE.SWIGPendingException.Pending)
4504 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
4510 /// Gets/Sets whether inherit parent's the layout Direction.
4512 /// <since_tizen> 4 </since_tizen>
4513 public bool InheritLayoutDirection
4518 GetProperty(View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp);
4523 SetProperty(View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue(value));
4524 NotifyPropertyChanged();
4529 /// Gets/Sets the layout Direction.
4531 /// <since_tizen> 4 </since_tizen>
4532 public ViewLayoutDirectionType LayoutDirection
4537 if (GetProperty(View.Property.LAYOUT_DIRECTION).Get(out temp) == false)
4539 NUILog.Error("LAYOUT_DIRECTION get error!");
4541 return (ViewLayoutDirectionType)temp;
4545 SetProperty(View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)value));
4546 NotifyPropertyChanged();
4551 /// Gets or sets the Margin for use in layout.
4553 /// <since_tizen> 4 </since_tizen>
4554 public Extents Margin
4558 Extents temp = new Extents(0, 0, 0, 0);
4559 GetProperty(View.Property.MARGIN).Get(temp);
4564 SetProperty(View.Property.MARGIN, new Tizen.NUI.PropertyValue(value));
4565 NotifyPropertyChanged();
4570 /// [Obsolete("Please do not use! this will be deprecated")]
4572 /// Please do not use! this will be deprecated!
4573 /// Instead please use Padding.
4574 /// <since_tizen> 4 </since_tizen>
4575 [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")]
4576 [EditorBrowsable(EditorBrowsableState.Never)]
4577 public Extents PaddingEX
4581 Extents temp = new Extents(0, 0, 0, 0);
4582 GetProperty(View.Property.PADDING).Get(temp);
4587 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
4588 NotifyPropertyChanged();
4593 /// Perform an action on a visual registered to this view. <br />
4594 /// Visuals will have actions, this API is used to perform one of these actions with the given attributes.
4596 /// <param name="propertyIndexOfVisual">The Property index of the visual.</param>
4597 /// <param name="propertyIndexOfActionId">The action to perform. See Visual to find supported actions.</param>
4598 /// <param name="attributes">Optional attributes for the action.</param>
4599 /// <since_tizen> 5 </since_tizen>
4600 public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes)
4602 NDalicManualPINVOKE.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes));
4603 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
4606 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4607 [EditorBrowsable(EditorBrowsableState.Never)]
4608 public int WidthSpecificationFixed
4613 if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false)
4615 NUILog.Error("WidthSpecificationFixed get error!");
4621 SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
4625 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4626 [EditorBrowsable(EditorBrowsableState.Never)]
4627 public int HeightSpecificationFixed
4632 if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false)
4634 NUILog.Error("HeightSpecificationFixed get error!");
4640 SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value));
4644 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4645 [EditorBrowsable(EditorBrowsableState.Never)]
4646 public ChildLayoutData WidthSpecification
4651 if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false)
4653 NUILog.Error("WidthSpecificationFixed get error!");
4655 return (ChildLayoutData)tmp;
4659 SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value));
4663 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4664 [EditorBrowsable(EditorBrowsableState.Never)]
4665 public ChildLayoutData HeightSpecification
4670 if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false)
4672 NUILog.Error("HeightSpecificationFixed get error!");
4674 return (ChildLayoutData)tmp;
4678 SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value));
4689 /// The View layout Direction type.
4691 /// <since_tizen> 4 </since_tizen>
4692 public enum ViewLayoutDirectionType
4697 /// <since_tizen> 4 </since_tizen>
4702 /// <since_tizen> 4 </since_tizen>
4706 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
4707 [EditorBrowsable(EditorBrowsableState.Never)]
4708 public enum ChildLayoutData