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
29 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31 internal TypeRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TypeRegistry_SWIGUpcast(cPtr), cMemoryOwn)
33 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
36 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeRegistry obj)
38 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 protected override void Dispose(DisposeTypes type)
51 if (type == DisposeTypes.Explicit)
54 //Release your own managed resources here.
55 //You should release all of your own disposable objects here.
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.
63 if (swigCPtr.Handle != global::System.IntPtr.Zero)
68 NDalicPINVOKE.delete_TypeRegistry(swigCPtr);
70 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77 /// Gets Type Registry handle.
79 /// <returns>TypeRegistry handle.</returns>
80 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 public static TypeRegistry Get()
84 TypeRegistry ret = new TypeRegistry(NDalicPINVOKE.TypeRegistry_Get(), true);
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90 /// Allows the creation of an empty typeRegistry handle.
92 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public TypeRegistry() : this(NDalicPINVOKE.new_TypeRegistry__SWIG_0(), true)
96 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 internal TypeRegistry(TypeRegistry handle) : this(NDalicPINVOKE.new_TypeRegistry__SWIG_1(TypeRegistry.getCPtr(handle)), true)
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 internal TypeRegistry Assign(TypeRegistry rhs)
106 TypeRegistry ret = new TypeRegistry(NDalicPINVOKE.TypeRegistry_Assign(swigCPtr, TypeRegistry.getCPtr(rhs)), false);
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 /// Gets TypeInfo for a registered type.
114 /// <param name="uniqueTypeName">A unique type name.</param>
115 /// <returns>TypeInfo if the type exists, otherwise an empty handle.</returns>
116 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
117 [EditorBrowsable(EditorBrowsableState.Never)]
118 public Tizen.NUI.TypeInfo GetTypeInfo(string uniqueTypeName)
120 Tizen.NUI.TypeInfo ret = new Tizen.NUI.TypeInfo(NDalicPINVOKE.TypeRegistry_GetTypeInfo__SWIG_0(swigCPtr, uniqueTypeName), true);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 internal Tizen.NUI.TypeInfo GetTypeInfo(SWIGTYPE_p_std__type_info registerType)
127 Tizen.NUI.TypeInfo ret = new Tizen.NUI.TypeInfo(NDalicPINVOKE.TypeRegistry_GetTypeInfo__SWIG_1(swigCPtr, SWIGTYPE_p_std__type_info.getCPtr(registerType)), true);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 /// Gets type name count.
135 /// <returns>The counte.</returns>
136 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
137 [EditorBrowsable(EditorBrowsableState.Never)]
138 public uint GetTypeNameCount()
140 uint ret = NDalicPINVOKE.TypeRegistry_GetTypeNameCount(swigCPtr);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 /// Gets type names by index.
148 /// <param name="index">The index to get the type name.</param>
149 /// <returns>The type name or an empty string when index is not valid.</returns>
150 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
151 [EditorBrowsable(EditorBrowsableState.Never)]
152 public string GetTypeName(uint index)
154 string ret = NDalicPINVOKE.TypeRegistry_GetTypeName(swigCPtr, index);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();