Add ScriptUI to support XAML file (#320)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / TypeInfo.cs
1 /*
2  * Copyright(c) 2017 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
21     /// <summary>
22     /// TypeInfo class for instantiation of registered types and introspection of their actions and signals.
23     /// </summary>
24     /// <since_tizen> 3 </since_tizen>
25     public class TypeInfo : BaseHandle
26     {
27         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28
29         internal TypeInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TypeInfo_SWIGUpcast(cPtr), cMemoryOwn)
30         {
31             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32         }
33
34         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeInfo obj)
35         {
36             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37         }
38
39         /// <summary>
40         /// Dispose.
41         /// </summary>
42         /// <param name="type">The dispose type</param>
43         /// <since_tizen> 3 </since_tizen>
44         protected override void Dispose(DisposeTypes type)
45         {
46             if (disposed)
47             {
48                 return;
49             }
50
51             if (type == DisposeTypes.Explicit)
52             {
53                 //Called by User
54                 //Release your own managed resources here.
55                 //You should release all of your own disposable objects here.
56
57             }
58
59             //Release your own unmanaged resources here.
60             //You should not access any managed member here except static instance.
61             //because the execution order of Finalizes is non-deterministic.
62
63             if (swigCPtr.Handle != global::System.IntPtr.Zero)
64             {
65                 if (swigCMemOwn)
66                 {
67                     swigCMemOwn = false;
68                     NDalicPINVOKE.delete_TypeInfo(swigCPtr);
69                 }
70                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71             }
72
73             base.Dispose(type);
74         }
75
76         /// <summary>
77         /// Creates TypeInfo object.
78         /// </summary>
79         /// <since_tizen> 3 </since_tizen>
80         public TypeInfo() : this(NDalicPINVOKE.new_TypeInfo__SWIG_0(), true)
81         {
82             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83         }
84
85         /// <summary>
86         /// Creates TypeInfo object.
87         /// </summary>
88         /// <param name="handle">This copy constructor is required for (smart) pointer semantics.</param>
89         /// <since_tizen> 3 </since_tizen>
90         public TypeInfo(TypeInfo handle) : this(NDalicPINVOKE.new_TypeInfo__SWIG_1(TypeInfo.getCPtr(handle)), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93         }
94
95         /// <summary>
96         /// Retrieves the type name for this type.
97         /// </summary>
98         /// <returns>The string name.</returns>
99         /// <since_tizen> 3 </since_tizen>
100         public string GetName()
101         {
102             string ret = NDalicPINVOKE.TypeInfo_GetName(swigCPtr);
103             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104             return ret;
105         }
106
107         /// <summary>
108         /// Retrieves the type name for this type.
109         /// </summary>
110         /// <returns>The string name.</returns>
111         /// <since_tizen> 3 </since_tizen>
112         public string GetBaseName()
113         {
114             string ret = NDalicPINVOKE.TypeInfo_GetBaseName(swigCPtr);
115             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116             return ret;
117         }
118
119         /// <summary>
120         /// Creates an object from this type.
121         /// </summary>
122         /// <returns>The BaseHandle for the newly created object.</returns>
123         /// <since_tizen> 3 </since_tizen>
124         public BaseHandle CreateInstance()
125         {
126             BaseHandle ret = new BaseHandle(NDalicPINVOKE.TypeInfo_CreateInstance(swigCPtr), true);
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             return ret;
129         }
130
131         /// <summary>
132         /// Retrieves the number of event side type registered properties for this type.<br />
133         /// This count does not include all properties.
134         /// </summary>
135         /// <returns>The count.</returns>
136         /// <since_tizen> 3 </since_tizen>
137         public uint GetPropertyCount()
138         {
139             uint ret = NDalicPINVOKE.TypeInfo_GetPropertyCount(swigCPtr);
140             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141             return ret;
142         }
143
144         /// <summary>
145         /// Given a property index, retrieve the property name associated with it.
146         /// </summary>
147         /// <param name="index">The property index.</param>
148         /// <returns>The name of the property at the given index.</returns>
149         /// <since_tizen> 3 </since_tizen>
150         public string GetPropertyName(int index)
151         {
152             string ret = NDalicPINVOKE.TypeInfo_GetPropertyName(swigCPtr, index);
153             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154             return ret;
155         }
156
157     }
158
159 }