[NUI] remove "_" and refactoring naming to pascal case.
[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 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21
22     /// <summary>
23     /// TypeInfo class for instantiation of registered types and introspection of their actions and signals.
24     /// </summary>
25     /// <since_tizen> 3 </since_tizen>
26     public class TypeInfo : BaseHandle
27     {
28
29         /// <summary>
30         /// Creates TypeInfo object.
31         /// </summary>
32         /// <since_tizen> 3 </since_tizen>
33         public TypeInfo() : this(Interop.TypeInfo.NewTypeInfo(), true)
34         {
35             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
36         }
37
38         /// <summary>
39         /// Creates TypeInfo object.
40         /// </summary>
41         /// <param name="handle">This copy constructor is required for (smart) pointer semantics.</param>
42         /// <since_tizen> 3 </since_tizen>
43         public TypeInfo(TypeInfo handle) : this(Interop.TypeInfo.NewTypeInfo(TypeInfo.getCPtr(handle)), true)
44         {
45             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46         }
47
48         internal TypeInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TypeInfo.Upcast(cPtr), cMemoryOwn)
49         {
50         }
51
52         /// <summary>
53         /// Retrieves the type name for this type.
54         /// </summary>
55         /// <returns>The string name.</returns>
56         /// <since_tizen> 3 </since_tizen>
57         public string GetName()
58         {
59             string ret = Interop.TypeInfo.GetName(swigCPtr);
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61             return ret;
62         }
63
64         /// <summary>
65         /// Retrieves the type name for this type.
66         /// </summary>
67         /// <returns>The string name.</returns>
68         /// <since_tizen> 3 </since_tizen>
69         public string GetBaseName()
70         {
71             string ret = Interop.TypeInfo.GetBaseName(swigCPtr);
72             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73             return ret;
74         }
75
76         /// <summary>
77         /// Creates an object from this type.
78         /// </summary>
79         /// <returns>The BaseHandle for the newly created object.</returns>
80         /// <since_tizen> 3 </since_tizen>
81         public BaseHandle CreateInstance()
82         {
83             BaseHandle ret = new BaseHandle(Interop.TypeInfo.CreateInstance(swigCPtr), true);
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85             return ret;
86         }
87
88         /// <summary>
89         /// Retrieves the number of event side type registered properties for this type.<br />
90         /// This count does not include all properties.
91         /// </summary>
92         /// <returns>The count.</returns>
93         /// <since_tizen> 3 </since_tizen>
94         public uint GetPropertyCount()
95         {
96             uint ret = Interop.TypeInfo.GetPropertyCount(swigCPtr);
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98             return ret;
99         }
100
101         /// <summary>
102         /// Given a property index, retrieve the property name associated with it.
103         /// </summary>
104         /// <param name="index">The property index.</param>
105         /// <returns>The name of the property at the given index.</returns>
106         /// <since_tizen> 3 </since_tizen>
107         public string GetPropertyName(int index)
108         {
109             string ret = Interop.TypeInfo.GetPropertyName(swigCPtr, index);
110             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111             return ret;
112         }
113
114         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeInfo obj)
115         {
116             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
117         }
118
119         /// This will not be public opened.
120         [EditorBrowsable(EditorBrowsableState.Never)]
121         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
122         {
123             Interop.TypeInfo.DeleteTypeInfo(swigCPtr);
124         }
125     }
126 }