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;
22 /// The TypeRegistry allows registration of type instance creation functions.
23 /// These can then be created later by name and down cast to the appropriate type.
25 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
26 [EditorBrowsable(EditorBrowsableState.Never)]
27 public class TypeRegistry : BaseHandle
30 internal TypeRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
34 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeRegistry obj)
36 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
39 /// This will not be public opened.
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
43 Interop.TypeRegistry.DeleteTypeRegistry(swigCPtr);
47 /// Gets Type Registry handle.
49 /// <returns>TypeRegistry handle.</returns>
50 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public static TypeRegistry Get()
54 TypeRegistry ret = new TypeRegistry(Interop.TypeRegistry.Get(), true);
55 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60 /// Allows the creation of an empty typeRegistry handle.
62 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
63 [EditorBrowsable(EditorBrowsableState.Never)]
64 public TypeRegistry() : this(Interop.TypeRegistry.NewTypeRegistry(), true)
66 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 internal TypeRegistry(TypeRegistry handle) : this(Interop.TypeRegistry.NewTypeRegistry(TypeRegistry.getCPtr(handle)), true)
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 internal TypeRegistry Assign(TypeRegistry rhs)
76 TypeRegistry ret = new TypeRegistry(Interop.TypeRegistry.Assign(SwigCPtr, TypeRegistry.getCPtr(rhs)), false);
77 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 /// Gets TypeInfo for a registered type.
84 /// <param name="uniqueTypeName">A unique type name.</param>
85 /// <returns>TypeInfo if the type exists, otherwise an empty handle.</returns>
86 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 public Tizen.NUI.TypeInfo GetTypeInfo(string uniqueTypeName)
90 Tizen.NUI.TypeInfo ret = new Tizen.NUI.TypeInfo(Interop.TypeRegistry.GetTypeInfo(SwigCPtr, uniqueTypeName), true);
91 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 internal Tizen.NUI.TypeInfo GetTypeInfo(SWIGTYPE_p_std__type_info registerType)
97 Tizen.NUI.TypeInfo ret = new Tizen.NUI.TypeInfo(Interop.TypeRegistry.GetTypeInfo(SwigCPtr, SWIGTYPE_p_std__type_info.getCPtr(registerType)), true);
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103 /// Gets type name count.
105 /// <returns>The count.</returns>
106 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public uint GetTypeNameCount()
110 uint ret = Interop.TypeRegistry.GetTypeNameCount(SwigCPtr);
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 /// Gets type names by index.
118 /// <param name="index">The index to get the type name.</param>
119 /// <returns>The type name or an empty string when index is not valid.</returns>
120 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public string GetTypeName(uint index)
124 string ret = Interop.TypeRegistry.GetTypeName(SwigCPtr, index);
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();