Changed all property & signal names to lowerCamelCase
[platform/core/uifw/dali-core.git] / dali / devel-api / rendering / renderer.h
1 #ifndef DALI_RENDERER_H
2 #define DALI_RENDERER_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
21 // EXTERNAL INCLUDES
22 #include <string> // std::string
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/object/handle.h> // Dali::Handle
26 #include <dali/public-api/object/property-index-ranges.h> // DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX
27 #include <dali/devel-api/rendering/geometry.h> // Dali::Geometry
28 #include <dali/devel-api/rendering/material.h> // Dali::Material
29
30 namespace Dali
31 {
32
33 namespace Internal DALI_INTERNAL
34 {
35 class Renderer;
36 }
37
38 /**
39  * @brief Renderer is a handle to an object that can be used to provide an image to a material.
40  */
41 class DALI_IMPORT_API Renderer : public Handle
42 {
43 public:
44
45   /**
46    * @brief An enumeration of properties belonging to the Renderer class.
47    */
48   struct Property
49   {
50     enum
51     {
52       DEPTH_INDEX = DEFAULT_OBJECT_PROPERTY_START_INDEX,  ///< name "depthIndex",   type INTEGER
53     };
54   };
55
56   /**
57    * @brief Creates a new Renderer object
58    *
59    * @param[in] geometry Geometry to be used by this renderer
60    * @param[in] material Material to be used by this renderer
61    */
62   static Renderer New( Geometry& geometry, Material& material );
63
64   /**
65    * @brief Default constructor, creates an empty handle
66    */
67   Renderer();
68
69   /**
70    * @brief Destructor
71    */
72   ~Renderer();
73
74   /**
75    * @brief Copy constructor, creates a new handle to the same object
76    *
77    * @param[in] handle Handle to an object
78    */
79   Renderer( const Renderer& handle );
80
81   /**
82    * @brief Downcast to a renderer handle.
83    *
84    * If not a renderer the returned renderer handle is left uninitialized.
85    * @param[in] handle to an object
86    * @return renderer handle or an uninitialized handle
87    */
88   static Renderer DownCast( BaseHandle handle );
89
90   /**
91    * @brief Assignment operator, changes this handle to point at the same object
92    *
93    * @param[in] handle Handle to an object
94    * @return Reference to the assigned object
95    */
96   Renderer& operator=( const Renderer& handle );
97
98   /**
99    * @brief Sets the geometry to be used by this renderer
100    *
101    * @param[in] geometry The geometry to be used by this renderer
102    */
103   void SetGeometry( Geometry& geometry );
104
105   /**
106    * @brief Gets the geometry used by this renderer
107    *
108    * @return The geometry used by the renderer
109    */
110   Geometry GetGeometry() const;
111
112   /**
113    * @brief Sets the material to be used by this renderer
114    *
115    * @param[in] material The material to be used by this renderer
116    */
117   void SetMaterial( Material& material );
118
119   /**
120    * @brief Gets the material used by this renderer
121    *
122    * @return The material used by the renderer
123    */
124   Material GetMaterial() const;
125
126   /**
127    * @brief Set the depth index of this renderer
128    *
129    * Renderer with higher depth indices are rendered in front of other renderers with smaller values
130    *
131    * @param[in] depthIndex The depth index of this renderer
132    */
133   void SetDepthIndex( int depthIndex );
134
135   //@todo No interface to remove geometry / material? I guess you have to throw away
136   // this renderer if you don't want it to work any more...
137
138   /**
139    * @brief Get the depth index of this renderer
140    *
141    * @sa SetDepthIndex()
142    * @return the depth index
143    */
144   int GetDepthIndex();
145
146 public:
147   /**
148    * @brief The constructor
149    *
150    * @param [in] pointer A pointer to a newly allocated Renderer
151    */
152   explicit DALI_INTERNAL Renderer( Internal::Renderer* pointer );
153 };
154
155 } //namespace Dali
156
157 #endif // DALI_RENDERER_H