44af828c870de593438c729e9183112786b8d938
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / renderer-factory-impl.h
1 #ifndef __DALI_TOOLKIT_RENDERER_FACTORY_IMPL_H__
2 #define __DALI_TOOLKIT_RENDERER_FACTORY_IMPL_H__
3
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
21 #include <dali/public-api/object/base-object.h>
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
25 #include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal
34 {
35
36 class RendererFactoryCache;
37 typedef IntrusivePtr<RendererFactoryCache> RendererFactoryCachePtr;
38
39 /**
40  * @copydoc Toolkit::RendererFactory
41  */
42 class RendererFactory : public BaseObject
43 {
44
45 public:
46
47   /**
48    * @brief Constructor
49    */
50   RendererFactory();
51
52   /**
53    * @copydoc Toolkit::RenderFactory::GetControlRenderer
54    */
55   Toolkit::ControlRenderer GetControlRenderer( const Property::Map& propertyMap  );
56
57 protected:
58
59   /**
60    * A reference counted object may only be deleted by calling Unreference()
61    */
62   virtual ~RendererFactory();
63
64 private:
65
66   /**
67    * Undefined copy constructor.
68    */
69   RendererFactory(const RendererFactory&);
70
71   /**
72    * Undefined assignment operator.
73    */
74   RendererFactory& operator=(const RendererFactory& rhs);
75
76 private:
77
78   RendererFactoryCachePtr mFactoryCache;
79 };
80
81 } // namespace Internal
82
83 inline const Internal::RendererFactory& GetImplementation(const Toolkit::RendererFactory& factory)
84 {
85   DALI_ASSERT_ALWAYS( factory && "RendererFactory handle is empty" );
86
87   const BaseObject& handle = factory.GetBaseObject();
88
89   return static_cast<const Internal::RendererFactory&>(handle);
90 }
91
92 inline Internal::RendererFactory& GetImplementation(Toolkit::RendererFactory& factory)
93 {
94   DALI_ASSERT_ALWAYS( factory && "RendererFactory handle is empty" );
95
96   BaseObject& handle = factory.GetBaseObject();
97
98   return static_cast<Internal::RendererFactory&>(handle);
99 }
100
101 } // namespace Toolkit
102
103 } // namespace Dali
104
105 #endif /* __DALI_TOOLKIT_RENDERER_FACTORY_IMPL_H__ */