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