Merge "Revert public API changes. BATCH property." into devel/master
[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) 2016 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
22 // EXTERNAL INCLUDES
23 #include <typeinfo>
24
25
26 // INTERNAL INCLUDES
27 #include <dali/public-api/object/type-registry.h>
28 #include <dali/devel-api/object/csharp-type-info.h>
29
30 namespace Dali
31 {
32
33
34 /**
35  * Custom static functions for registering C# custom controls and properties
36  *
37  */
38 namespace CSharpTypeRegistry
39 {
40
41 /**
42  * @brief Constructor registers the type creation function for a named class or type.
43  *
44  * This allows types to be created dynamically from script. The name must be
45  * unique for successful registration.
46  * @param [in] name the name of the type to be registered
47  * @param [in] baseType the base type info of registerType
48  * @param [in] f registerType instance creation function
49  * @param [in] callCreateOnInit If true the creation function is called as part of Dali initialisation
50  * @return true if the name could be registered.
51  */
52   DALI_IMPORT_API bool RegisterType( const std::string& name,
53                                      const std::type_info& baseType,
54                                      CSharpTypeInfo::CreateFunction f,
55                                      bool callCreateOnInit );
56
57   /**
58    * Register an event-thread only property with a type (used by C# Custom controls)
59    * @param [in] objectName name of the object used to register the type
60    * @param [in] name Property name
61    * @param [in] index Property index
62    * @param [in] type Property type
63    * @param [in] setFunc The function to set the property (Can be NULL).
64    * @param [in] getFunc The function to get the value of a property.
65    * @return true if the property could be registered.
66   */
67   DALI_IMPORT_API bool RegisterProperty( const std::string& objectName,
68                                          const std::string& name,
69                                          Property::Index index,
70                                          Property::Type type,
71                                          CSharpTypeInfo::SetPropertyFunction setFunc,
72                                          CSharpTypeInfo::GetPropertyFunction getFunc );
73 }
74
75 } // namespace Dali
76
77 #endif // header