Revert "[NUI] Fix RaiseToTop error (#413)" (#419)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Layer.cs
1 /*
2  * Copyright(c) 2018 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 using System;
18 using Tizen.NUI.BaseComponents;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21
22 namespace Tizen.NUI
23 {
24
25     /// <summary>
26     /// Layers provide a mechanism for overlaying groups of actors on top of each other.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public class Layer : Container
30     {
31         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32         private global::System.IntPtr rootLayoutIntPtr;
33         private global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr;
34
35         internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Layer_SWIGUpcast(cPtr), cMemoryOwn)
36         {
37             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38             // Create a root layout (AbsoluteLayout) that is invisible to the user but enables layouts added to this Layer.
39             // Enables layouts added to the Layer to have a parent layout.  As parent layout is needed to store measure spec properties.
40             rootLayoutIntPtr = NDalicManualPINVOKE.Window_NewRootLayout();
41             // Store HandleRef used by Add()
42             rootLayoutCPtr = new global::System.Runtime.InteropServices.HandleRef(this, rootLayoutIntPtr);
43             // Add the root layout created above to this layer.
44             NDalicPINVOKE.Actor_Add( swigCPtr, rootLayoutCPtr );
45         }
46
47         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
48         {
49             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50         }
51
52         /// From the Container base class.
53
54         /// <summary>
55         /// Adds a child view to this layer.
56         /// </summary>
57         /// <seealso cref="Container.Add">
58         /// </seealso>
59         /// <since_tizen> 4 </since_tizen>
60         public override void Add(View child)
61         {
62             Container oldParent = child.Parent;
63             if (oldParent != this)
64             {
65                 if (oldParent != null)
66                 {
67                     oldParent.Remove(child);
68                 }
69                 NDalicPINVOKE.Actor_Add( rootLayoutCPtr , View.getCPtr(child));
70                 if (NDalicPINVOKE.SWIGPendingException.Pending)
71                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72                 Children.Add(child);
73             }
74         }
75
76         /// <summary>
77         /// Removes a child view from this layer. If the view was not a child of this layer, this is a no-op.
78         /// </summary>
79         /// <seealso cref="Container.Remove">
80         /// </seealso>
81         /// <since_tizen> 4 </since_tizen>
82         public override void Remove(View child)
83         {
84             NDalicPINVOKE.Actor_Remove( rootLayoutCPtr, View.getCPtr(child));
85             if (NDalicPINVOKE.SWIGPendingException.Pending)
86                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87
88             Children.Remove(child);
89         }
90
91         /// <summary>
92         /// Retrieves a child view by the index.
93         /// </summary>
94         /// <pre>The view has been initialized.</pre>
95         /// <param name="index">The index of the child to retrieve.</param>
96         /// <returns>The view for the given index or empty handle if children not initialized.</returns>
97         /// <since_tizen> 4 </since_tizen>
98         public override View GetChildAt(uint index)
99         {
100             if (index < Children.Count)
101             {
102                 return Children[Convert.ToInt32(index)];
103             }
104             else
105             {
106                 return null;
107             }
108         }
109
110         /// <summary>
111         /// Get parent of the layer.
112         /// </summary>
113         /// <returns>The view's container</returns>
114         /// <since_tizen> 4 </since_tizen>
115         public override Container GetParent()
116         {
117             return null;
118         }
119
120         /// <summary>
121         /// Get the child count of the layer.
122         /// </summary>
123         /// <returns>The child count of the layer.</returns>
124         /// <since_tizen> 4 </since_tizen>
125         public override uint GetChildCount()
126         {
127             return Convert.ToUInt32(Children.Count);
128         }
129
130         /// <summary>
131         /// Dispose.
132         /// </summary>
133         /// <since_tizen> 3 </since_tizen>
134         protected override void Dispose(DisposeTypes type)
135         {
136             if(disposed)
137             {
138                 return;
139             }
140
141             if(type == DisposeTypes.Explicit)
142             {
143                 //Called by User
144                 //Release your own managed resources here.
145                 //You should release all of your own disposable objects here.
146             }
147
148             //Release your own unmanaged resources here.
149             //You should not access any managed member here except static instance.
150             //because the execution order of Finalizes is non-deterministic.
151
152             if (swigCPtr.Handle != global::System.IntPtr.Zero)
153             {
154                 if (swigCMemOwn)
155                 {
156                     swigCMemOwn = false;
157                     NDalicPINVOKE.delete_Layer(swigCPtr);
158                 }
159                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
160             }
161
162             base.Dispose(type);
163
164         }
165
166
167         internal class Property
168         {
169             internal static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get();
170         }
171
172         /// <summary>
173         /// Creates a Layer object.
174         /// </summary>
175         /// <since_tizen> 3 </since_tizen>
176         public Layer() : this(NDalicPINVOKE.Layer_New(), true)
177         {
178             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179             if(Window.Instance != null)
180             {
181                 this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft);
182                 this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions);
183             }
184         }
185         internal void SetAnchorPoint(Vector3 anchorPoint)
186         {
187             NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
188             if (NDalicPINVOKE.SWIGPendingException.Pending)
189                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190         }
191         internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
192         {
193             NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension);
194             if (NDalicPINVOKE.SWIGPendingException.Pending)
195                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196         }
197
198         /// <summary>
199         /// Downcasts a handle to layer handle.
200         /// </summary>
201         /// <since_tizen> 3 </since_tizen>
202         /// Please do not use! this will be deprecated!
203         /// Instead please use as keyword.
204         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")]
205         [EditorBrowsable(EditorBrowsableState.Never)]
206         public static Layer DownCast(BaseHandle handle)
207         {
208             Layer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer;
209             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210             return ret;
211         }
212
213         /// <summary>
214         /// Search through this layer's hierarchy for a view with the given unique ID.
215         /// </summary>
216         /// <pre>This layer (the parent) has been initialized.</pre>
217         /// <remarks>The actor itself is also considered in the search.</remarks>
218         /// <param name="id">The id of the child to find</param>
219         /// <returns> A handle to the view if found, or an empty handle if not. </returns>
220         /// <since_tizen> 3 </since_tizen>
221         public View FindChildById(uint id)
222         {
223             //to fix memory leak issue, match the handle count with native side.
224             IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
225             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
226             View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
227             NDalicPINVOKE.delete_BaseHandle(CPtr);
228             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
229
230             if (NDalicPINVOKE.SWIGPendingException.Pending)
231                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232             return ret;
233         }
234
235         /// <summary>
236         /// Queries the depth of the layer.<br />
237         /// 0 is the bottommost layer, higher number is on the top.<br />
238         /// </summary>
239         /// <since_tizen> 3 </since_tizen>
240         public uint Depth
241         {
242             get
243             {
244                 return GetDepth();
245             }
246         }
247
248         internal uint GetDepth()
249         {
250             var parentChildren = Window.Instance.LayersChildren;
251             if(parentChildren != null)
252             {
253                 int idx = parentChildren.IndexOf(this);
254                 if (idx >= 0)
255                 {
256                     return Convert.ToUInt32(idx); ;
257                 }
258             }
259             return 0u;
260         }
261
262         /// <summary>
263         /// Increments the depth of the layer.
264         /// </summary>
265         /// <since_tizen> 3 </since_tizen>
266         public void Raise()
267         {
268             var parentChildren = Window.Instance.LayersChildren;
269             if (parentChildren != null)
270             {
271                 int currentIdx = parentChildren.IndexOf(this);
272
273                 if (currentIdx >= 0 && currentIdx < parentChildren.Count - 1)
274                 {
275                     RaiseAbove(parentChildren[currentIdx + 1]);
276
277                     Layer temp = parentChildren[currentIdx + 1];
278                     parentChildren[currentIdx + 1] = this;
279                     parentChildren[currentIdx] = temp;
280
281                     NDalicPINVOKE.Layer_Raise(swigCPtr);
282                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283                 }
284             }
285         }
286
287         /// <summary>
288         /// Decrements the depth of the layer.
289         /// </summary>
290         /// <since_tizen> 3 </since_tizen>
291         public void Lower()
292         {
293             var parentChildren = Window.Instance.LayersChildren;
294             if (parentChildren != null)
295             {
296                 int currentIdx = parentChildren.IndexOf(this);
297
298                 if (currentIdx > 0 && currentIdx < parentChildren.Count)
299                 {
300                     LowerBelow(parentChildren[currentIdx - 1]);
301
302                     Layer temp = parentChildren[currentIdx - 1];
303                     parentChildren[currentIdx - 1] = this;
304                     parentChildren[currentIdx] = temp;
305
306                     NDalicPINVOKE.Layer_Lower(swigCPtr);
307                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308                 }
309             }
310         }
311
312         internal void RaiseAbove(Layer target)
313         {
314             var parentChildren = Window.Instance.LayersChildren;
315             if (parentChildren != null)
316             {
317                 int currentIndex = parentChildren.IndexOf(this);
318                 int targetIndex = parentChildren.IndexOf(target);
319
320                 if(currentIndex < 0 || targetIndex < 0 ||
321                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
322                 {
323                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
324                     return;
325                 }
326
327                 // If the currentIndex is less than the target index and the target has the same parent.
328                 if (currentIndex < targetIndex)
329                 {
330                     parentChildren.Remove(this);
331                     parentChildren.Insert(targetIndex, this);
332
333                     NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target));
334                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335                 }
336             }
337         }
338
339         internal void LowerBelow(Layer target)
340         {
341             var parentChildren = Window.Instance.LayersChildren;
342
343             if (parentChildren != null)
344             {
345                 int currentIndex = parentChildren.IndexOf(this);
346                 int targetIndex = parentChildren.IndexOf(target);
347
348                 if(currentIndex < 0 || targetIndex < 0 ||
349                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
350                 {
351                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
352                     return;
353                 }
354
355                 // If the currentIndex is not already the 0th index and the target has the same parent.
356                 if ((currentIndex != 0) && (targetIndex != -1) &&
357                     (currentIndex > targetIndex))
358                 {
359                     parentChildren.Remove(this);
360                     parentChildren.Insert(targetIndex, this);
361
362                     NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target));
363                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364                 }
365             }
366         }
367
368         /// <summary>
369         /// Raises the layer to the top.
370         /// </summary>
371         /// <since_tizen> 3 </since_tizen>
372         public void RaiseToTop()
373         {
374             var parentChildren = Window.Instance.LayersChildren;
375
376             if (parentChildren != null)
377             {
378                 parentChildren.Remove(this);
379                 parentChildren.Add(this);
380
381                 NDalicPINVOKE.Layer_RaiseToTop(swigCPtr);
382                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
383             }
384         }
385
386         /// <summary>
387         /// Lowers the layer to the bottom.
388         /// </summary>
389         /// <since_tizen> 3 </since_tizen>
390         public void LowerToBottom()
391         {
392             var parentChildren = Window.Instance.LayersChildren;
393
394             if (parentChildren != null)
395             {
396                 parentChildren.Remove(this);
397                 parentChildren.Insert(0, this);
398
399                 NDalicPINVOKE.Layer_LowerToBottom(swigCPtr);
400                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401             }
402
403         }
404
405         /// <summary>
406         /// Moves the layer directly above the given layer.<br />
407         /// After the call, this layer's depth will be immediately above target.<br />
408         /// </summary>
409         /// <param name="target">The layer to get on top of.</param>
410         /// <since_tizen> 3 </since_tizen>
411         public void MoveAbove(Layer target)
412         {
413             NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
414             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415         }
416
417         /// <summary>
418         /// Moves the layer directly below the given layer.<br />
419         /// After the call, this layer's depth will be immediately below target.<br />
420         /// </summary>
421         /// <param name="target">The layer to get below of.</param>
422         /// <since_tizen> 3 </since_tizen>
423         public void MoveBelow(Layer target)
424         {
425             NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
426             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427         }
428
429         private void SetBehavior(LayerBehavior behavior)
430         {
431             NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior);
432             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433         }
434
435         private LayerBehavior GetBehavior()
436         {
437             Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr);
438             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439             return ret;
440         }
441
442         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
443         {
444             NDalicPINVOKE.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
445             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446         }
447
448         internal void SetTouchConsumed(bool consume)
449         {
450             NDalicPINVOKE.Layer_SetTouchConsumed(swigCPtr, consume);
451             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452         }
453
454         internal bool IsTouchConsumed()
455         {
456             bool ret = NDalicPINVOKE.Layer_IsTouchConsumed(swigCPtr);
457             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
458             return ret;
459         }
460
461         internal void SetHoverConsumed(bool consume)
462         {
463             NDalicPINVOKE.Layer_SetHoverConsumed(swigCPtr, consume);
464             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465         }
466
467         internal bool IsHoverConsumed()
468         {
469             bool ret = NDalicPINVOKE.Layer_IsHoverConsumed(swigCPtr);
470             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471             return ret;
472         }
473
474         internal void AddViewToLayerList( View view )
475         {
476             Children.Add(view);
477         }
478
479         internal void RemoveViewFromLayerList( View view )
480         {
481             Children.Remove(view);
482         }
483
484         /// <summary>
485         /// Enumeration for the behavior of the layer.
486         /// </summary>
487         /// <since_tizen> 3 </since_tizen>
488         public enum LayerBehavior
489         {
490             /// <summary>
491             /// UI control rendering mode.
492             /// </summary>
493             /// <since_tizen> 3 </since_tizen>
494             Layer2D,
495             /// <summary>
496             /// UI control rendering mode (default mode).
497             /// This mode is designed for UI controls that can overlap. In this
498             /// mode renderer order will be respective to the tree hierarchy of
499             /// Actors.<br />
500             /// The rendering order is depth first, so for the following actor tree,
501             /// A will be drawn first, then B, D, E, then C, F.  This ensures that
502             /// overlapping actors are drawn as expected (whereas, with breadth first
503             /// traversal, the actors would interleave).<br />
504             /// </summary>
505             /// <since_tizen> 3 </since_tizen>
506             LayerUI = Layer2D,
507             /// <summary>
508             /// Layer will use depth test.
509             /// This mode is designed for a 3 dimensional scene where actors in front
510             /// of other actors will obscure them, i.e. the actors are sorted by the
511             /// distance from the camera.<br />
512             /// When using this mode, a depth test will be used. A depth clear will
513             /// happen for each layer, which means actors in a layer "above" other
514             /// layers will be rendered in front of actors in those layers regardless
515             /// of their Z positions (see Layer::Raise() and Layer::Lower()).<br />
516             /// Opaque renderers are drawn first and write to the depth buffer.  Then
517             /// transparent renderers are drawn with depth test enabled but depth
518             /// write switched off.  Transparent renderers are drawn based on their
519             /// distance from the camera.  A renderer's DEPTH_INDEX property is used to
520             /// offset the distance to the camera when ordering transparent renderers.
521             /// This is useful if you want to define the draw order of two or more
522             /// transparent renderers that are equal distance from the camera.  Unlike
523             /// LAYER_UI, parent-child relationship does not affect rendering order at
524             /// all.
525             /// </summary>
526             /// <since_tizen> 3 </since_tizen>
527             Layer3D
528         }
529
530         internal enum TreeDepthMultiplier
531         {
532             TREE_DEPTH_MULTIPLIER = 10000
533         }
534
535         /// <summary>
536         /// Layer behavior, type String (Layer.LayerBehavior).
537         /// </summary>
538         /// <since_tizen> 3 </since_tizen>
539         public Layer.LayerBehavior Behavior
540         {
541             get
542             {
543                 return GetBehavior();
544             }
545             set
546             {
547                 SetBehavior(value);
548             }
549         }
550
551         /// <summary>
552         /// Internal only property to enable or disable clipping, type boolean.
553         /// By default, this is false, i.e., the viewport of the layer is the entire window.
554         /// </summary>
555         internal bool ClippingEnabled
556         {
557             get
558             {
559                 bool ret = NDalicPINVOKE.Layer_IsClipping(swigCPtr);
560                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561                 return ret;
562             }
563             set
564             {
565                 NDalicPINVOKE.Layer_SetClipping(swigCPtr, value);
566                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567             }
568         }
569
570         /// <summary>
571         /// Sets the viewport (in window coordinates), type rectangle.
572         /// The contents of the layer will not be visible outside this box, when ViewportEnabled is true.
573         /// </summary>
574         /// <since_tizen> 4 </since_tizen>
575         public Rectangle Viewport
576         {
577             get
578             {
579                 if( ClippingEnabled )
580                 {
581                   Rectangle ret = new Rectangle(NDalicPINVOKE.Layer_GetClippingBox(swigCPtr), true);
582                   if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583                   return ret;
584                 }
585                 else
586                 {
587                   // Clipping not enabled so return the window size
588                   Size2D windowSize = Window.Instance.Size;
589                   Rectangle ret = new Rectangle(0, 0, windowSize.Width, windowSize.Height);
590                   return ret;
591                 }
592             }
593             set
594             {
595                 NDalicPINVOKE.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(value));
596                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597                 ClippingEnabled = true;
598             }
599         }
600
601         /// <summary>
602         /// Retrieves and sets the layer's opacity.<br />
603         /// </summary>
604         /// <since_tizen> 3 </since_tizen>
605         public float Opacity
606         {
607             get
608             {
609                 float temp = 0.0f;
610                 GetProperty(View.Property.OPACITY).Get(out temp);
611                 return temp;
612             }
613             set
614             {
615                 SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value));
616             }
617         }
618
619         /// <summary>
620         /// Retrieves and sets the layer's visibility.
621         /// </summary>
622         /// <since_tizen> 3 </since_tizen>
623         public bool Visibility
624         {
625             get
626             {
627                 bool temp = false;
628                 GetProperty(View.Property.VISIBLE).Get(out temp);
629                 return temp;
630             }
631             set
632             {
633                 SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value));
634             }
635         }
636
637         /// <summary>
638         /// Get the number of children held by the layer.
639         /// </summary>
640         /// <since_tizen> 3 </since_tizen>
641         public new uint ChildCount
642         {
643             get
644             {
645                 return Convert.ToUInt32(Children.Count);
646             }
647         }
648
649         /// <summary>
650         /// Gets or sets the layer's name.
651         /// </summary>
652         /// <since_tizen> 3 </since_tizen>
653         public string Name
654         {
655             get
656             {
657                 return GetName();
658             }
659             set
660             {
661                 SetName(value);
662             }
663         }
664
665         internal string GetName()
666         {
667             string ret = NDalicPINVOKE.Actor_GetName(swigCPtr);
668             if (NDalicPINVOKE.SWIGPendingException.Pending)
669                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
670             return ret;
671         }
672
673         internal void SetName(string name)
674         {
675             NDalicPINVOKE.Actor_SetName(swigCPtr, name);
676             if (NDalicPINVOKE.SWIGPendingException.Pending)
677                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678         }
679
680     }
681 }