Blend Equation Advanced Supporting
[platform/core/uifw/dali-core.git] / dali / devel-api / object / csharp-type-registry.h
1 #ifndef DALI_CSHARP_TYPE_REGISTRY_H
2 #define DALI_CSHARP_TYPE_REGISTRY_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <typeinfo>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/object/csharp-type-info.h>
26 #include <dali/public-api/object/type-registry.h>
27
28 namespace Dali
29 {
30 /**
31  * Custom static functions for registering C# custom controls and properties
32  *
33  */
34 namespace CSharpTypeRegistry
35 {
36 /**
37  * @brief Constructor registers the type creation function for a named class or type.
38  *
39  * This allows types to be created dynamically from script. The name must be
40  * unique for successful registration.
41  * @param [in] name the name of the type to be registered
42  * @param [in] baseType the base type info of registerType
43  * @param [in] f registerType instance creation function
44  * @return true if the name could be registered.
45  */
46 DALI_CORE_API bool RegisterType(const std::string&             name,
47                                 const std::type_info&          baseType,
48                                 CSharpTypeInfo::CreateFunction f);
49
50 /**
51    * Register an event-thread only property with a type (used by C# Custom controls)
52    * @param [in] objectName name of the object used to register the type
53    * @param [in] name Property name
54    * @param [in] index Property index
55    * @param [in] type Property type
56    * @param [in] setFunc The function to set the property (Can be NULL).
57    * @param [in] getFunc The function to get the value of a property.
58    * @return true if the property could be registered.
59   */
60 DALI_CORE_API bool RegisterProperty(const std::string&                  objectName,
61                                     const std::string&                  name,
62                                     Property::Index                     index,
63                                     Property::Type                      type,
64                                     CSharpTypeInfo::SetPropertyFunction setFunc,
65                                     CSharpTypeInfo::GetPropertyFunction getFunc);
66 } // namespace CSharpTypeRegistry
67
68 } // namespace Dali
69
70 #endif // DALI_CSHARP_TYPE_REGISTRY_H