Merge "Notify multiline hint to IMF context" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-factory-impl.h
1 #ifndef DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H
2 #define DALI_TOOLKIT_VISUAL_FACTORY_IMPL_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 // EXTERNAL INCLUDES
21 #include <dali/public-api/object/base-object.h>
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
25 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal
34 {
35
36 class VisualFactoryCache;
37 typedef IntrusivePtr<VisualFactoryCache> VisualFactoryCachePtr;
38
39 /**
40  * @copydoc Toolkit::VisualFactory
41  */
42 class VisualFactory : public BaseObject
43 {
44 public:
45
46   /**
47    * @brief Constructor
48    *
49    * @param[in] debugEnabled If true, use debug renderer to replace all the concrete renderer.
50    */
51   VisualFactory( bool debugEnabled );
52
53   /**
54    * @copydoc Toolkit::RenderFactory::CreateVisual( const Property::Map& )
55    */
56   Toolkit::Visual::Base CreateVisual( const Property::Map& propertyMap );
57
58   /**
59    * @copydoc Toolkit::RenderFactory::CreateVisual( const Image& )
60    */
61   Toolkit::Visual::Base CreateVisual( const Image& image );
62
63   /**
64    * @copydoc Toolkit::RenderFactory::CreateVisual( const std::string&, ImageDimensions )
65    */
66   Toolkit::Visual::Base CreateVisual( const std::string& image, ImageDimensions size );
67
68
69 protected:
70
71   /**
72    * A reference counted object may only be deleted by calling Unreference()
73    */
74   virtual ~VisualFactory();
75
76 private:
77
78   /**
79    * Undefined copy constructor.
80    */
81   VisualFactory(const VisualFactory&);
82
83   /**
84    * Undefined assignment operator.
85    */
86   VisualFactory& operator=(const VisualFactory& rhs);
87
88 private:
89
90   VisualFactoryCachePtr   mFactoryCache;
91   bool                    mDebugEnabled;
92 };
93
94 } // namespace Internal
95
96 inline const Internal::VisualFactory& GetImplementation(const Toolkit::VisualFactory& factory)
97 {
98   DALI_ASSERT_ALWAYS( factory && "VisualFactory handle is empty" );
99
100   const BaseObject& handle = factory.GetBaseObject();
101
102   return static_cast<const Internal::VisualFactory&>(handle);
103 }
104
105 inline Internal::VisualFactory& GetImplementation(Toolkit::VisualFactory& factory)
106 {
107   DALI_ASSERT_ALWAYS( factory && "VisualFactory handle is empty" );
108
109   BaseObject& handle = factory.GetBaseObject();
110
111   return static_cast<Internal::VisualFactory&>(handle);
112 }
113
114 } // namespace Toolkit
115
116 } // namespace Dali
117
118 #endif /* DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H */