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