88da7e531b18c82ebe76883205cb933b51a20139
[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(LinearConstrainer handle) : this(Interop.LinearConstrainer.NewLinearConstrainer(LinearConstrainer.getCPtr(handle)), true)
50         {
51             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
52         }
53
54         internal LinearConstrainer Assign(LinearConstrainer rhs)
55         {
56             LinearConstrainer ret = new LinearConstrainer(Interop.LinearConstrainer.Assign(SwigCPtr, LinearConstrainer.getCPtr(rhs)), false);
57             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58             return ret;
59         }
60
61         public void Apply(Tizen.NUI.Property target, Tizen.NUI.Property source, Vector2 range, Vector2 wrap)
62         {
63             Interop.LinearConstrainer.Apply(SwigCPtr, Tizen.NUI.Property.getCPtr(target), Tizen.NUI.Property.getCPtr(source), Vector2.getCPtr(range), Vector2.getCPtr(wrap));
64             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65         }
66
67         public void Apply(Tizen.NUI.Property target, Tizen.NUI.Property source, Vector2 range)
68         {
69             Interop.LinearConstrainer.Apply(SwigCPtr, Tizen.NUI.Property.getCPtr(target), Tizen.NUI.Property.getCPtr(source), Vector2.getCPtr(range));
70             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71         }
72
73         internal void Remove(Animatable target)
74         {
75             Interop.LinearConstrainer.Remove(SwigCPtr, Animatable.getCPtr(target));
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77         }
78
79         public PropertyArray Value
80         {
81             get
82             {
83                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
84                 Tizen.NUI.Object.GetProperty(SwigCPtr, LinearConstrainer.Property.VALUE).Get(temp);
85                 return temp;
86             }
87             set
88             {
89                 Tizen.NUI.Object.SetProperty(SwigCPtr, LinearConstrainer.Property.VALUE, new Tizen.NUI.PropertyValue(value));
90             }
91         }
92
93         public PropertyArray Progress
94         {
95             get
96             {
97                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
98                 Tizen.NUI.Object.GetProperty(SwigCPtr, LinearConstrainer.Property.PROGRESS).Get(temp);
99                 return temp;
100             }
101             set
102             {
103                 Tizen.NUI.Object.SetProperty(SwigCPtr, LinearConstrainer.Property.PROGRESS, new Tizen.NUI.PropertyValue(value));
104             }
105         }
106     }
107 }