d83222af2d660f85aa8e027c99946d7c0e86e48e
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / 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.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(Interop.Layer.Layer_SWIGUpcast(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.Layer_GetClippingBox(swigCPtr), true);
130                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw 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.Layer_SetClippingBox__SWIG_1(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                 GetProperty(View.Property.OPACITY).Get(out temp);
159                 return temp;
160             }
161             set
162             {
163                 SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value));
164             }
165         }
166
167         /// <summary>
168         /// Retrieves and sets the layer's visibility.
169         /// </summary>
170         /// <since_tizen> 3 </since_tizen>
171         public bool Visibility
172         {
173             get
174             {
175                 bool temp = false;
176                 GetProperty(View.Property.VISIBLE).Get(out temp);
177                 return temp;
178             }
179             set
180             {
181                 SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value));
182             }
183         }
184
185         /// <summary>
186         /// Get the number of children held by the layer.
187         /// </summary>
188         /// <since_tizen> 3 </since_tizen>
189         public new uint ChildCount
190         {
191             get
192             {
193                 return Convert.ToUInt32(Children.Count);
194             }
195         }
196
197         /// <summary>
198         /// Gets or sets the layer's name.
199         /// </summary>
200         /// <since_tizen> 3 </since_tizen>
201         public string Name
202         {
203             get
204             {
205                 return GetName();
206             }
207             set
208             {
209                 SetName(value);
210             }
211         }
212
213         /// <summary>
214         /// Queries the depth of the layer.<br />
215         /// 0 is the bottommost layer, higher number is on the top.<br />
216         /// </summary>
217         /// <since_tizen> 3 </since_tizen>
218         public uint Depth
219         {
220             get
221             {
222                 return GetDepth();
223             }
224         }
225
226         /// <summary>
227         /// Internal only property to enable or disable clipping, type boolean.
228         /// By default, this is false, i.e., the viewport of the layer is the entire window.
229         /// </summary>
230         internal bool ClippingEnabled
231         {
232             get
233             {
234                 bool ret = Interop.Layer.Layer_IsClipping(swigCPtr);
235                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236                 return ret;
237             }
238             set
239             {
240                 Interop.Layer.Layer_SetClipping(swigCPtr, value);
241                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242             }
243         }
244
245         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
246         [EditorBrowsable(EditorBrowsableState.Never)]
247         public ResourceDictionary XamlResources
248         {
249             get
250             {
251                 return Application.Current.XamlResources;
252             }
253             set
254             {
255                 Application.Current.XamlResources = value;
256             }
257         }
258
259         /// From the Container base class.
260
261         /// <summary>
262         /// Adds a child view to this layer.
263         /// </summary>
264         /// <seealso cref="Container.Add">
265         /// </seealso>
266         /// <exception cref="ArgumentNullException"> Thrown when child is null. </exception>
267         /// <since_tizen> 4 </since_tizen>
268         public override void Add(View child)
269         {
270             if (null == child)
271             {
272                 throw new ArgumentNullException(nameof(child));
273             }
274
275             Container oldParent = child.GetParent();
276
277             if (oldParent != this)
278             {
279                 if (oldParent != null)
280                 {
281                     oldParent.Remove(child);
282                 }
283                 else
284                 {
285                     child.InternalParent = this;
286                 }
287                 Interop.Actor.ActorAdd(swigCPtr, View.getCPtr(child));
288                 if (NDalicPINVOKE.SWIGPendingException.Pending)
289                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290                 Children.Add(child);
291                 BindableObject.SetInheritedBindingContext(child, this?.BindingContext);
292             }
293         }
294
295         /// <summary>
296         /// Removes a child view from this layer. If the view was not a child of this layer, this is a no-op.
297         /// </summary>
298         /// <seealso cref="Container.Remove">
299         /// </seealso>
300         /// <exception cref="ArgumentNullException"> Thrown when child is null. </exception>
301         /// <since_tizen> 4 </since_tizen>
302         public override void Remove(View child)
303         {
304             if (null == child)
305             {
306                 throw new ArgumentNullException(nameof(child));
307             }
308
309             Interop.Actor.ActorRemove(swigCPtr, View.getCPtr(child));
310             if (NDalicPINVOKE.SWIGPendingException.Pending)
311                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312
313             Children.Remove(child);
314             child.InternalParent = null;
315         }
316
317         /// <summary>
318         /// Retrieves a child view by the index.
319         /// </summary>
320         /// <pre>The view has been initialized.</pre>
321         /// <param name="index">The index of the child to retrieve.</param>
322         /// <returns>The view for the given index or empty handle if children not initialized.</returns>
323         /// <since_tizen> 4 </since_tizen>
324         public override View GetChildAt(uint index)
325         {
326             if (index < Children.Count)
327             {
328                 return Children[Convert.ToInt32(index)];
329             }
330             else
331             {
332                 return null;
333             }
334         }
335
336         /// <summary>
337         /// Get parent of the layer.
338         /// </summary>
339         /// <returns>The view's container</returns>
340         /// <since_tizen> 4 </since_tizen>
341         public override Container GetParent()
342         {
343             return null;
344         }
345
346         /// <summary>
347         /// Get the child count of the layer.
348         /// </summary>
349         /// <returns>The child count of the layer.</returns>
350         /// <since_tizen> 4 </since_tizen>
351         public override uint GetChildCount()
352         {
353             return Convert.ToUInt32(Children.Count);
354         }
355
356         /// <summary>
357         /// Downcasts a handle to layer handle.
358         /// </summary>
359         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
360         /// <since_tizen> 3 </since_tizen>
361         /// Please do not use! this will be deprecated!
362         /// Instead please use as keyword.
363         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")]
364         [EditorBrowsable(EditorBrowsableState.Never)]
365         public static Layer DownCast(BaseHandle handle)
366         {
367             if (null == handle)
368             {
369                 throw new ArgumentNullException(nameof(handle));
370             }
371             Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer;
372             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373             return ret;
374         }
375
376         /// <summary>
377         /// Search through this layer's hierarchy for a view with the given unique ID.
378         /// </summary>
379         /// <pre>This layer (the parent) has been initialized.</pre>
380         /// <remarks>The actor itself is also considered in the search.</remarks>
381         /// <param name="id">The id of the child to find</param>
382         /// <returns> A handle to the view if found, or an empty handle if not. </returns>
383         /// <since_tizen> 3 </since_tizen>
384         public View FindChildById(uint id)
385         {
386             //to fix memory leak issue, match the handle count with native side.
387             IntPtr cPtr = Interop.Actor.ActorFindChildById(swigCPtr, id);
388             View ret = this.GetInstanceSafely<View>(cPtr);
389             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390             return ret;
391         }
392
393         internal override View FindCurrentChildById(uint id)
394         {
395             return FindChildById(id);
396         }
397
398         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
399         [EditorBrowsable(EditorBrowsableState.Never)]
400         public View FindChildByName(string viewName)
401         {
402             //to fix memory leak issue, match the handle count with native side.
403             IntPtr cPtr = Interop.Actor.ActorFindChildByName(swigCPtr, viewName);
404             View ret = this.GetInstanceSafely<View>(cPtr);
405             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406             return ret;
407         }
408
409         /// <summary>
410         /// Increments the depth of the layer.
411         /// </summary>
412         /// <since_tizen> 3 </since_tizen>
413         public void Raise()
414         {
415             var parentChildren = window?.LayersChildren;
416             if (parentChildren != null)
417             {
418                 int currentIdx = parentChildren.IndexOf(this);
419
420                 if (currentIdx >= 0 && currentIdx < parentChildren.Count - 1)
421                 {
422                     var upper = parentChildren[currentIdx + 1];
423                     RaiseAbove(upper);
424                 }
425             }
426         }
427
428         /// <summary>
429         /// Decrements the depth of the layer.
430         /// </summary>
431         /// <since_tizen> 3 </since_tizen>
432         public void Lower()
433         {
434             var parentChildren = window?.LayersChildren;
435             if (parentChildren != null)
436             {
437                 int currentIdx = parentChildren.IndexOf(this);
438
439                 if (currentIdx > 0 && currentIdx < parentChildren.Count)
440                 {
441                     var low = parentChildren[currentIdx - 1];
442                     LowerBelow(low);
443                 }
444             }
445         }
446
447         /// <summary>
448         /// Raises the layer to the top.
449         /// </summary>
450         /// <since_tizen> 3 </since_tizen>
451         public void RaiseToTop()
452         {
453             var parentChildren = window?.LayersChildren;
454
455             if (parentChildren != null)
456             {
457                 parentChildren.Remove(this);
458                 parentChildren.Add(this);
459
460                 Interop.Layer.Layer_RaiseToTop(swigCPtr);
461                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462             }
463         }
464
465         /// <summary>
466         /// Lowers the layer to the bottom.
467         /// </summary>
468         /// <since_tizen> 3 </since_tizen>
469         public void LowerToBottom()
470         {
471             var parentChildren = window?.LayersChildren;
472
473             if (parentChildren != null)
474             {
475                 parentChildren.Remove(this);
476                 parentChildren.Insert(0, this);
477
478                 Interop.Layer.Layer_LowerToBottom(swigCPtr);
479                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480             }
481         }
482
483         /// <summary>
484         /// Moves the layer directly above the given layer.<br />
485         /// After the call, this layer's depth will be immediately above target.<br />
486         /// </summary>
487         /// <param name="target">The layer to get on top of.</param>
488         /// <since_tizen> 3 </since_tizen>
489         public void MoveAbove(Layer target)
490         {
491             Interop.Layer.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
492             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
493         }
494
495         /// <summary>
496         /// Moves the layer directly below the given layer.<br />
497         /// After the call, this layer's depth will be immediately below target.<br />
498         /// </summary>
499         /// <param name="target">The layer to get below of.</param>
500         /// <since_tizen> 3 </since_tizen>
501         public void MoveBelow(Layer target)
502         {
503             Interop.Layer.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
504             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505         }
506
507         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
508         {
509             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
510         }
511
512         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
513         [EditorBrowsable(EditorBrowsableState.Never)]
514         public void SetAnchorPoint(Vector3 anchorPoint)
515         {
516             Interop.Actor.ActorSetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
517             if (NDalicPINVOKE.SWIGPendingException.Pending)
518                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519         }
520
521         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
522         [EditorBrowsable(EditorBrowsableState.Never)]
523         public void SetSize(float width, float height)
524         {
525             Interop.ActorInternal.ActorSetSize(swigCPtr, width, height);
526             if (NDalicPINVOKE.SWIGPendingException.Pending)
527                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528         }
529
530         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
531         [EditorBrowsable(EditorBrowsableState.Never)]
532         public void SetParentOrigin(Vector3 parentOrigin)
533         {
534             Interop.ActorInternal.ActorSetParentOrigin(swigCPtr, Vector3.getCPtr(parentOrigin));
535             if (NDalicPINVOKE.SWIGPendingException.Pending)
536                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537         }
538
539         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
540         [EditorBrowsable(EditorBrowsableState.Never)]
541         public void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
542         {
543             Interop.Actor.ActorSetResizePolicy(swigCPtr, (int)policy, (int)dimension);
544             if (NDalicPINVOKE.SWIGPendingException.Pending)
545                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
546         }
547
548         /// <summary>
549         /// Inhouse API.
550         /// This allows the user to specify whether this layer should consume touch (including gestures).
551         /// If set, any layers behind this layer will not be hit-test.
552         /// </summary>
553         /// <param name="consume">Whether the layer should consume touch (including gestures).</param>
554         [EditorBrowsable(EditorBrowsableState.Never)]
555         public void SetTouchConsumed(bool consume)
556         {
557             Interop.Layer.Layer_SetTouchConsumed(swigCPtr, consume);
558             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559         }
560
561         /// <summary>
562         /// Inhouse API.
563         /// This allows the user to specify whether this layer should consume hover.
564         /// If set, any layers behind this layer will not be hit-test.
565         /// </summary>
566         /// <param name="consume">Whether the layer should consume hover</param>
567         [EditorBrowsable(EditorBrowsableState.Never)]
568         public void SetHoverConsumed(bool consume)
569         {
570             Interop.Layer.Layer_SetHoverConsumed(swigCPtr, consume);
571             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572         }
573
574         internal uint GetDepth()
575         {
576             var parentChildren = window?.LayersChildren;
577             if (parentChildren != null)
578             {
579                 int idx = parentChildren.IndexOf(this);
580                 if (idx >= 0)
581                 {
582                     return Convert.ToUInt32(idx); ;
583                 }
584             }
585             return 0u;
586         }
587         internal void RaiseAbove(Layer target)
588         {
589             var parentChildren = window?.LayersChildren;
590             if (parentChildren != null)
591             {
592                 int currentIndex = parentChildren.IndexOf(this);
593                 int targetIndex = parentChildren.IndexOf(target);
594
595                 if (currentIndex < 0 || targetIndex < 0 ||
596                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
597                 {
598                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
599                     return;
600                 }
601
602                 // If the currentIndex is less than the target index and the target has the same parent.
603                 if (currentIndex < targetIndex)
604                 {
605                     parentChildren.Remove(this);
606                     parentChildren.Insert(targetIndex, this);
607
608                     Interop.Layer.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
609                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610                 }
611             }
612         }
613
614         internal void LowerBelow(Layer target)
615         {
616             var parentChildren = window?.LayersChildren;
617
618             if (parentChildren != null)
619             {
620                 int currentIndex = parentChildren.IndexOf(this);
621                 int targetIndex = parentChildren.IndexOf(target);
622
623                 if (currentIndex < 0 || targetIndex < 0 ||
624                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
625                 {
626                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
627                     return;
628                 }
629
630                 // If the currentIndex is not already the 0th index and the target has the same parent.
631                 if ((currentIndex != 0) && (targetIndex != -1) &&
632                     (currentIndex > targetIndex))
633                 {
634                     parentChildren.Remove(this);
635                     parentChildren.Insert(targetIndex, this);
636
637                     Interop.Layer.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
638                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639                 }
640             }
641         }
642
643         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
644         {
645             Interop.Layer.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
646             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647         }
648
649         internal bool IsTouchConsumed()
650         {
651             bool ret = Interop.Layer.Layer_IsTouchConsumed(swigCPtr);
652             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653             return ret;
654         }
655         internal bool IsHoverConsumed()
656         {
657             bool ret = Interop.Layer.Layer_IsHoverConsumed(swigCPtr);
658             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659             return ret;
660         }
661
662         internal void AddViewToLayerList(View view)
663         {
664             Children.Add(view);
665         }
666
667         internal void RemoveViewFromLayerList(View view)
668         {
669             Children.Remove(view);
670         }
671
672         internal string GetName()
673         {
674             string ret = Interop.Actor.ActorGetName(swigCPtr);
675             if (NDalicPINVOKE.SWIGPendingException.Pending)
676                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677             return ret;
678         }
679
680         internal void SetName(string name)
681         {
682             Interop.Actor.ActorSetName(swigCPtr, name);
683             if (NDalicPINVOKE.SWIGPendingException.Pending)
684                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
685         }
686
687         internal void SetWindow(Window win)
688         {
689             window = win;
690         }
691
692         /// This will not be public opened.
693         [EditorBrowsable(EditorBrowsableState.Never)]
694         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
695         {
696             Interop.Layer.delete_Layer(swigCPtr);
697         }
698
699         private void SetBehavior(LayerBehavior behavior)
700         {
701             Interop.Layer.Layer_SetBehavior(swigCPtr, (int)behavior);
702             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
703         }
704
705         private LayerBehavior GetBehavior()
706         {
707             Layer.LayerBehavior ret = (Layer.LayerBehavior)Interop.Layer.Layer_GetBehavior(swigCPtr);
708             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
709             return ret;
710         }
711
712         internal class Property
713         {
714             internal static readonly int BEHAVIOR = Interop.Layer.Layer_Property_BEHAVIOR_get();
715         }
716     }
717 }