37a8b4115f1a10e3a1fd107c99df3b2682862257
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Common / PathConstrainer.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 PathConstrainer : BaseHandle
21     {
22         internal PathConstrainer(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.PathConstrainer.DeletePathConstrainer(swigCPtr);
29         }
30
31         internal class Property
32         {
33             internal static readonly int FORWARD = Interop.PathConstrainer.ForwardGet();
34             internal static readonly int POINTS = Interop.PathConstrainer.PointsGet();
35             internal static readonly int ControlPoints = Interop.PathConstrainer.ControlPointsGet();
36         }
37
38         public PathConstrainer() : this(Interop.PathConstrainer.New(), true)
39         {
40             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
41
42         }
43         public static PathConstrainer DownCast(BaseHandle handle)
44         {
45             PathConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer;
46             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47             return ret;
48         }
49
50         internal PathConstrainer(PathConstrainer handle) : this(Interop.PathConstrainer.NewPathConstrainer(PathConstrainer.getCPtr(handle)), true)
51         {
52             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53         }
54
55         internal PathConstrainer Assign(PathConstrainer rhs)
56         {
57             PathConstrainer ret = new PathConstrainer(Interop.PathConstrainer.Assign(SwigCPtr, PathConstrainer.getCPtr(rhs)), false);
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59             return ret;
60         }
61
62         public void Apply(Tizen.NUI.Property target, Tizen.NUI.Property source, Vector2 range, Vector2 wrap)
63         {
64             Interop.PathConstrainer.Apply(SwigCPtr, Tizen.NUI.Property.getCPtr(target), Tizen.NUI.Property.getCPtr(source), Vector2.getCPtr(range), Vector2.getCPtr(wrap));
65             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66         }
67
68         public void Apply(Tizen.NUI.Property target, Tizen.NUI.Property source, Vector2 range)
69         {
70             Interop.PathConstrainer.Apply(SwigCPtr, Tizen.NUI.Property.getCPtr(target), Tizen.NUI.Property.getCPtr(source), Vector2.getCPtr(range));
71             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72         }
73
74         internal void Remove(Animatable target)
75         {
76             Interop.PathConstrainer.Remove(SwigCPtr, Animatable.getCPtr(target));
77             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78         }
79
80         public Vector3 Forward
81         {
82             get
83             {
84                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
85                 Tizen.NUI.Object.GetProperty(SwigCPtr, PathConstrainer.Property.FORWARD).Get(temp);
86                 return temp;
87             }
88             set
89             {
90                 Tizen.NUI.Object.SetProperty(SwigCPtr, PathConstrainer.Property.FORWARD, new Tizen.NUI.PropertyValue(value));
91             }
92         }
93
94         public PropertyArray Points
95         {
96             get
97             {
98                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
99                 Tizen.NUI.Object.GetProperty(SwigCPtr, PathConstrainer.Property.POINTS).Get(temp);
100                 return temp;
101             }
102             set
103             {
104                 Tizen.NUI.Object.SetProperty(SwigCPtr, PathConstrainer.Property.POINTS, new Tizen.NUI.PropertyValue(value));
105             }
106         }
107
108         public PropertyArray ControlPoints
109         {
110             get
111             {
112                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
113                 Tizen.NUI.Object.GetProperty(SwigCPtr, PathConstrainer.Property.ControlPoints).Get(temp);
114                 return temp;
115             }
116             set
117             {
118                 Tizen.NUI.Object.SetProperty(SwigCPtr, PathConstrainer.Property.ControlPoints, new Tizen.NUI.PropertyValue(value));
119             }
120         }
121     }
122 }