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