ControlRenderer & RendererFactory for Toolkit Controls
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / renderer-factory / renderer-factory.h
1 #ifndef __DALI_TOOLKIT_RENDERER_FACTORY_H__
2 #define __DALI_TOOLKIT_RENDERER_FACTORY_H__
3 /*
4  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 // EXTERNAL INCLUDES
21 #include <dali/public-api/object/base-handle.h>
22
23 // INTERNAK INCLUDES
24 #include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 class RendererFactory;
35 }
36
37 /**
38  * RendererFactory is a singleton object that provides and shares renderers for controls
39  *
40  * The renderer type is required in the property map for requesting a control renderer.
41  *
42  * | %Property Name            | Type             |
43  * |---------------------------|------------------|
44  * | renderer-type             | STRING           |
45  */
46 class DALI_IMPORT_API RendererFactory : public BaseHandle
47 {
48 public:
49
50   /**
51    * @brief Create or retrieve RendererFactory singleton.
52    *
53    * @return A handle to the RendererFactory control.
54    */
55   static RendererFactory Get();
56
57   /**
58    * @brief Create a RendererFactory handle.
59    *
60    * Calling member functions with an uninitialised handle is not allowed.
61    */
62   RendererFactory();
63
64   /**
65    * @brief Destructor
66    *
67    * This is non-virtual since derived Handle types must not contain data or virtual methods.
68    */
69   ~RendererFactory();
70
71   /**
72    * @brief This copy constructor is required for (smart) pointer semantics.
73    *
74    * @param[in] handle A reference to the copied handle.
75    */
76   RendererFactory( const RendererFactory& handle );
77
78   /**
79    * @brief This assignment operator is required for (smart) pointer semantics.
80    *
81    * @param [in] handle  A reference to the copied handle.
82    * @return A reference to this.
83    */
84   RendererFactory& operator=( const RendererFactory& handle );
85
86   /**
87    * Request the control renderer
88    * @param[in] propertyMap The map contains the properties required by the control renderer
89    *            Depends on the content of the map, different kind of renderer would be returned.
90    * @return the  pointer pointing to control renderer
91    */
92   ControlRenderer GetControlRenderer( const Property::Map& propertyMap  );
93
94 private:
95
96   explicit DALI_INTERNAL RendererFactory(Internal::RendererFactory *impl);
97
98 };
99
100 } // namespace Toolkit
101
102 } // namespace Dali
103
104 #endif /* __DALI_TOOLKIT_RENDERER_FACTORY_H__ */