[NUI] Fix TCT error
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewPublicMethods.cs
1 /*
2  * Copyright(c) 2020 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Reflection;
21 using System.Runtime.InteropServices;
22 using Tizen.NUI.Binding;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// View is the base class for all views.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public partial class View
31     {
32         /// <summary>
33         /// Perform an action on a visual registered to this view. <br />
34         /// Visuals will have actions. This API is used to perform one of these actions with the given attributes.
35         /// </summary>
36         /// <param name="propertyIndexOfVisual">The Property index of the visual.</param>
37         /// <param name="propertyIndexOfActionId">The action to perform. See Visual to find the supported actions.</param>
38         /// <param name="attributes">Optional attributes for the action.</param>
39         /// <since_tizen> 5 </since_tizen>
40         public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes)
41         {
42             Interop.View.DoAction(SwigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes));
43             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44         }
45
46         /// <summary>
47         /// Creates an animation to animate the background color visual. If there is no
48         /// background visual, creates one with transparent black as it's mixColor.
49         /// </summary>
50         /// <since_tizen> 3 </since_tizen>
51         public Animation AnimateBackgroundColor(object destinationValue,
52                                                  int startTime,
53                                                  int endTime,
54                                                  AlphaFunction.BuiltinFunctions? alphaFunction = null,
55                                                  object initialValue = null)
56         {
57             Tizen.NUI.PropertyMap background = Background;
58
59             if (background.Empty())
60             {
61                 // If there is no background yet, ensure there is a transparent
62                 // color visual
63                 BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
64                 background = Background;
65             }
66             return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue);
67         }
68
69         /// <summary>
70         /// Creates an animation to animate the mixColor of the named visual.
71         /// </summary>
72         /// <since_tizen> 3 </since_tizen>
73         public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null)
74         {
75             Animation animation = null;
76             using (PropertyMap animator = new PropertyMap())
77             using (PropertyMap timePeriod = new PropertyMap())
78             using (PropertyValue pvDuration = new PropertyValue((endTime - startTime) / 1000.0f))
79             using (PropertyValue pvDelay = new PropertyValue(startTime / 1000.0f))
80             using (PropertyMap transition = new PropertyMap())
81             using (PropertyValue pvTarget = new PropertyValue(targetVisual))
82             using (PropertyValue pvProperty = new PropertyValue("mixColor"))
83             using (PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor))
84             {
85                 if (alphaFunction != null)
86                 {
87                     using (PropertyValue pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction)))
88                     {
89                         animator.Add("alphaFunction", pvAlpha);
90                     }
91                 }
92
93                 timePeriod.Add("duration", pvDuration);
94                 timePeriod.Add("delay", pvDelay);
95                 using (PropertyValue pvTimePeriod = new PropertyValue(timePeriod))
96                 {
97                     animator.Add("timePeriod", pvTimePeriod);
98                 }
99                 using (PropertyValue pvAnimator = new PropertyValue(animator))
100                 {
101                     transition.Add("animator", pvAnimator);
102                 }
103                 transition.Add("target", pvTarget);
104                 transition.Add("property", pvProperty);
105
106                 if (initialColor != null)
107                 {
108                     using (PropertyValue initValue = PropertyValue.CreateFromObject(initialColor))
109                     {
110                         transition.Add("initialValue", initValue);
111                     }
112                 }
113
114                 transition.Add("targetValue", destValue);
115                 using (TransitionData transitionData = new TransitionData(transition))
116                 {
117                     animation = new Animation(Interop.View.CreateTransition(SwigCPtr, TransitionData.getCPtr(transitionData)), true);
118                 }
119                 if (NDalicPINVOKE.SWIGPendingException.Pending)
120                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121             }
122             return animation;
123         }
124
125         // From Container Base class
126         /// <summary>
127         /// Adds a child view to this view.
128         /// </summary>
129         /// <seealso cref="Container.Add" />
130         /// <since_tizen> 4 </since_tizen>
131         public override void Add(View child)
132         {
133             bool hasLayout = (layout != null);
134
135             if (null == child)
136             {
137                 Tizen.Log.Fatal("NUI", "Child is null");
138                 return;
139             }
140
141             Container oldParent = child.GetParent();
142             if (oldParent != this)
143             {
144                 // If child already has a parent then re-parent child
145                 if (oldParent != null)
146                 {
147                     if (child.Layout != null)
148                     {
149                         child.Layout.SetReplaceFlag();
150                     }
151                     oldParent.Remove(child);
152                 }
153                 child.InternalParent = this;
154
155                 Interop.Actor.Add(SwigCPtr, View.getCPtr(child));
156
157                 if (NDalicPINVOKE.SWIGPendingException.Pending)
158                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159                 Children.Add(child);
160
161                 if (ChildAdded != null)
162                 {
163                     ChildAddedEventArgs e = new ChildAddedEventArgs
164                     {
165                         Added = child
166                     };
167                     ChildAdded(this, e);
168                 }
169
170                 AddChildBindableObject(child);
171             }
172         }
173
174         /// <summary>
175         /// Removes a child view from this View. If the view was not a child of this view, this is a no-op.
176         /// </summary>
177         /// <seealso cref="Container.Remove" />
178         /// <since_tizen> 4 </since_tizen>
179         /// <exception cref="InvalidOperationException">Thrown when deleting a view that is not a child of this view</exception>
180         public override void Remove(View child)
181         {
182             if (child == null || child.GetParent() == null) // Early out if child null.
183                 return;
184
185             if (child.GetParent() != this)
186             {
187                 //throw new System.InvalidOperationException("You have deleted a view that is not a child of this view.");
188                 Tizen.Log.Error("NUI", "You have deleted a view that is not a child of this view.");
189             }
190
191             bool hasLayout = (layout != null);
192
193             // If View has a layout then do a deferred child removal
194             // Actual child removal is performed by the layouting system so
195             // transitions can be completed.
196             if (hasLayout)
197             {
198                 (layout as LayoutGroup)?.RemoveChildFromLayoutGroup(child);
199             }
200
201             RemoveChild(child);
202         }
203
204         /// <summary>
205         /// Retrieves a child view by index.
206         /// </summary>
207         /// <seealso cref="Container.GetChildAt" />
208         /// <since_tizen> 4 </since_tizen>
209         public override View GetChildAt(uint index)
210         {
211             if (index < Children.Count)
212             {
213                 return Children[Convert.ToInt32(index)];
214             }
215             else
216             {
217                 return null;
218             }
219         }
220
221         /// <summary>
222         /// Retrieves the number of children held by the view.
223         /// </summary>
224         /// <seealso cref="Container.GetChildCount" />
225         /// <since_tizen> 4 </since_tizen>
226         [Obsolete("Deprecated in API9, will be removed in API11. Please use ChildCount property instead!")]
227         public override uint GetChildCount()
228         {
229             return Convert.ToUInt32(Children.Count);
230         }
231
232         /// <summary>
233         /// Gets the views parent.
234         /// </summary>
235         /// <seealso cref="Container.GetParent()" />
236         /// <since_tizen> 4 </since_tizen>
237         public override Container GetParent()
238         {
239             if (InternalParent)
240             {
241                 return this.InternalParent as Container;
242             }
243             return null;
244         }
245
246         /// <summary>
247         /// Queries whether the view has a focus.
248         /// </summary>
249         /// <returns>True if this view has a focus.</returns>
250         /// <since_tizen> 3 </since_tizen>
251         public bool HasFocus()
252         {
253             bool ret = false;
254             if (SwigCPtr.Handle != global::System.IntPtr.Zero)
255             {
256                 ret = Interop.View.HasKeyInputFocus(SwigCPtr);
257                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258             }
259             else
260             {
261                 Tizen.Log.Error("NUI", "swigCPtr of view is already disposed.");
262             }
263             return ret;
264         }
265
266         /// <summary>
267         /// Sets the name of the style to be applied to the view.
268         /// </summary>
269         /// <param name="styleName">A string matching a style described in a stylesheet.</param>
270         /// <since_tizen> 3 </since_tizen>
271         [Obsolete("Deprecated in API9, will be removed in API11. Please use StyleName property instead!")]
272         public void SetStyleName(string styleName)
273         {
274             Interop.View.SetStyleName(SwigCPtr, styleName);
275             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276         }
277
278         /// <summary>
279         /// Retrieves the name of the style to be applied to the view (if any).
280         /// </summary>
281         /// <returns>A string matching a style, or an empty string.</returns>
282         /// <since_tizen> 3 </since_tizen>
283         [Obsolete("Deprecated in API9, will be removed in API11. Please use StyleName property instead!")]
284         public string GetStyleName()
285         {
286             string ret = Interop.View.GetStyleName(SwigCPtr);
287             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288             return ret;
289         }
290
291         /// <summary>
292         /// Clears the background.
293         /// </summary>
294         /// <since_tizen> 3 </since_tizen>
295         public void ClearBackground()
296         {
297             Interop.View.ClearBackground(SwigCPtr);
298             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299         }
300
301         /// <summary>
302         /// Shows the view.
303         /// </summary>
304         /// <remarks>
305         /// This is an asynchronous method.
306         /// </remarks>
307         /// <since_tizen> 3 </since_tizen>
308         public void Show()
309         {
310             if (Accessibility.Accessibility.Enabled && ((AccessibilityCalculateStates() & AccessibilityStates.Modal) != 0))
311             {
312                 RegisterPopup();
313             }
314
315             SetVisible(true);
316         }
317
318         /// <summary>
319         /// Hides the view.
320         /// </summary>
321         /// <remarks>
322         /// This is an asynchronous method.
323         /// If the view is hidden, then the view and its children will not be rendered.
324         /// 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.
325         /// </remarks>
326         /// <since_tizen> 3 </since_tizen>
327         public void Hide()
328         {
329             SetVisible(false);
330
331             if (Accessibility.Accessibility.Enabled && ((AccessibilityCalculateStates() & AccessibilityStates.Modal) != 0))
332             {
333                 RemovePopup();
334             }
335         }
336
337         /// <summary>
338         /// Raises the view above all other views.
339         /// </summary>
340         /// <remarks>
341         /// Sibling order of views within the parent will be updated automatically.
342         /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion.
343         /// </remarks>
344         /// <since_tizen> 3 </since_tizen>
345         public void RaiseToTop()
346         {
347             var parentChildren = GetParent()?.Children;
348
349             if (parentChildren != null)
350             {
351                 parentChildren.Remove(this);
352                 parentChildren.Add(this);
353
354                 LayoutGroup layout = Layout as LayoutGroup;
355                 layout?.ChangeLayoutSiblingOrder(parentChildren.Count - 1);
356
357                 Interop.NDalic.RaiseToTop(SwigCPtr);
358                 if (NDalicPINVOKE.SWIGPendingException.Pending)
359                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360             }
361
362         }
363
364         /// <summary>
365         /// Lowers the view to the bottom of all views.
366         /// </summary>
367         /// <remarks>
368         /// The sibling order of views within the parent will be updated automatically.
369         /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
370         /// </remarks>
371         /// <since_tizen> 3 </since_tizen>
372         public void LowerToBottom()
373         {
374             var parentChildren = GetParent()?.Children;
375
376             if (parentChildren != null)
377             {
378                 parentChildren.Remove(this);
379                 parentChildren.Insert(0, this);
380
381                 LayoutGroup layout = Layout as LayoutGroup;
382                 layout?.ChangeLayoutSiblingOrder(0);
383
384                 Interop.NDalic.LowerToBottom(SwigCPtr);
385                 if (NDalicPINVOKE.SWIGPendingException.Pending)
386                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387             }
388         }
389
390         /// <summary>
391         /// Queries if all resources required by a view are loaded and ready.
392         /// </summary>
393         /// <remarks>Most resources are only loaded when the control is placed on the stage.
394         /// </remarks>
395         /// <since_tizen> 3 </since_tizen>
396         public bool IsResourceReady()
397         {
398             bool ret = Interop.View.IsResourceReady(SwigCPtr);
399             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400             return ret;
401         }
402
403         /// <summary>
404         /// Gets the parent layer of this view.If a view has no parent, this method does not do anything.
405         /// </summary>
406         /// <pre>The view has been initialized. </pre>
407         /// <returns>The parent layer of view </returns>
408         /// <since_tizen> 5 </since_tizen>
409         public Layer GetLayer()
410         {
411             //to fix memory leak issue, match the handle count with native side.
412             IntPtr cPtr = Interop.Actor.GetLayer(SwigCPtr);
413             Layer ret = this.GetInstanceSafely<Layer>(cPtr);
414             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415             return ret;
416         }
417
418         /// <summary>
419         /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing.
420         /// </summary>
421         /// <pre>The (child) view has been initialized. </pre>
422         /// <since_tizen> 4 </since_tizen>
423         public void Unparent()
424         {
425             GetParent()?.Remove(this);
426         }
427
428         /// <summary>
429         /// Search through this view's hierarchy for a view with the given name.
430         /// The view itself is also considered in the search.
431         /// </summary>
432         /// <pre>The view has been initialized.</pre>
433         /// <param name="viewName">The name of the view to find.</param>
434         /// <returns>A handle to the view if found, or an empty handle if not.</returns>
435         /// <since_tizen> 3 </since_tizen>
436         public View FindChildByName(string viewName)
437         {
438             //to fix memory leak issue, match the handle count with native side.
439             IntPtr cPtr = Interop.Actor.FindChildByName(SwigCPtr, viewName);
440             View ret = this.GetInstanceSafely<View>(cPtr);
441             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442             return ret;
443         }
444
445         /// <summary>
446         /// Converts screen coordinates into the view's coordinate system using the default camera.
447         /// </summary>
448         /// <pre>The view has been initialized.</pre>
449         /// <remarks>The view coordinates are relative to the top-left(0.0, 0.0, 0.5).</remarks>
450         /// <param name="localX">On return, the X-coordinate relative to the view.</param>
451         /// <param name="localY">On return, the Y-coordinate relative to the view.</param>
452         /// <param name="screenX">The screen X-coordinate.</param>
453         /// <param name="screenY">The screen Y-coordinate.</param>
454         /// <returns>True if the conversion succeeded.</returns>
455         /// <since_tizen> 3 </since_tizen>
456         public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY)
457         {
458             bool ret = Interop.Actor.ScreenToLocal(SwigCPtr, out localX, out localY, screenX, screenY);
459             if (NDalicPINVOKE.SWIGPendingException.Pending)
460                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461             return ret;
462         }
463
464         /// <summary>
465         /// Sets the relative to parent size factor of the view.<br />
466         /// This factor is only used when ResizePolicy is set to either:
467         /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.<br />
468         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.<br />
469         /// </summary>
470         /// <pre>The view has been initialized.</pre>
471         /// <param name="factor">A Vector3 representing the relative factor to be applied to each axis.</param>
472         /// <since_tizen> 3 </since_tizen>
473         public void SetSizeModeFactor(Vector3 factor)
474         {
475             Interop.Actor.SetSizeModeFactor(SwigCPtr, Vector3.getCPtr(factor));
476             if (NDalicPINVOKE.SWIGPendingException.Pending)
477                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
478         }
479         /// <summary>
480         /// Calculates the height of the view given a width.<br />
481         /// The natural size is used for default calculation.<br />
482         /// Size 0 is treated as aspect ratio 1:1.<br />
483         /// </summary>
484         /// <param name="width">The width to use.</param>
485         /// <returns>The height based on the width.</returns>
486         /// <since_tizen> 3 </since_tizen>
487         public float GetHeightForWidth(float width)
488         {
489             float ret = Interop.Actor.GetHeightForWidth(SwigCPtr, width);
490             if (NDalicPINVOKE.SWIGPendingException.Pending)
491                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492             return ret;
493         }
494
495         /// <summary>
496         /// Calculates the width of the view given a height.<br />
497         /// The natural size is used for default calculation.<br />
498         /// Size 0 is treated as aspect ratio 1:1.<br />
499         /// </summary>
500         /// <param name="height">The height to use.</param>
501         /// <returns>The width based on the height.</returns>
502         /// <since_tizen> 3 </since_tizen>
503         public float GetWidthForHeight(float height)
504         {
505             float ret = Interop.Actor.GetWidthForHeight(SwigCPtr, height);
506             if (NDalicPINVOKE.SWIGPendingException.Pending)
507                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508             return ret;
509         }
510
511         /// <summary>
512         /// Return the amount of size allocated for relayout.
513         /// </summary>
514         /// <param name="dimension">The dimension to retrieve.</param>
515         /// <returns>Return the size.</returns>
516         /// <since_tizen> 3 </since_tizen>
517         public float GetRelayoutSize(DimensionType dimension)
518         {
519             float ret = Interop.Actor.GetRelayoutSize(SwigCPtr, (int)dimension);
520             if (NDalicPINVOKE.SWIGPendingException.Pending)
521                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522             return ret;
523         }
524
525         /// <summary>
526         /// Set the padding for the view.
527         /// </summary>
528         /// <param name="padding">Padding for the view.</param>
529         /// <since_tizen> 3 </since_tizen>
530         // [Obsolete("Deprecated in API9, will be removed in API11. Please use Padding property instead!")]
531         public void SetPadding(PaddingType padding)
532         {
533             Interop.Actor.SetPadding(SwigCPtr, PaddingType.getCPtr(padding));
534             if (NDalicPINVOKE.SWIGPendingException.Pending)
535                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536         }
537
538         /// <summary>
539         /// Return the value of padding for the view.
540         /// </summary>
541         /// <param name="paddingOut">the value of padding for the view</param>
542         /// <since_tizen> 3 </since_tizen>
543         [Obsolete("Deprecated in API9, will be removed in API11. Please use Padding property instead!")]
544         public void GetPadding(PaddingType paddingOut)
545         {
546             Interop.Actor.GetPadding(SwigCPtr, PaddingType.getCPtr(paddingOut));
547             if (NDalicPINVOKE.SWIGPendingException.Pending)
548                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549         }
550
551         /// <since_tizen> 3 </since_tizen>
552         public uint AddRenderer(Renderer renderer)
553         {
554             uint ret = Interop.Actor.AddRenderer(SwigCPtr, Renderer.getCPtr(renderer));
555             if (NDalicPINVOKE.SWIGPendingException.Pending)
556                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557             return ret;
558         }
559
560         /// <since_tizen> 3 </since_tizen>
561         public Renderer GetRendererAt(uint index)
562         {
563             //to fix memory leak issue, match the handle count with native side.
564             IntPtr cPtr = Interop.Actor.GetRendererAt(SwigCPtr, index);
565             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
566             Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
567             if (cPtr != null && ret == null)
568             {
569                 ret = new Renderer(cPtr, false);
570                 if (NDalicPINVOKE.SWIGPendingException.Pending)
571                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572                 return ret;
573             }
574             Interop.BaseHandle.DeleteBaseHandle(CPtr);
575             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
576
577             if (NDalicPINVOKE.SWIGPendingException.Pending)
578                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579             return ret;
580         }
581
582         /// <since_tizen> 3 </since_tizen>
583         public void RemoveRenderer(Renderer renderer)
584         {
585             Interop.Actor.RemoveRenderer(SwigCPtr, Renderer.getCPtr(renderer));
586             if (NDalicPINVOKE.SWIGPendingException.Pending)
587                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
588         }
589
590         /// <since_tizen> 3 </since_tizen>
591         public void RemoveRenderer(uint index)
592         {
593             Interop.Actor.RemoveRenderer(SwigCPtr, index);
594             if (NDalicPINVOKE.SWIGPendingException.Pending)
595                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596         }
597
598         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
599         [EditorBrowsable(EditorBrowsableState.Never)]
600         public void RotateBy(Degree angle, Vector3 axis)
601         {
602             Interop.ActorInternal.RotateByDegree(SwigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
603             if (NDalicPINVOKE.SWIGPendingException.Pending)
604                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605         }
606
607         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
608         [EditorBrowsable(EditorBrowsableState.Never)]
609         public void RotateBy(Radian angle, Vector3 axis)
610         {
611             Interop.ActorInternal.RotateByRadian(SwigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
612             if (NDalicPINVOKE.SWIGPendingException.Pending)
613                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614         }
615
616         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
617         [EditorBrowsable(EditorBrowsableState.Never)]
618         public void RotateBy(Rotation relativeRotation)
619         {
620             Interop.ActorInternal.RotateByQuaternion(SwigCPtr, Rotation.getCPtr(relativeRotation));
621             if (NDalicPINVOKE.SWIGPendingException.Pending)
622                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623         }
624
625         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
626         [EditorBrowsable(EditorBrowsableState.Never)]
627         public void ScaleBy(Vector3 relativeScale)
628         {
629             Interop.ActorInternal.ScaleBy(SwigCPtr, Vector3.getCPtr(relativeScale));
630             if (NDalicPINVOKE.SWIGPendingException.Pending)
631                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632         }
633
634         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
635         [EditorBrowsable(EditorBrowsableState.Never)]
636         public void SetColorMode(ColorMode colorMode)
637         {
638             Interop.ActorInternal.SetColorMode(SwigCPtr, (int)colorMode);
639             if (NDalicPINVOKE.SWIGPendingException.Pending)
640                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641         }
642
643         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
644         [EditorBrowsable(EditorBrowsableState.Never)]
645         public void ObjectDump()
646         {
647             if (0 == Children.Count)
648             {
649                 Type type = this.GetType();
650                 PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
651                 foreach (var property in properties)
652                 {
653                     if (null != property && property.CanRead)
654                     {
655                         Tizen.Log.Fatal("NUI", $"{type.Name} {property.Name} ({property.PropertyType.Name}): {property.GetValueString(this, property.PropertyType)}");
656                     }
657                 }
658                 return;
659             }
660
661             foreach (View view in Children)
662             {
663                 view.ObjectDump();
664             }
665         }
666
667         /// <summary>
668         /// Search through this View's hierarchy for a View with the given unique ID.
669         /// The View itself is also considered in the search.
670         /// </summary>
671         /// <param name="id">The ID of the View to find</param>
672         /// <returns>A View if found or a null if not</returns>
673         [EditorBrowsable(EditorBrowsableState.Never)]
674         [Obsolete("This will be removed at API11! please use FindDescendantByID(uint id) instead!")]
675         public View FindChildByID(uint id)
676         {
677             IntPtr cPtr = Interop.Actor.FindChildById(SwigCPtr, id);
678             View ret = this.GetInstanceSafely<View>(cPtr);
679             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680             return ret;
681         }
682
683         /// <summary>
684         /// Search through this View's hierarchy for a View with the given unique ID.
685         /// </summary>
686         /// <param name="id">The ID of the View to find.</param>
687         /// <returns>A handle to the View if found, or an empty handle if not.</returns>
688         /// <since_tizen> 9 </since_tizen>
689         public View FindDescendantByID(uint id)
690         {
691             return FindChildById(id);
692         }
693
694         /// <summary>
695         /// Raise view above the next sibling view.
696         /// </summary>
697         /// <since_tizen> 9 </since_tizen>
698         public void Raise()
699         {
700             var parentChildren = GetParent()?.Children;
701
702             if (parentChildren != null)
703             {
704                 int currentIndex = parentChildren.IndexOf(this);
705
706                 // If the view is not already the last item in the list.
707                 if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1)
708                 {
709                     View temp = parentChildren[currentIndex + 1];
710                     parentChildren[currentIndex + 1] = this;
711                     parentChildren[currentIndex] = temp;
712
713                     Interop.NDalic.Raise(SwigCPtr);
714                     if (NDalicPINVOKE.SWIGPendingException.Pending)
715                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
716                 }
717             }
718         }
719
720         /// <summary>
721         /// Lower the view below the previous sibling view.
722         /// </summary>
723         /// <since_tizen> 9 </since_tizen>
724         public void Lower()
725         {
726             var parentChildren = GetParent()?.Children;
727
728             if (parentChildren != null)
729             {
730                 int currentIndex = parentChildren.IndexOf(this);
731
732                 // If the view is not already the first item in the list.
733                 if (currentIndex > 0 && currentIndex < parentChildren.Count)
734                 {
735                     View temp = parentChildren[currentIndex - 1];
736                     parentChildren[currentIndex - 1] = this;
737                     parentChildren[currentIndex] = temp;
738
739                     Interop.NDalic.Lower(SwigCPtr);
740                     if (NDalicPINVOKE.SWIGPendingException.Pending)
741                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742                 }
743             }
744         }
745
746         /// <summary>
747         /// Raises the view to above the target view.
748         /// </summary>
749         /// <remarks>The sibling order of views within the parent will be updated automatically.
750         /// Views on the level above the target view will still be shown above this view.
751         /// Once a raise or lower API is used then that view will have an exclusive sibling order independent of insertion.
752         /// </remarks>
753         /// <param name="target">Will be raised above this view.</param>
754         /// <since_tizen> 9 </since_tizen>
755         public void RaiseAbove(View target)
756         {
757             var parentChildren = GetParent()?.Children;
758
759             if (parentChildren != null)
760             {
761                 int currentIndex = parentChildren.IndexOf(this);
762                 int targetIndex = parentChildren.IndexOf(target);
763
764                 if (currentIndex < 0 || targetIndex < 0 ||
765                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
766                 {
767                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
768                     return;
769                 }
770                 // If the currentIndex is less than the target index and the target has the same parent.
771                 if (currentIndex < targetIndex)
772                 {
773                     parentChildren.Remove(this);
774                     parentChildren.Insert(targetIndex, this);
775
776                     Interop.NDalic.RaiseAbove(SwigCPtr, View.getCPtr(target));
777                     if (NDalicPINVOKE.SWIGPendingException.Pending)
778                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779                 }
780             }
781
782         }
783
784         /// <summary>
785         /// Lowers the view to below the target view.
786         /// </summary>
787         /// <remarks>The sibling order of views within the parent will be updated automatically.
788         /// Once a raise or lower API is used then that view will have an exclusive sibling order independent of insertion.
789         /// </remarks>
790         /// <param name="target">Will be lowered below this view.</param>
791         /// <since_tizen> 9 </since_tizen>
792         public void LowerBelow(View target)
793         {
794             var parentChildren = GetParent()?.Children;
795
796             if (parentChildren != null)
797             {
798                 int currentIndex = parentChildren.IndexOf(this);
799                 int targetIndex = parentChildren.IndexOf(target);
800                 if (currentIndex < 0 || targetIndex < 0 ||
801                    currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
802                 {
803                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
804                     return;
805                 }
806
807                 // If the currentIndex is not already the 0th index and the target has the same parent.
808                 if ((currentIndex != 0) && (targetIndex != -1) &&
809                     (currentIndex > targetIndex))
810                 {
811                     parentChildren.Remove(this);
812                     parentChildren.Insert(targetIndex, this);
813
814                     Interop.NDalic.LowerBelow(SwigCPtr, View.getCPtr(target));
815                     if (NDalicPINVOKE.SWIGPendingException.Pending)
816                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
817                 }
818             }
819
820         }
821
822     }
823 }