Merge branch 'devel/master' into tizen
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / LinearConstrainer.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 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Tizen.NUI
28 {
29
30     internal class LinearConstrainer : BaseHandle
31     {
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33
34         internal LinearConstrainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.LinearConstrainer_SWIGUpcast(cPtr), cMemoryOwn)
35         {
36             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37         }
38
39         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LinearConstrainer obj)
40         {
41             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42         }
43
44         protected override void Dispose(DisposeTypes type)
45         {
46             if (disposed)
47             {
48                 return;
49             }
50
51             if (type == DisposeTypes.Explicit)
52             {
53                 //Called by User
54                 //Release your own managed resources here.
55                 //You should release all of your own disposable objects here.
56
57             }
58
59             //Release your own unmanaged resources here.
60             //You should not access any managed member here except static instance.
61             //because the execution order of Finalizes is non-deterministic.
62
63
64             if (swigCPtr.Handle != global::System.IntPtr.Zero)
65             {
66                 if (swigCMemOwn)
67                 {
68                     swigCMemOwn = false;
69                     NDalicPINVOKE.delete_LinearConstrainer(swigCPtr);
70                 }
71                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
72             }
73
74             base.Dispose(type);
75         }
76
77         public class Property : global::System.IDisposable
78         {
79             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80             protected bool swigCMemOwn;
81
82             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
83             {
84                 swigCMemOwn = cMemoryOwn;
85                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
86             }
87
88             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
89             {
90                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
91             }
92
93             //A Flag to check who called Dispose(). (By User or DisposeQueue)
94             private bool isDisposeQueued = false;
95             //A Flat to check if it is already disposed.
96             protected bool disposed = false;
97
98
99             ~Property()
100             {
101                 if (!isDisposeQueued)
102                 {
103                     isDisposeQueued = true;
104                     DisposeQueue.Instance.Add(this);
105                 }
106             }
107
108             public void Dispose()
109             {
110                 //Throw excpetion if Dispose() is called in separate thread.
111                 if (!Window.IsInstalled())
112                 {
113                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
114                 }
115
116                 if (isDisposeQueued)
117                 {
118                     Dispose(DisposeTypes.Implicit);
119                 }
120                 else
121                 {
122                     Dispose(DisposeTypes.Explicit);
123                     System.GC.SuppressFinalize(this);
124                 }
125             }
126
127             protected virtual void Dispose(DisposeTypes type)
128             {
129                 if (disposed)
130                 {
131                     return;
132                 }
133
134                 if (type == DisposeTypes.Explicit)
135                 {
136                     //Called by User
137                     //Release your own managed resources here.
138                     //You should release all of your own disposable objects here.
139
140                 }
141
142                 //Release your own unmanaged resources here.
143                 //You should not access any managed member here except static instance.
144                 //because the execution order of Finalizes is non-deterministic.
145
146                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
147                 {
148                     if (swigCMemOwn)
149                     {
150                         swigCMemOwn = false;
151                         NDalicPINVOKE.delete_LinearConstrainer_Property(swigCPtr);
152                     }
153                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
154                 }
155
156                 disposed = true;
157             }
158
159             internal Property() : this(NDalicPINVOKE.new_LinearConstrainer_Property(), true)
160             {
161                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162             }
163
164             internal static readonly int VALUE = NDalicPINVOKE.LinearConstrainer_Property_VALUE_get();
165             internal static readonly int PROGRESS = NDalicPINVOKE.LinearConstrainer_Property_PROGRESS_get();
166         }
167
168         public LinearConstrainer() : this(NDalicPINVOKE.LinearConstrainer_New(), true)
169         {
170             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171
172         }
173         internal new static LinearConstrainer DownCast(BaseHandle handle)
174         {
175             LinearConstrainer ret = new LinearConstrainer(NDalicPINVOKE.LinearConstrainer_DownCast(BaseHandle.getCPtr(handle)), true);
176             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177             return ret;
178         }
179
180         internal LinearConstrainer(LinearConstrainer handle) : this(NDalicPINVOKE.new_LinearConstrainer__SWIG_1(LinearConstrainer.getCPtr(handle)), true)
181         {
182             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183         }
184
185         internal LinearConstrainer Assign(LinearConstrainer rhs)
186         {
187             LinearConstrainer ret = new LinearConstrainer(NDalicPINVOKE.LinearConstrainer_Assign(swigCPtr, LinearConstrainer.getCPtr(rhs)), false);
188             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189             return ret;
190         }
191
192         public void Apply(Property target, Property source, Vector2 range, Vector2 wrap)
193         {
194             NDalicPINVOKE.LinearConstrainer_Apply__SWIG_0(swigCPtr, Property.getCPtr(target), Property.getCPtr(source), Vector2.getCPtr(range), Vector2.getCPtr(wrap));
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196         }
197
198         public void Apply(Property target, Property source, Vector2 range)
199         {
200             NDalicPINVOKE.LinearConstrainer_Apply__SWIG_1(swigCPtr, Property.getCPtr(target), Property.getCPtr(source), Vector2.getCPtr(range));
201             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202         }
203
204         internal void Remove(Animatable target)
205         {
206             NDalicPINVOKE.LinearConstrainer_Remove(swigCPtr, Animatable.getCPtr(target));
207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208         }
209
210         public PropertyArray Value
211         {
212             get
213             {
214                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
215                 Tizen.NUI.Object.GetProperty(swigCPtr, LinearConstrainer.Property.VALUE).Get(temp);
216                 return temp;
217             }
218             set
219             {
220                 Tizen.NUI.Object.SetProperty(swigCPtr, LinearConstrainer.Property.VALUE, new Tizen.NUI.PropertyValue(value));
221             }
222         }
223         public PropertyArray Progress
224         {
225             get
226             {
227                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
228                 Tizen.NUI.Object.GetProperty(swigCPtr, LinearConstrainer.Property.PROGRESS).Get(temp);
229                 return temp;
230             }
231             set
232             {
233                 Tizen.NUI.Object.SetProperty(swigCPtr, LinearConstrainer.Property.PROGRESS, new Tizen.NUI.PropertyValue(value));
234             }
235         }
236
237     }
238
239 }