2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
23 /// TypeInfo class for instantiation of registered types and introspection of their actions and signals.
25 /// <since_tizen> 3 </since_tizen>
26 public class TypeInfo : BaseHandle
30 /// Creates TypeInfo object.
32 /// <since_tizen> 3 </since_tizen>
33 public TypeInfo() : this(Interop.TypeInfo.NewTypeInfo(), true)
35 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
39 /// Creates TypeInfo object.
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)
45 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
48 internal TypeInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TypeInfo.Upcast(cPtr), cMemoryOwn)
53 /// Retrieves the type name for this type.
55 /// <returns>The string name.</returns>
56 /// <since_tizen> 3 </since_tizen>
57 public string GetName()
59 string ret = Interop.TypeInfo.GetName(swigCPtr);
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65 /// Retrieves the type name for this type.
67 /// <returns>The string name.</returns>
68 /// <since_tizen> 3 </since_tizen>
69 public string GetBaseName()
71 string ret = Interop.TypeInfo.GetBaseName(swigCPtr);
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 /// Creates an object from this type.
79 /// <returns>The BaseHandle for the newly created object.</returns>
80 /// <since_tizen> 3 </since_tizen>
81 public BaseHandle CreateInstance()
83 BaseHandle ret = new BaseHandle(Interop.TypeInfo.CreateInstance(swigCPtr), true);
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 /// Retrieves the number of event side type registered properties for this type.<br />
90 /// This count does not include all properties.
92 /// <returns>The count.</returns>
93 /// <since_tizen> 3 </since_tizen>
94 public uint GetPropertyCount()
96 uint ret = Interop.TypeInfo.GetPropertyCount(swigCPtr);
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 /// Given a property index, retrieve the property name associated with it.
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)
109 string ret = Interop.TypeInfo.GetPropertyName(swigCPtr, index);
110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeInfo obj)
116 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
119 /// This will not be public opened.
120 [EditorBrowsable(EditorBrowsableState.Never)]
121 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
123 Interop.TypeInfo.DeleteTypeInfo(swigCPtr);