manual nui merge 0.2.38
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / RelayoutContainer.cs
1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 //
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 // Some have been manually changed
18
19
20 namespace Tizen.NUI
21 {
22     using Tizen.NUI.BaseComponents;
23     /// <summary>
24     /// Interface to encapsulate information required for relayout.
25     /// </summary>
26     public class RelayoutContainer : global::System.IDisposable
27     {
28         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29         protected bool swigCMemOwn;
30
31         internal RelayoutContainer(global::System.IntPtr cPtr, bool cMemoryOwn)
32         {
33             swigCMemOwn = cMemoryOwn;
34             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
35         }
36
37         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelayoutContainer obj)
38         {
39             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
40         }
41
42         ~RelayoutContainer()
43         {
44             DisposeQueue.Instance.Add(this);
45         }
46
47         /// <summary>
48         /// To make RelayoutContainer instance be disposed.
49         /// </summary>
50         public virtual void Dispose()
51         {
52             if (!Window.IsInstalled())
53             {
54                 DisposeQueue.Instance.Add(this);
55                 return;
56             }
57
58             lock (this)
59             {
60                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61                 {
62                     if (swigCMemOwn)
63                     {
64                         swigCMemOwn = false;
65                         NDalicPINVOKE.delete_RelayoutContainer(swigCPtr);
66                     }
67                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
68                 }
69                 global::System.GC.SuppressFinalize(this);
70             }
71         }
72
73         /// <summary>
74         /// Adds relayout information to the container if it doesn't already exist.
75         /// </summary>
76         /// <param name="view">The view to relayout</param>
77         /// <param name="size">The size to relayout</param>
78         public virtual void Add(View view, Size2D size)
79         {
80             NDalicPINVOKE.RelayoutContainer_Add(swigCPtr, View.getCPtr(view), Size2D.getCPtr(size));
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82         }
83
84     }
85
86 }