[NUI] Use 'Container GetParent() for derived class' instead of Parent.
[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                 BindableObject.SetInheritedBindingContext(child, this?.BindingContext);
170             }
171         }
172
173         /// <summary>
174         /// Removes a child view from this View. If the view was not a child of this view, this is a no-op.
175         /// </summary>
176         /// <seealso cref="Container.Remove" />
177         /// <since_tizen> 4 </since_tizen>
178         /// <exception cref="InvalidOperationException">Thrown when deleting a view that is not a child of this view</exception>
179         public override void Remove(View child)
180         {
181             if (child == null || child.GetParent() == null) // Early out if child null.
182                 return;
183
184             if (child.GetParent() != this)
185             {
186                 throw new System.InvalidOperationException("You have deleted a view that is not a child of this view.");
187             }
188
189             bool hasLayout = (layout != null);
190
191             // If View has a layout then do a deferred child removal
192             // Actual child removal is performed by the layouting system so
193             // transitions can be completed.
194             if (hasLayout)
195             {
196                 (layout as LayoutGroup)?.RemoveChildFromLayoutGroup(child);
197             }
198
199             RemoveChild(child);
200         }
201
202         /// <summary>
203         /// Retrieves a child view by index.
204         /// </summary>
205         /// <seealso cref="Container.GetChildAt" />
206         /// <since_tizen> 4 </since_tizen>
207         public override View GetChildAt(uint index)
208         {
209             if (index < Children.Count)
210             {
211                 return Children[Convert.ToInt32(index)];
212             }
213             else
214             {
215                 return null;
216             }
217         }
218
219         /// <summary>
220         /// Retrieves the number of children held by the view.
221         /// </summary>
222         /// <seealso cref="Container.GetChildCount" />
223         /// <since_tizen> 4 </since_tizen>
224         // [Obsolete("Deprecated in API9, will be removed in API11. Please use ChildCount property instead!")]
225         public override uint GetChildCount()
226         {
227             return Convert.ToUInt32(Children.Count);
228         }
229
230         /// <summary>
231         /// Gets the views parent.
232         /// </summary>
233         /// <seealso cref="Container.GetParent()" />
234         /// <since_tizen> 4 </since_tizen>
235         public override Container GetParent()
236         {
237             return this.InternalParent as Container;
238         }
239
240         /// <summary>
241         /// Queries whether the view has a focus.
242         /// </summary>
243         /// <returns>True if this view has a focus.</returns>
244         /// <since_tizen> 3 </since_tizen>
245         public bool HasFocus()
246         {
247             bool ret = false;
248             if (SwigCPtr.Handle != global::System.IntPtr.Zero)
249             {
250                 ret = Interop.View.HasKeyInputFocus(SwigCPtr);
251                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252             }
253             else
254             {
255                 Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed.");
256             }
257             return ret;
258         }
259
260         /// <summary>
261         /// Sets the name of the style to be applied to the view.
262         /// </summary>
263         /// <param name="styleName">A string matching a style described in a stylesheet.</param>
264         /// <since_tizen> 3 </since_tizen>
265         // [Obsolete("Deprecated in API9, will be removed in API11. Please use StyleName property instead!")]
266         public void SetStyleName(string styleName)
267         {
268             Interop.View.SetStyleName(SwigCPtr, styleName);
269             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270         }
271
272         /// <summary>
273         /// Retrieves the name of the style to be applied to the view (if any).
274         /// </summary>
275         /// <returns>A string matching a style, or an empty string.</returns>
276         /// <since_tizen> 3 </since_tizen>
277         // [Obsolete("Deprecated in API9, will be removed in API11. Please use StyleName property instead!")]
278         public string GetStyleName()
279         {
280             string ret = Interop.View.GetStyleName(SwigCPtr);
281             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282             return ret;
283         }
284
285         /// <summary>
286         /// Clears the background.
287         /// </summary>
288         /// <since_tizen> 3 </since_tizen>
289         public void ClearBackground()
290         {
291             Interop.View.ClearBackground(SwigCPtr);
292             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293         }
294
295         /// <summary>
296         /// Shows the view.
297         /// </summary>
298         /// <remarks>
299         /// This is an asynchronous method.
300         /// </remarks>
301         /// <since_tizen> 3 </since_tizen>
302         public void Show()
303         {
304             SetVisible(true);
305         }
306
307         /// <summary>
308         /// Hides the view.
309         /// </summary>
310         /// <remarks>
311         /// This is an asynchronous method.
312         /// If the view is hidden, then the view and its children will not be rendered.
313         /// 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.
314         /// </remarks>
315         /// <since_tizen> 3 </since_tizen>
316         public void Hide()
317         {
318             SetVisible(false);
319         }
320
321         /// <summary>
322         /// Raises the view above all other views.
323         /// </summary>
324         /// <remarks>
325         /// Sibling order of views within the parent will be updated automatically.
326         /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion.
327         /// </remarks>
328         /// <since_tizen> 3 </since_tizen>
329         public void RaiseToTop()
330         {
331             var parentChildren = GetParent()?.Children;
332
333             if (parentChildren != null)
334             {
335                 parentChildren.Remove(this);
336                 parentChildren.Add(this);
337
338                 LayoutGroup layout = Layout as LayoutGroup;
339                 layout?.ChangeLayoutSiblingOrder(parentChildren.Count - 1);
340
341                 Interop.NDalic.RaiseToTop(SwigCPtr);
342                 if (NDalicPINVOKE.SWIGPendingException.Pending)
343                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344             }
345
346         }
347
348         /// <summary>
349         /// Lowers the view to the bottom of all views.
350         /// </summary>
351         /// <remarks>
352         /// The sibling order of views within the parent will be updated automatically.
353         /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
354         /// </remarks>
355         /// <since_tizen> 3 </since_tizen>
356         public void LowerToBottom()
357         {
358             var parentChildren = GetParent()?.Children;
359
360             if (parentChildren != null)
361             {
362                 parentChildren.Remove(this);
363                 parentChildren.Insert(0, this);
364
365                 LayoutGroup layout = Layout as LayoutGroup;
366                 layout?.ChangeLayoutSiblingOrder(0);
367
368                 Interop.NDalic.LowerToBottom(SwigCPtr);
369                 if (NDalicPINVOKE.SWIGPendingException.Pending)
370                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371             }
372         }
373
374         /// <summary>
375         /// Queries if all resources required by a view are loaded and ready.
376         /// </summary>
377         /// <remarks>Most resources are only loaded when the control is placed on the stage.
378         /// </remarks>
379         /// <since_tizen> 3 </since_tizen>
380         public bool IsResourceReady()
381         {
382             bool ret = Interop.View.IsResourceReady(SwigCPtr);
383             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384             return ret;
385         }
386
387         /// <summary>
388         /// Gets the parent layer of this view.If a view has no parent, this method does not do anything.
389         /// </summary>
390         /// <pre>The view has been initialized. </pre>
391         /// <returns>The parent layer of view </returns>
392         /// <since_tizen> 5 </since_tizen>
393         public Layer GetLayer()
394         {
395             //to fix memory leak issue, match the handle count with native side.
396             IntPtr cPtr = Interop.Actor.GetLayer(SwigCPtr);
397             Layer ret = this.GetInstanceSafely<Layer>(cPtr);
398             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399             return ret;
400         }
401
402         /// <summary>
403         /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing.
404         /// </summary>
405         /// <pre>The (child) view has been initialized. </pre>
406         /// <since_tizen> 4 </since_tizen>
407         public void Unparent()
408         {
409             GetParent()?.Remove(this);
410         }
411
412         /// <summary>
413         /// Search through this view's hierarchy for a view with the given name.
414         /// The view itself is also considered in the search.
415         /// </summary>
416         /// <pre>The view has been initialized.</pre>
417         /// <param name="viewName">The name of the view to find.</param>
418         /// <returns>A handle to the view if found, or an empty handle if not.</returns>
419         /// <since_tizen> 3 </since_tizen>
420         public View FindChildByName(string viewName)
421         {
422             //to fix memory leak issue, match the handle count with native side.
423             IntPtr cPtr = Interop.Actor.FindChildByName(SwigCPtr, viewName);
424             View ret = this.GetInstanceSafely<View>(cPtr);
425             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426             return ret;
427         }
428
429         /// <summary>
430         /// Converts screen coordinates into the view's coordinate system using the default camera.
431         /// </summary>
432         /// <pre>The view has been initialized.</pre>
433         /// <remarks>The view coordinates are relative to the top-left(0.0, 0.0, 0.5).</remarks>
434         /// <param name="localX">On return, the X-coordinate relative to the view.</param>
435         /// <param name="localY">On return, the Y-coordinate relative to the view.</param>
436         /// <param name="screenX">The screen X-coordinate.</param>
437         /// <param name="screenY">The screen Y-coordinate.</param>
438         /// <returns>True if the conversion succeeded.</returns>
439         /// <since_tizen> 3 </since_tizen>
440         public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY)
441         {
442             bool ret = Interop.Actor.ScreenToLocal(SwigCPtr, out localX, out localY, screenX, screenY);
443             if (NDalicPINVOKE.SWIGPendingException.Pending)
444                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445             return ret;
446         }
447
448         /// <summary>
449         /// Sets the relative to parent size factor of the view.<br />
450         /// This factor is only used when ResizePolicy is set to either:
451         /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.<br />
452         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.<br />
453         /// </summary>
454         /// <pre>The view has been initialized.</pre>
455         /// <param name="factor">A Vector3 representing the relative factor to be applied to each axis.</param>
456         /// <since_tizen> 3 </since_tizen>
457         public void SetSizeModeFactor(Vector3 factor)
458         {
459             Interop.Actor.SetSizeModeFactor(SwigCPtr, Vector3.getCPtr(factor));
460             if (NDalicPINVOKE.SWIGPendingException.Pending)
461                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462         }
463         /// <summary>
464         /// Calculates the height of the view given a width.<br />
465         /// The natural size is used for default calculation.<br />
466         /// Size 0 is treated as aspect ratio 1:1.<br />
467         /// </summary>
468         /// <param name="width">The width to use.</param>
469         /// <returns>The height based on the width.</returns>
470         /// <since_tizen> 3 </since_tizen>
471         // [Obsolete("Deprecated in API9, will be removed in API11. Please use HeightForWidth property instead!")]
472         public float GetHeightForWidth(float width)
473         {
474             float ret = Interop.Actor.GetHeightForWidth(SwigCPtr, width);
475             if (NDalicPINVOKE.SWIGPendingException.Pending)
476                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
477             return ret;
478         }
479
480         /// <summary>
481         /// Calculates the width of the view given a height.<br />
482         /// The natural size is used for default calculation.<br />
483         /// Size 0 is treated as aspect ratio 1:1.<br />
484         /// </summary>
485         /// <param name="height">The height to use.</param>
486         /// <returns>The width based on the height.</returns>
487         /// <since_tizen> 3 </since_tizen>
488         // [Obsolete("Deprecated in API9, will be removed in API11. Please use WidthForHeight property instead!")]
489         public float GetWidthForHeight(float height)
490         {
491             float ret = Interop.Actor.GetWidthForHeight(SwigCPtr, height);
492             if (NDalicPINVOKE.SWIGPendingException.Pending)
493                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494             return ret;
495         }
496
497         /// <summary>
498         /// Return the amount of size allocated for relayout.
499         /// </summary>
500         /// <param name="dimension">The dimension to retrieve.</param>
501         /// <returns>Return the size.</returns>
502         /// <since_tizen> 3 </since_tizen>
503         public float GetRelayoutSize(DimensionType dimension)
504         {
505             float ret = Interop.Actor.GetRelayoutSize(SwigCPtr, (int)dimension);
506             if (NDalicPINVOKE.SWIGPendingException.Pending)
507                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508             return ret;
509         }
510
511         /// <summary>
512         /// Set the padding for the view.
513         /// </summary>
514         /// <param name="padding">Padding for the view.</param>
515         /// <since_tizen> 3 </since_tizen>
516         // [Obsolete("Deprecated in API9, will be removed in API11. Please use Padding property instead!")]
517         public void SetPadding(PaddingType padding)
518         {
519             Interop.Actor.SetPadding(SwigCPtr, PaddingType.getCPtr(padding));
520             if (NDalicPINVOKE.SWIGPendingException.Pending)
521                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522         }
523
524         /// <summary>
525         /// Return the value of padding for the view.
526         /// </summary>
527         /// <param name="paddingOut">the value of padding for the view</param>
528         /// <since_tizen> 3 </since_tizen>
529         // [Obsolete("Deprecated in API9, will be removed in API11. Please use Padding property instead!")]
530         public void GetPadding(PaddingType paddingOut)
531         {
532             Interop.Actor.GetPadding(SwigCPtr, PaddingType.getCPtr(paddingOut));
533             if (NDalicPINVOKE.SWIGPendingException.Pending)
534                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535         }
536
537         /// <since_tizen> 3 </since_tizen>
538         public uint AddRenderer(Renderer renderer)
539         {
540             uint ret = Interop.Actor.AddRenderer(SwigCPtr, Renderer.getCPtr(renderer));
541             if (NDalicPINVOKE.SWIGPendingException.Pending)
542                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543             return ret;
544         }
545
546         /// <since_tizen> 3 </since_tizen>
547         public Renderer GetRendererAt(uint index)
548         {
549             //to fix memory leak issue, match the handle count with native side.
550             IntPtr cPtr = Interop.Actor.GetRendererAt(SwigCPtr, index);
551             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
552             Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
553             if (cPtr != null && ret == null)
554             {
555                 ret = new Renderer(cPtr, false);
556                 if (NDalicPINVOKE.SWIGPendingException.Pending)
557                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
558                 return ret;
559             }
560             Interop.BaseHandle.DeleteBaseHandle(CPtr);
561             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
562
563             if (NDalicPINVOKE.SWIGPendingException.Pending)
564                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
565             return ret;
566         }
567
568         /// <since_tizen> 3 </since_tizen>
569         public void RemoveRenderer(Renderer renderer)
570         {
571             Interop.Actor.RemoveRenderer(SwigCPtr, Renderer.getCPtr(renderer));
572             if (NDalicPINVOKE.SWIGPendingException.Pending)
573                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574         }
575
576         /// <since_tizen> 3 </since_tizen>
577         public void RemoveRenderer(uint index)
578         {
579             Interop.Actor.RemoveRenderer(SwigCPtr, index);
580             if (NDalicPINVOKE.SWIGPendingException.Pending)
581                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582         }
583
584         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
585         [EditorBrowsable(EditorBrowsableState.Never)]
586         public void RotateBy(Degree angle, Vector3 axis)
587         {
588             Interop.ActorInternal.RotateByDegree(SwigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
589             if (NDalicPINVOKE.SWIGPendingException.Pending)
590                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
591         }
592
593         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
594         [EditorBrowsable(EditorBrowsableState.Never)]
595         public void RotateBy(Radian angle, Vector3 axis)
596         {
597             Interop.ActorInternal.RotateByRadian(SwigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
598             if (NDalicPINVOKE.SWIGPendingException.Pending)
599                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600         }
601
602         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
603         [EditorBrowsable(EditorBrowsableState.Never)]
604         public void RotateBy(Rotation relativeRotation)
605         {
606             Interop.ActorInternal.RotateByQuaternion(SwigCPtr, Rotation.getCPtr(relativeRotation));
607             if (NDalicPINVOKE.SWIGPendingException.Pending)
608                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609         }
610
611         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
612         [EditorBrowsable(EditorBrowsableState.Never)]
613         public void ScaleBy(Vector3 relativeScale)
614         {
615             Interop.ActorInternal.ScaleBy(SwigCPtr, Vector3.getCPtr(relativeScale));
616             if (NDalicPINVOKE.SWIGPendingException.Pending)
617                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
618         }
619
620         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
621         [EditorBrowsable(EditorBrowsableState.Never)]
622         public void SetColorMode(ColorMode colorMode)
623         {
624             Interop.ActorInternal.SetColorMode(SwigCPtr, (int)colorMode);
625             if (NDalicPINVOKE.SWIGPendingException.Pending)
626                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627         }
628
629
630
631         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
632         [EditorBrowsable(EditorBrowsableState.Never)]
633         public Transition GetTransition(string transitionName)
634         {
635             Transition trans = null;
636             transDictionary.TryGetValue(transitionName, out trans);
637             return trans;
638         }
639
640         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
641         [EditorBrowsable(EditorBrowsableState.Never)]
642         public void ObjectDump()
643         {
644             if (0 == Children.Count)
645             {
646                 Type type = this.GetType();
647                 PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
648                 foreach (var property in properties)
649                 {
650                     if (null != property && property.CanRead)
651                     {
652                         Tizen.Log.Fatal("NUI", $"{type.Name} {property.Name} ({property.PropertyType.Name}): {property.GetValueString(this, property.PropertyType)}");
653                     }
654                 }
655                 return;
656             }
657
658             foreach (View view in Children)
659             {
660                 view.ObjectDump();
661             }
662         }
663
664         /// <summary>
665         /// Search through this View's hierarchy for a View with the given unique ID.
666         /// The View itself is also considered in the search.
667         /// </summary>
668         /// <param name="id">The ID of the View to find</param>
669         /// <returns>A View if found or a null if not</returns>
670         [EditorBrowsable(EditorBrowsableState.Never)]
671         public View FindChildByID(uint id)
672         {
673             IntPtr cPtr = Interop.Actor.FindChildById(SwigCPtr, id);
674             View ret = this.GetInstanceSafely<View>(cPtr);
675             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
676             return ret;
677         }
678
679     }
680 }