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