[NUI] Fixing the emtpy finalizers(CA1821)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Property.cs
1 /*
2  * Copyright(c) 2019 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 Property : Disposable
21     {
22
23         /// <summary>
24         /// This constructor creates a property instance.
25         /// </summary>
26         /// <param name="arg0">A valid handle to the target object.</param>
27         /// <param name="propertyIndex">The index of a property.</param>
28         /// <since_tizen> 3 </since_tizen>
29         public Property(Animatable arg0, int propertyIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(arg0), propertyIndex), true)
30         {
31             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
32         }
33
34         /// <summary>
35         /// This constructor creates a property instance.
36         /// </summary>
37         /// <param name="arg0">A valid handle to the target object.</param>
38         /// <param name="propertyIndex">The index of a property.</param>
39         /// <param name="componentIndex">Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1).</param>
40         /// <since_tizen> 3 </since_tizen>
41         public Property(Animatable arg0, int propertyIndex, int componentIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(arg0), propertyIndex, componentIndex), true)
42         {
43             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44         }
45
46         /// <summary>
47         /// This constructor creates a property instance.<br />
48         /// This performs a property index query and is therefore slower than constructing a property directly with the index.<br />
49         /// </summary>
50         /// <param name="arg0">A valid handle to the target object.</param>
51         /// <param name="propertyName">The property name.</param>
52         /// <since_tizen> 3 </since_tizen>
53         public Property(Animatable arg0, string propertyName) : this(Interop.Property.NewProperty(Animatable.getCPtr(arg0), propertyName), true)
54         {
55             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56         }
57
58         /// <summary>
59         /// This constructor creates a property instance.<br />
60         /// This performs a property index query and is therefore slower than constructing a property directly with the index.<br />
61         /// </summary>
62         /// <param name="arg0">A valid handle to the target object.</param>
63         /// <param name="propertyName">The property name.</param>
64         /// <param name="componentIndex">Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1).</param>
65         /// <since_tizen> 3 </since_tizen>
66         public Property(Animatable arg0, string propertyName, int componentIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(arg0), propertyName, componentIndex), true)
67         {
68             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69         }
70
71         internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
72         {
73         }
74
75         /// <summary>
76         /// Gets or sets the index of the property.
77         /// </summary>
78         /// <since_tizen> 3 </since_tizen>
79         public int propertyIndex
80         {
81             set
82             {
83                 Interop.Property.PropertyIndexSet(SwigCPtr, value);
84                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85             }
86             get
87             {
88                 int ret = Interop.Property.PropertyIndexGet(SwigCPtr);
89                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90                 return ret;
91             }
92         }
93
94         /// <summary>
95         /// Gets or sets the component index of the property.
96         /// </summary>
97         /// <since_tizen> 3 </since_tizen>
98         public int componentIndex
99         {
100             set
101             {
102                 Interop.Property.ComponentIndexSet(SwigCPtr, value);
103                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104             }
105             get
106             {
107                 int ret = Interop.Property.ComponentIndexGet(SwigCPtr);
108                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109                 return ret;
110             }
111         }
112
113         internal static int InvalidIndex
114         {
115             get
116             {
117                 int ret = Interop.Property.InvalidIndexGet();
118                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119                 return ret;
120             }
121         }
122
123         internal static int InvalidKey
124         {
125             get
126             {
127                 int ret = Interop.Property.InvalidKeyGet();
128                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129                 return ret;
130             }
131         }
132
133         internal static int InvalidComponentIndex
134         {
135             get
136             {
137                 int ret = Interop.Property.InvalidComponentIndexGet();
138                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139                 return ret;
140             }
141         }
142
143         internal Animatable Object
144         {
145             set
146             {
147                 Interop.Property.ObjectSet(SwigCPtr, Animatable.getCPtr(value));
148                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149             }
150             get
151             {
152                 Animatable ret = new Animatable(Interop.Property.ObjectGet(SwigCPtr), false);
153                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154                 return ret;
155             }
156         }
157
158         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
159         {
160             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
161         }
162
163         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
164         {
165             Interop.Property.DeleteProperty(swigCPtr);
166         }
167     }
168 }