[NUI] Sync dalihub/TizenFX and Samsung/TizenFX (#528)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Layouting / AbsoluteLayout.cs
1 /** Copyright (c) 2018 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 using System.ComponentModel;
17
18 namespace Tizen.NUI
19 {
20     /// <summary>
21     /// [Draft] This class implements a absolute layout, allowing explicit positioning of children.
22     ///  Positions are from the top left of the layout and can be set using the Actor::Property::POSITION and alike.
23     /// </summary>
24     internal class AbsoluteLayout : LayoutGroupWrapper
25     {
26         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27
28         internal AbsoluteLayout(global::System.IntPtr cPtr, bool cMemoryOwn) : base(LayoutPINVOKE.AbsoluteLayout_SWIGUpcast(cPtr), cMemoryOwn)
29         {
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AbsoluteLayout obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         protected virtual void Dispose(DisposeTypes type)
39         {
40             if (disposed)
41             {
42                 return;
43             }
44
45             if (type == DisposeTypes.Explicit)
46             {
47                 //Called by User
48                 //Release your own managed resources here.
49                 //You should release all of your own disposable objects here.
50
51             }
52
53             //Release your own unmanaged resources here.
54             //You should not access any managed member here except static instance.
55             //because the execution order of Finalizes is non-deterministic.
56             if (swigCPtr.Handle != global::System.IntPtr.Zero)
57             {
58                 if (swigCMemOwn)
59                 {
60                     swigCMemOwn = false;
61                     LayoutPINVOKE.delete_AbsoluteLayout(swigCPtr);
62                 }
63                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
64             }
65             base.Dispose(type);
66         }
67
68         /// <summary>
69         /// [Draft] Creates a AbsoluteLayout object.
70         /// </summary>
71         public AbsoluteLayout() : this(LayoutPINVOKE.AbsoluteLayout_New(), true)
72         {
73             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74         }
75
76         /// <summary>
77         /// [Draft] Downcasts a handle to a AbsoluteLayout handle.
78         /// If handle points to a AbsoluteLayout, the downcast produces a valid handle.
79         /// If not, the returned handle is left uninitialized.
80         /// </summary>
81         /// <param name="handle">handle to an object</param>
82         /// <returns>Handle to a AbsoluteLayout or an uninitialized handle</returns>
83         internal static AbsoluteLayout DownCast(BaseHandle handle)
84         {
85             AbsoluteLayout ret = new AbsoluteLayout(LayoutPINVOKE.AbsoluteLayout_DownCast(BaseHandle.getCPtr(handle)), true);
86             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87             return ret;
88         }
89
90         /// <summary>
91         /// [Draft] Copy constructor
92         /// </summary>
93         /// <param name="other"></param>
94         internal AbsoluteLayout(AbsoluteLayout other) : this(LayoutPINVOKE.new_AbsoluteLayout__SWIG_1(AbsoluteLayout.getCPtr(other)), true)
95         {
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98
99         internal AbsoluteLayout Assign(AbsoluteLayout other)
100         {
101             AbsoluteLayout ret = new AbsoluteLayout(LayoutPINVOKE.AbsoluteLayout_Assign(swigCPtr, AbsoluteLayout.getCPtr(other)), false);
102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103             return ret;
104         }
105
106         internal enum PropertyRange
107         {
108             CHILD_PROPERTY_START_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX,
109             CHILD_PROPERTY_END_INDEX = PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX + 1000
110         }
111
112     }
113
114 }