Support post render callback
[platform/core/uifw/pepper-dali.git] / pepper-dali / public-api / compositor / compositor.h
1 #ifndef __DALI_PEPPER_COMPOSITOR_H__
2 #define __DALI_PEPPER_COMPOSITOR_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
21 // INTERNAL INCLUDES
22 #include <pepper-dali/public-api/object-view/object-view.h>
23
24 // EXTERNAL INCLUDES
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/object/base-handle.h>
27 #include <dali/public-api/adaptor-framework/application.h>
28
29 namespace Dali
30 {
31
32 namespace Pepper
33 {
34
35 namespace Internal DALI_INTERNAL
36 {
37 class Compositor;
38 }
39
40 /**
41  * @addtogroup dali_pepper_compositor
42  * @{
43  */
44
45 /**
46  * @brief Compositor is the embedding compositor that serve surfaces of clients as DALi Actor
47  * and deliver input events to clients.
48  *
49  * ObjectView is added when the client surface is created and object view added signal is emitted.
50  *
51  * @since_tizen 3.0
52  */
53 class DALI_IMPORT_API Compositor : public BaseHandle
54 {
55 public:
56
57   /**
58    * @brief Create the embedding compositer.
59    *
60    * @since_tizen 3.0
61    * @param[in] application Application class for the embedding compositor
62    * @param[in] name Socket name
63    * @return A handle to Compositor.
64    */
65   static Compositor New( Application application, const std::string& name );
66
67   /**
68    * @brief Gets the name of the compositor.
69    *
70    * @since_tizen 3.0
71    * @return compositor name.
72    */
73   const std::string& GetName() const;
74
75   /**
76    * @brief Downcast a handle to Compositor handle.
77    *
78    * If the BaseHandle points is a Compositor the downcast returns a valid handle.
79    * If not the returned handle is left empty.
80    *
81    * @since_tizen 3.0
82    * @param[in] handle Handle to an object
83    * @return handle to a Compositor or an empty handle
84    */
85   static Compositor DownCast( BaseHandle handle );
86
87   /**
88    * @brief Creates an empty handle.
89    * @since_tizen 3.0
90    */
91   Compositor();
92
93   /**
94    * @brief Copy constructor.
95    *
96    * @since_tizen 3.0
97    * @param[in] handle The handle to copy from.
98    */
99   Compositor( const Compositor& handle );
100
101   /**
102    * @brief Assignment operator.
103    *
104    * @since_tizen 3.0
105    * @param[in] handle The handle to copy from.
106    * @return A reference to this.
107    */
108   Compositor& operator=( const Compositor& handle );
109
110   /**
111    * @brief Destructor
112    *
113    * This is non-virtual since derived Handle types must not contain data or virtual methods.
114    * @since_tizen 3.0
115    */
116   ~Compositor();
117
118 public: //Signals
119
120   typedef Signal< void ( Compositor, ObjectView ) > CompositorSignalType;   ///< Compositor signal type @since_tizen 3.0
121
122   /**
123    * @brief This signal is emitted when the client surface is created and ObjectView is added.
124    *
125    * @since_tizen 3.0
126    * @return The signal to connect to.
127    */
128   CompositorSignalType& ObjectViewAddedSignal();
129
130   /**
131    * @brief This signal is emitted when the client surface is deleted and ObjectView is deleted.
132    *
133    * @since_tizen 3.0
134    * @return The signal to connect to.
135    */
136   CompositorSignalType& ObjectViewDeletedSignal();
137
138 public: // Not intended for application developers
139
140   /**
141    * @brief Creates a handle using the Pepper::Internal implementation.
142    *
143    * @since_tizen 3.0
144    * @param[in] implementation The Compositor implementation.
145    */
146   explicit DALI_INTERNAL Compositor( Internal::Compositor* implementation );
147 };
148
149 /**
150  * @}
151  */
152 } // namespace Pepper
153
154 } // namespace Dali
155
156 #endif // __DALI_PEPPER_COMPOSITOR_H__