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