[NUI] Fix comments according to document review
[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
21 namespace Tizen.NUI
22 {
23     /// <summary>
24     /// Layers provide a mechanism for overlaying groups of actors on top of each other.
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     public class Layer : Container
28     {
29         private Window window;
30
31         /// <summary>
32         /// Creates a Layer object.
33         /// </summary>
34         /// <since_tizen> 3 </since_tizen>
35         public Layer() : this(Interop.Layer.New(), true)
36         {
37             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
38             this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft);
39             this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions);
40         }
41
42         internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
43         {
44         }
45
46         /// <summary>
47         /// Enumeration for the behavior of the layer.
48         /// </summary>
49         /// <since_tizen> 3 </since_tizen>
50         public enum LayerBehavior
51         {
52             /// <summary>
53             /// UI control rendering mode (default mode).
54             /// This mode is designed for UI controls that can overlap. In this
55             /// mode renderer order will be respective to the tree hierarchy of
56             /// Actors.<br />
57             /// The rendering order is depth first, so for the following actor tree,
58             /// A will be drawn first, then B, D, E, then C, F.  This ensures that
59             /// overlapping actors are drawn as expected (whereas, with breadth first
60             /// traversal, the actors would interleave).<br />
61             /// </summary>
62             /// <since_tizen> 3 </since_tizen>
63             LayerUI,
64
65             /// <summary>
66             /// Layer will use depth test.
67             /// This mode is designed for a 3 dimensional scene where actors in front
68             /// of other actors will obscure them, i.e. the actors are sorted by the
69             /// distance from the camera.<br />
70             /// When using this mode, a depth test will be used. A depth clear will
71             /// happen for each layer, which means actors in a layer "above" other
72             /// layers will be rendered in front of actors in those layers regardless
73             /// of their Z positions (see Layer::Raise() and Layer::Lower()).<br />
74             /// Opaque renderers are drawn first and write to the depth buffer.  Then
75             /// transparent renderers are drawn with depth test enabled but depth
76             /// write switched off.  Transparent renderers are drawn based on their
77             /// distance from the camera.  A renderer's DEPTH_INDEX property is used to
78             /// offset the distance to the camera when ordering transparent renderers.
79             /// This is useful if you want to define the draw order of two or more
80             /// transparent renderers that are equal distance from the camera.  Unlike
81             /// LAYER_UI, parent-child relationship does not affect rendering order at
82             /// all.
83             /// </summary>
84             /// <since_tizen> 3 </since_tizen>
85             Layer3D
86         }
87
88         internal enum TreeDepthMultiplier
89         {
90             TREE_DEPTH_MULTIPLIER = 10000
91         }
92
93         /// <summary>
94         /// Layer behavior, type String (Layer.LayerBehavior).
95         /// </summary>
96         /// <since_tizen> 3 </since_tizen>
97         public Layer.LayerBehavior Behavior
98         {
99             get
100             {
101                 return GetBehavior();
102             }
103             set
104             {
105                 SetBehavior(value);
106             }
107         }
108
109         /// <summary>
110         /// Sets the viewport (in window coordinates), type rectangle.
111         /// The contents of the layer will not be visible outside this box, when ViewportEnabled is true.
112         /// </summary>
113         /// <since_tizen> 4 </since_tizen>
114         public Rectangle Viewport
115         {
116             get
117             {
118                 if (ClippingEnabled)
119                 {
120                     Rectangle ret = new Rectangle(Interop.Layer.GetClippingBox(SwigCPtr), true);
121                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
122                     return ret;
123                 }
124                 else
125                 {
126                     // Clipping not enabled so return the window size
127                     Size2D windowSize = window?.Size;
128                     Rectangle ret = new Rectangle(0, 0, windowSize.Width, windowSize.Height);
129                     return ret;
130                 }
131             }
132             set
133             {
134                 Interop.Layer.SetClippingBox(SwigCPtr, Rectangle.getCPtr(value));
135                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136                 ClippingEnabled = true;
137             }
138         }
139
140         /// <summary>
141         /// Retrieves and sets the layer's opacity.<br />
142         /// </summary>
143         /// <since_tizen> 3 </since_tizen>
144         public float Opacity
145         {
146             get
147             {
148                 float temp = 0.0f;
149                 var pValue = GetProperty(View.Property.OPACITY);
150                 pValue.Get(out temp);
151                 pValue.Dispose();
152                 return temp;
153             }
154             set
155             {
156                 var temp = new Tizen.NUI.PropertyValue(value);
157                 SetProperty(View.Property.OPACITY, temp);
158                 temp.Dispose();
159             }
160         }
161
162         /// <summary>
163         /// Retrieves and sets the layer's visibility.
164         /// </summary>
165         /// <since_tizen> 3 </since_tizen>
166         public bool Visibility
167         {
168             get
169             {
170                 bool temp = false;
171                 var pValue = GetProperty(View.Property.VISIBLE);
172                 pValue.Get(out temp);
173                 pValue.Dispose();
174                 return temp;
175             }
176             set
177             {
178                 var temp = new Tizen.NUI.PropertyValue(value);
179                 SetProperty(View.Property.VISIBLE, temp);
180                 temp.Dispose();
181             }
182         }
183
184         /// <summary>
185         /// Get the number of children held by the layer.
186         /// </summary>
187         /// <since_tizen> 3 </since_tizen>
188         public new uint ChildCount
189         {
190             get
191             {
192                 return Convert.ToUInt32(Children.Count);
193             }
194         }
195
196         /// <summary>
197         /// Gets or sets the layer's name.
198         /// </summary>
199         /// <since_tizen> 3 </since_tizen>
200         public string Name
201         {
202             get
203             {
204                 return GetName();
205             }
206             set
207             {
208                 SetName(value);
209             }
210         }
211
212         /// <summary>
213         /// Queries the depth of the layer.<br />
214         /// 0 is the bottommost layer, higher number is on the top.<br />
215         /// </summary>
216         /// <since_tizen> 3 </since_tizen>
217         public uint Depth
218         {
219             get
220             {
221                 return GetDepth();
222             }
223         }
224
225         /// <summary>
226         /// Internal only property to enable or disable clipping, type boolean.
227         /// By default, this is false, i.e., the viewport of the layer is the entire window.
228         /// </summary>
229         internal bool ClippingEnabled
230         {
231             get
232             {
233                 bool ret = Interop.Layer.IsClipping(SwigCPtr);
234                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235                 return ret;
236             }
237             set
238             {
239                 Interop.Layer.SetClipping(SwigCPtr, value);
240                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241             }
242         }
243
244         /// <summary>
245         /// Gets the Layer's ID
246         /// Readonly
247         /// </summary>
248         /// <remarks>Hidden-API</remarks>
249         [EditorBrowsable(EditorBrowsableState.Never)]
250         public uint ID
251         {
252             get
253             {
254                 return GetId();
255             }
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                 OnChildAdded(child);
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             OnChildRemoved(child);
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         [Obsolete("This has been deprecated in API9 and will be removed in API11. Use ChildCount property instead")]
352         public override uint GetChildCount()
353         {
354             return Convert.ToUInt32(Children.Count);
355         }
356
357         /// <summary>
358         /// Downcasts a handle to layer handle.
359         /// </summary>
360         /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
361         /// <since_tizen> 3 </since_tizen>
362         /// Do not use this, that will be deprecated. Use as keyword instead.
363         [Obsolete("Do not use this, that will be deprecated. 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.FindChildById(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.FindChildByName(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.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.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.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.MoveBelow(SwigCPtr, Layer.getCPtr(target));
504             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505         }
506
507         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
508         [EditorBrowsable(EditorBrowsableState.Never)]
509         public void SetAnchorPoint(Vector3 anchorPoint)
510         {
511             Interop.Actor.SetAnchorPoint(SwigCPtr, Vector3.getCPtr(anchorPoint));
512             if (NDalicPINVOKE.SWIGPendingException.Pending)
513                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514         }
515
516         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
517         [EditorBrowsable(EditorBrowsableState.Never)]
518         public void SetSize(float width, float height)
519         {
520             Interop.ActorInternal.SetSize(SwigCPtr, width, height);
521             if (NDalicPINVOKE.SWIGPendingException.Pending)
522                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523         }
524
525         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
526         [EditorBrowsable(EditorBrowsableState.Never)]
527         public void SetParentOrigin(Vector3 parentOrigin)
528         {
529             Interop.ActorInternal.SetParentOrigin(SwigCPtr, Vector3.getCPtr(parentOrigin));
530             if (NDalicPINVOKE.SWIGPendingException.Pending)
531                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532         }
533
534         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
535         [EditorBrowsable(EditorBrowsableState.Never)]
536         public void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
537         {
538             Interop.Actor.SetResizePolicy(SwigCPtr, (int)policy, (int)dimension);
539             if (NDalicPINVOKE.SWIGPendingException.Pending)
540                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541         }
542
543         /// <summary>
544         /// Inhouse API.
545         /// This allows the user to specify whether this layer should consume touch (including gestures).
546         /// If set, any layers behind this layer will not be hit-test.
547         /// </summary>
548         /// <param name="consume">Whether the layer should consume touch (including gestures).</param>
549         [EditorBrowsable(EditorBrowsableState.Never)]
550         public void SetTouchConsumed(bool consume)
551         {
552             Interop.Layer.SetTouchConsumed(SwigCPtr, consume);
553             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554         }
555
556         /// <summary>
557         /// Inhouse API.
558         /// This allows the user to specify whether this layer should consume hover.
559         /// If set, any layers behind this layer will not be hit-test.
560         /// </summary>
561         /// <param name="consume">Whether the layer should consume hover</param>
562         [EditorBrowsable(EditorBrowsableState.Never)]
563         public void SetHoverConsumed(bool consume)
564         {
565             Interop.Layer.SetHoverConsumed(SwigCPtr, consume);
566             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567         }
568
569         internal uint GetDepth()
570         {
571             var parentChildren = window?.LayersChildren;
572             if (parentChildren != null)
573             {
574                 int idx = parentChildren.IndexOf(this);
575                 if (idx >= 0)
576                 {
577                     return Convert.ToUInt32(idx); ;
578                 }
579             }
580             return 0u;
581         }
582         internal void RaiseAbove(Layer target)
583         {
584             var parentChildren = window?.LayersChildren;
585             if (parentChildren != null)
586             {
587                 int currentIndex = parentChildren.IndexOf(this);
588                 int targetIndex = parentChildren.IndexOf(target);
589
590                 if (currentIndex < 0 || targetIndex < 0 ||
591                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
592                 {
593                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
594                     return;
595                 }
596
597                 // If the currentIndex is less than the target index and the target has the same parent.
598                 if (currentIndex < targetIndex)
599                 {
600                     parentChildren.Remove(this);
601                     parentChildren.Insert(targetIndex, this);
602
603                     Interop.Layer.MoveAbove(SwigCPtr, Layer.getCPtr(target));
604                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605                 }
606             }
607         }
608
609         internal void LowerBelow(Layer target)
610         {
611             var parentChildren = window?.LayersChildren;
612
613             if (parentChildren != null)
614             {
615                 int currentIndex = parentChildren.IndexOf(this);
616                 int targetIndex = parentChildren.IndexOf(target);
617
618                 if (currentIndex < 0 || targetIndex < 0 ||
619                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
620                 {
621                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
622                     return;
623                 }
624
625                 // If the currentIndex is not already the 0th index and the target has the same parent.
626                 if ((currentIndex != 0) && (targetIndex != -1) &&
627                     (currentIndex > targetIndex))
628                 {
629                     parentChildren.Remove(this);
630                     parentChildren.Insert(targetIndex, this);
631
632                     Interop.Layer.MoveBelow(SwigCPtr, Layer.getCPtr(target));
633                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634                 }
635             }
636         }
637
638         internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
639         {
640             Interop.Layer.SetSortFunction(SwigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
641             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
642         }
643
644         internal bool IsTouchConsumed()
645         {
646             bool ret = Interop.Layer.IsTouchConsumed(SwigCPtr);
647             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648             return ret;
649         }
650         internal bool IsHoverConsumed()
651         {
652             bool ret = Interop.Layer.IsHoverConsumed(SwigCPtr);
653             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654             return ret;
655         }
656
657         internal void AddViewToLayerList(View view)
658         {
659             Children.Add(view);
660         }
661
662         internal void RemoveViewFromLayerList(View view)
663         {
664             Children.Remove(view);
665         }
666
667         internal string GetName()
668         {
669             string ret = Interop.Actor.GetName(SwigCPtr);
670             if (NDalicPINVOKE.SWIGPendingException.Pending)
671                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
672             return ret;
673         }
674
675         internal void SetName(string name)
676         {
677             Interop.Actor.SetName(SwigCPtr, name);
678             if (NDalicPINVOKE.SWIGPendingException.Pending)
679                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680         }
681
682         internal void SetWindow(Window win)
683         {
684             window = win;
685         }
686
687         internal uint GetId()
688         {
689             uint ret = Interop.Actor.GetId(SwigCPtr);
690             if (NDalicPINVOKE.SWIGPendingException.Pending)
691                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692             return ret;
693         }
694
695         /// This will not be public opened.
696         [EditorBrowsable(EditorBrowsableState.Never)]
697         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
698         {
699             Interop.Layer.DeleteLayer(swigCPtr);
700         }
701
702         private void SetBehavior(LayerBehavior behavior)
703         {
704             Interop.Layer.SetBehavior(SwigCPtr, (int)behavior);
705             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706         }
707
708         private LayerBehavior GetBehavior()
709         {
710             Layer.LayerBehavior ret = (Layer.LayerBehavior)Interop.Layer.GetBehavior(SwigCPtr);
711             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
712             return ret;
713         }
714
715         internal class Property
716         {
717             internal static readonly int BEHAVIOR = Interop.Layer.BehaviorGet();
718         }
719     }
720 }