Merge "Remove the actor from exclusive list in RenderTaskList when the actor is destr...
[platform/core/uifw/dali-core.git] / dali / public-api / render-tasks / render-task-list.h
1 #ifndef __DALI_RENDER_TASK_LIST_H__
2 #define __DALI_RENDER_TASK_LIST_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 // INTERNAL INCLUDES
22 #include <dali/public-api/object/base-handle.h>
23
24 namespace Dali
25 {
26 /**
27  * @addtogroup dali_core_render_tasks
28  * @{
29  */
30
31 class RenderTask;
32
33 namespace Internal DALI_INTERNAL
34 {
35 class RenderTaskList;
36 }
37
38 /**
39  * @brief An ordered list of Dali::RenderTask%s.
40  *
41  * These tasks describe how the Dali scene should be rendered; @see Dali::RenderTask for more details.
42  */
43 class DALI_IMPORT_API RenderTaskList : public BaseHandle
44 {
45 public:
46
47   /**
48    * @brief Create an empty RenderTaskList handle.
49    *
50    * This can be initialised with Stage::GetRenderTaskList().
51    */
52   RenderTaskList();
53
54   /**
55    * @brief Downcast a handle to RenderTaskList handle.
56    *
57    * If handle points to a RenderTaskList the downcast produces valid
58    * handle. If not the returned handle is left uninitialized.
59    *
60    * @param[in] handle A handle to an object.
61    * @return A handle to a RenderTaskList or an uninitialized handle.
62    */
63   static RenderTaskList DownCast( BaseHandle handle );
64
65   /**
66    * @brief Destructor
67    *
68    * This is non-virtual since derived Handle types must not contain data or virtual methods.
69    */
70   ~RenderTaskList();
71
72   /**
73    * @brief This copy constructor is required for (smart) pointer semantics.
74    *
75    * @param [in] handle A reference to the copied handle
76    */
77   RenderTaskList(const RenderTaskList& handle);
78
79   /**
80    * @brief This assignment operator is required for (smart) pointer semantics.
81    *
82    * @param [in] rhs  A reference to the copied handle
83    * @return A reference to this
84    */
85   RenderTaskList& operator=(const RenderTaskList& rhs);
86
87   /**
88    * @brief Create a new RenderTask.
89    *
90    * This will be appended to the list of render-tasks.
91    * @return A valid handle to a new RenderTask.
92    */
93   RenderTask CreateTask();
94
95   /**
96    * @brief Remove a RenderTask from the list of render-tasks.
97    * @param[in] task The render-task to remove.
98    */
99   void RemoveTask( RenderTask task );
100
101   /**
102    * @brief Query the number of render-tasks in the list.
103    *
104    * This is ordered i.e. the task with index 0 is the first to be processed each frame.
105    * @return The number of render-tasks.
106    */
107   unsigned int GetTaskCount() const;
108
109   /**
110    * @brief Retrieve a render-task.
111    *
112    * @pre index should be in range i.e. less than GetTaskCount().
113    * @param[in] index The index of the render task to retrieve
114    * @return A handle to the render-task.
115    */
116   RenderTask GetTask( unsigned int index ) const;
117
118 public: // Not intended for application developers
119
120   /**
121    * @brief This constructor is used by Dali New() methods
122    * @param [in] renderTask A pointer to a newly allocated render-task
123    */
124   explicit DALI_INTERNAL RenderTaskList( Internal::RenderTaskList* renderTask );
125 };
126
127 /**
128  * @}
129  */
130 } // namespace Dali
131
132 #endif //__DALI_RENDER_TASK_LIST_H__