[NUI] Resolve many problems relative with BaseHandle
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Common / LinearConstrainer.cs
1 /*
2  * Copyright(c) 2021 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
18 namespace Tizen.NUI
19 {
20     internal class LinearConstrainer : BaseHandle
21     {
22         internal LinearConstrainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
23         {
24         }
25
26         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
27         {
28             Interop.LinearConstrainer.DeleteLinearConstrainer(swigCPtr);
29         }
30
31         internal class Property
32         {
33             internal static readonly int VALUE = Interop.LinearConstrainer.ValueGet();
34             internal static readonly int PROGRESS = Interop.LinearConstrainer.ProgressGet();
35         }
36
37         public LinearConstrainer() : this(Interop.LinearConstrainer.New(), true)
38         {
39             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
40         }
41
42         internal static LinearConstrainer DownCast(BaseHandle handle)
43         {
44             LinearConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer;
45             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46             return ret;
47         }
48
49         internal LinearConstrainer Assign(LinearConstrainer rhs)
50         {
51             LinearConstrainer ret = new LinearConstrainer(Interop.LinearConstrainer.Assign(SwigCPtr, LinearConstrainer.getCPtr(rhs)), false);
52             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53             return ret;
54         }
55
56         public void Apply(Tizen.NUI.Property target, Tizen.NUI.Property source, Vector2 range, Vector2 wrap)
57         {
58             Interop.LinearConstrainer.Apply(SwigCPtr, Tizen.NUI.Property.getCPtr(target), Tizen.NUI.Property.getCPtr(source), Vector2.getCPtr(range), Vector2.getCPtr(wrap));
59             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60         }
61
62         public void Apply(Tizen.NUI.Property target, Tizen.NUI.Property source, Vector2 range)
63         {
64             Interop.LinearConstrainer.Apply(SwigCPtr, Tizen.NUI.Property.getCPtr(target), Tizen.NUI.Property.getCPtr(source), Vector2.getCPtr(range));
65             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66         }
67
68         internal void Remove(Animatable target)
69         {
70             Interop.LinearConstrainer.Remove(SwigCPtr, Animatable.getCPtr(target));
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72         }
73
74         public PropertyArray Value
75         {
76             get
77             {
78                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
79                 Tizen.NUI.Object.GetProperty(SwigCPtr, LinearConstrainer.Property.VALUE).Get(temp);
80                 return temp;
81             }
82             set
83             {
84                 Tizen.NUI.Object.SetProperty(SwigCPtr, LinearConstrainer.Property.VALUE, new Tizen.NUI.PropertyValue(value));
85             }
86         }
87
88         public PropertyArray Progress
89         {
90             get
91             {
92                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
93                 Tizen.NUI.Object.GetProperty(SwigCPtr, LinearConstrainer.Property.PROGRESS).Get(temp);
94                 return temp;
95             }
96             set
97             {
98                 Tizen.NUI.Object.SetProperty(SwigCPtr, LinearConstrainer.Property.PROGRESS, new Tizen.NUI.PropertyValue(value));
99             }
100         }
101     }
102 }