[NUI] Fixing the emtpy finalizers(CA1821)
[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.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.Upcast(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                 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.IsClipping(SwigCPtr);
235                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236                 return ret;
237             }
238             set
239             {
240                 Interop.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.Add( 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             Interop.Actor.Remove( SwigCPtr, View.getCPtr(child));
309             if (NDalicPINVOKE.SWIGPendingException.Pending)
310                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311
312             Children.Remove(child);
313             child.InternalParent = null;
314         }
315
316         /// <summary>
317         /// Retrieves a child view by the index.
318         /// </summary>
319         /// <pre>The view has been initialized.</pre>
320         /// <param name="index">The index of the child to retrieve.</param>
321         /// <returns>The view for the given index or empty handle if children not initialized.</returns>
322         /// <since_tizen> 4 </since_tizen>
323         public override View GetChildAt(uint index)
324         {
325             if (index < Children.Count)
326             {
327                 return Children[Convert.ToInt32(index)];
328             }
329             else
330             {
331                 return null;
332             }
333         }
334
335         /// <summary>
336         /// Get parent of the layer.
337         /// </summary>
338         /// <returns>The view's container</returns>
339         /// <since_tizen> 4 </since_tizen>
340         public override Container GetParent()
341         {
342             return null;
343         }
344
345         /// <summary>
346         /// Get the child count of the layer.
347         /// </summary>
348         /// <returns>The child count of the layer.</returns>
349         /// <since_tizen> 4 </since_tizen>
350         public override uint GetChildCount()
351         {
352             return Convert.ToUInt32(Children.Count);
353         }
354
355         /// <summary>
356         /// Downcasts a handle to layer handle.
357         /// </summary>
358         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
359         /// <since_tizen> 3 </since_tizen>
360         /// Please do not use! this will be deprecated!
361         /// Instead please use as keyword.
362         [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")]
363         [EditorBrowsable(EditorBrowsableState.Never)]
364         public static Layer DownCast(BaseHandle handle)
365         {
366             if (null == handle)
367             {
368                 throw new ArgumentNullException(nameof(handle));
369             }
370             Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer;
371             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
372             return ret;
373         }
374
375         /// <summary>
376         /// Search through this layer's hierarchy for a view with the given unique ID.
377         /// </summary>
378         /// <pre>This layer (the parent) has been initialized.</pre>
379         /// <remarks>The actor itself is also considered in the search.</remarks>
380         /// <param name="id">The id of the child to find</param>
381         /// <returns> A handle to the view if found, or an empty handle if not. </returns>
382         /// <since_tizen> 3 </since_tizen>
383         public View FindChildById(uint id)
384         {
385             //to fix memory leak issue, match the handle count with native side.
386             IntPtr cPtr = Interop.Actor.FindChildById(SwigCPtr, id);
387             View ret = this.GetInstanceSafely<View>(cPtr);
388             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389             return ret;
390         }
391
392         internal override View FindCurrentChildById(uint id)
393         {
394             return FindChildById(id);
395         }
396
397         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
398         [EditorBrowsable(EditorBrowsableState.Never)]
399         public View FindChildByName(string viewName)
400         {
401             //to fix memory leak issue, match the handle count with native side.
402             IntPtr cPtr = Interop.Actor.FindChildByName(SwigCPtr, viewName);
403             View ret = this.GetInstanceSafely<View>(cPtr);
404             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405             return ret;
406         }
407
408         /// <summary>
409         /// Increments the depth of the layer.
410         /// </summary>
411         /// <since_tizen> 3 </since_tizen>
412         public void Raise()
413         {
414             var parentChildren = window?.LayersChildren;
415             if (parentChildren != null)
416             {
417                 int currentIdx = parentChildren.IndexOf(this);
418
419                 if (currentIdx >= 0 && currentIdx < parentChildren.Count - 1)
420                 {
421                     var upper = parentChildren[currentIdx + 1];
422                     RaiseAbove(upper);
423                 }
424             }
425         }
426
427         /// <summary>
428         /// Decrements the depth of the layer.
429         /// </summary>
430         /// <since_tizen> 3 </since_tizen>
431         public void Lower()
432         {
433             var parentChildren = window?.LayersChildren;
434             if (parentChildren != null)
435             {
436                 int currentIdx = parentChildren.IndexOf(this);
437
438                 if (currentIdx > 0 && currentIdx < parentChildren.Count)
439                 {
440                     var low = parentChildren[currentIdx - 1];
441                     LowerBelow(low);
442                 }
443             }
444         }
445
446         /// <summary>
447         /// Raises the layer to the top.
448         /// </summary>
449         /// <since_tizen> 3 </since_tizen>
450         public void RaiseToTop()
451         {
452             var parentChildren = window?.LayersChildren;
453
454             if (parentChildren != null)
455             {
456                 parentChildren.Remove(this);
457                 parentChildren.Add(this);
458
459                 Interop.Layer.RaiseToTop(SwigCPtr);
460                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461             }
462         }
463
464         /// <summary>
465         /// Lowers the layer to the bottom.
466         /// </summary>
467         /// <since_tizen> 3 </since_tizen>
468         public void LowerToBottom()
469         {
470             var parentChildren = window?.LayersChildren;
471
472             if (parentChildren != null)
473             {
474                 parentChildren.Remove(this);
475                 parentChildren.Insert(0, this);
476
477                 Interop.Layer.LowerToBottom(SwigCPtr);
478                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
479             }
480         }
481
482         /// <summary>
483         /// Moves the layer directly above the given layer.<br />
484         /// After the call, this layer's depth will be immediately above target.<br />
485         /// </summary>
486         /// <param name="target">The layer to get on top of.</param>
487         /// <since_tizen> 3 </since_tizen>
488         public void MoveAbove(Layer target)
489         {
490             Interop.Layer.MoveAbove(SwigCPtr, Layer.getCPtr(target));
491             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492         }
493
494         /// <summary>
495         /// Moves the layer directly below the given layer.<br />
496         /// After the call, this layer's depth will be immediately below target.<br />
497         /// </summary>
498         /// <param name="target">The layer to get below of.</param>
499         /// <since_tizen> 3 </since_tizen>
500         public void MoveBelow(Layer target)
501         {
502             Interop.Layer.MoveBelow(SwigCPtr, Layer.getCPtr(target));
503             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504         }
505
506         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
507         {
508             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
509         }
510
511         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
512         [EditorBrowsable(EditorBrowsableState.Never)]
513         public void SetAnchorPoint(Vector3 anchorPoint)
514         {
515             Interop.Actor.SetAnchorPoint(SwigCPtr, Vector3.getCPtr(anchorPoint));
516             if (NDalicPINVOKE.SWIGPendingException.Pending)
517                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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 SetSize(float width, float height)
523         {
524             Interop.ActorInternal.SetSize(SwigCPtr, width, height);
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 SetParentOrigin(Vector3 parentOrigin)
532         {
533             Interop.ActorInternal.SetParentOrigin(SwigCPtr, Vector3.getCPtr(parentOrigin));
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 SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
541         {
542             Interop.Actor.SetResizePolicy(SwigCPtr, (int)policy, (int)dimension);
543             if (NDalicPINVOKE.SWIGPendingException.Pending)
544                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545         }
546
547         /// <summary>
548         /// Inhouse API.
549         /// This allows the user to specify whether this layer should consume touch (including gestures).
550         /// If set, any layers behind this layer will not be hit-test.
551         /// </summary>
552         /// <param name="consume">Whether the layer should consume touch (including gestures).</param>
553         [EditorBrowsable(EditorBrowsableState.Never)]
554         public void SetTouchConsumed(bool consume)
555         {
556             Interop.Layer.SetTouchConsumed(SwigCPtr, consume);
557             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
558         }
559
560         /// <summary>
561         /// Inhouse API.
562         /// This allows the user to specify whether this layer should consume hover.
563         /// If set, any layers behind this layer will not be hit-test.
564         /// </summary>
565         /// <param name="consume">Whether the layer should consume hover</param>
566         [EditorBrowsable(EditorBrowsableState.Never)]
567         public void SetHoverConsumed(bool consume)
568         {
569             Interop.Layer.SetHoverConsumed(SwigCPtr, consume);
570             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
571         }
572
573         internal uint GetDepth()
574         {
575             var parentChildren = window?.LayersChildren;
576             if (parentChildren != null)
577             {
578                 int idx = parentChildren.IndexOf(this);
579                 if (idx >= 0)
580                 {
581                     return Convert.ToUInt32(idx); ;
582                 }
583             }
584             return 0u;
585         }
586         internal void RaiseAbove(Layer target)
587         {
588             var parentChildren = window?.LayersChildren;
589             if (parentChildren != null)
590             {
591                 int currentIndex = parentChildren.IndexOf(this);
592                 int targetIndex = parentChildren.IndexOf(target);
593
594                 if (currentIndex < 0 || targetIndex < 0 ||
595                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
596                 {
597                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
598                     return;
599                 }
600
601                 // If the currentIndex is less than the target index and the target has the same parent.
602                 if (currentIndex < targetIndex)
603                 {
604                     parentChildren.Remove(this);
605                     parentChildren.Insert(targetIndex, this);
606
607                     Interop.Layer.MoveAbove(SwigCPtr, Layer.getCPtr(target));
608                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609                 }
610             }
611         }
612
613         internal void LowerBelow(Layer target)
614         {
615             var parentChildren = window?.LayersChildren;
616
617             if (parentChildren != null)
618             {
619                 int currentIndex = parentChildren.IndexOf(this);
620                 int targetIndex = parentChildren.IndexOf(target);
621
622                 if (currentIndex < 0 || targetIndex < 0 ||
623                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
624                 {
625                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
626                     return;
627                 }
628
629                 // If the currentIndex is not already the 0th index and the target has the same parent.
630                 if ((currentIndex != 0) && (targetIndex != -1) &&
631                     (currentIndex > targetIndex))
632                 {
633                     parentChildren.Remove(this);
634                     parentChildren.Insert(targetIndex, this);
635
636                     Interop.Layer.MoveBelow(SwigCPtr, Layer.getCPtr(target));
637                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638                 }
639             }
640         }
641
642         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
643         {
644             Interop.Layer.SetSortFunction(SwigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
645             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646         }
647
648         internal bool IsTouchConsumed()
649         {
650             bool ret = Interop.Layer.IsTouchConsumed(SwigCPtr);
651             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652             return ret;
653         }
654         internal bool IsHoverConsumed()
655         {
656             bool ret = Interop.Layer.IsHoverConsumed(SwigCPtr);
657             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658             return ret;
659         }
660
661         internal void AddViewToLayerList(View view)
662         {
663             Children.Add(view);
664         }
665
666         internal void RemoveViewFromLayerList(View view)
667         {
668             Children.Remove(view);
669         }
670
671         internal string GetName()
672         {
673             string ret = Interop.Actor.GetName(SwigCPtr);
674             if (NDalicPINVOKE.SWIGPendingException.Pending)
675                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
676             return ret;
677         }
678
679         internal void SetName(string name)
680         {
681             Interop.Actor.SetName(SwigCPtr, name);
682             if (NDalicPINVOKE.SWIGPendingException.Pending)
683                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684         }
685
686         internal void SetWindow(Window win)
687         {
688             window = win;
689         }
690
691         /// This will not be public opened.
692         [EditorBrowsable(EditorBrowsableState.Never)]
693         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
694         {
695             Interop.Layer.DeleteLayer(swigCPtr);
696         }
697
698         private void SetBehavior(LayerBehavior behavior)
699         {
700             Interop.Layer.SetBehavior(SwigCPtr, (int)behavior);
701             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702         }
703
704         private LayerBehavior GetBehavior()
705         {
706             Layer.LayerBehavior ret = (Layer.LayerBehavior)Interop.Layer.GetBehavior(SwigCPtr);
707             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708             return ret;
709         }
710
711         internal class Property
712         {
713             internal static readonly int BEHAVIOR = Interop.Layer.BehaviorGet();
714         }
715     }
716 }