Added pre-render callback to Adaptor
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / thread-controller-interface.h
1 #ifndef __DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H__
2 #define __DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H__
3
4 /*
5  * Copyright (c) 2018 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 #include <dali/public-api/signals/callback.h>
22
23 namespace Dali
24 {
25
26 class RenderSurface;
27
28 namespace Internal
29 {
30
31 namespace Adaptor
32 {
33
34 /**
35  * Interface Class for all controlling threads.
36  */
37 class ThreadControllerInterface
38 {
39 public:
40
41   /**
42    * Virtual destructor. Not intended as base class.
43    */
44   virtual ~ThreadControllerInterface() { }
45
46   /**
47    * Initializes the thread controller
48    */
49   virtual void Initialize() = 0;
50
51   /**
52    * @copydoc Dali::Adaptor::Start()
53    */
54   virtual void Start() = 0;
55
56   /**
57    * @copydoc Dali::Adaptor::Pause()
58    */
59   virtual void Pause() = 0;
60
61   /**
62    * @copydoc Dali::Adaptor::Resume()
63    */
64   virtual void Resume() = 0;
65
66   /**
67    * @copydoc Dali::Adaptor::Stop()
68    */
69   virtual void Stop() = 0;
70
71   /**
72    * Called by the adaptor when core requires another update
73    */
74   virtual void RequestUpdate() = 0;
75
76   /**
77    * Called by the adaptor when core requires one update
78    * If Adaptor is paused, we do one update and return to pause
79    */
80   virtual void RequestUpdateOnce() = 0;
81
82   /**
83    * Replaces the surface.
84    * @param surface new surface
85    */
86   virtual void ReplaceSurface( RenderSurface* surface ) = 0;
87
88   /**
89    * Resize the surface.
90    */
91   virtual void ResizeSurface() = 0;
92
93   /**
94    * @copydoc Dali::Adaptor::SetRenderRefreshRate()
95    */
96   virtual void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) = 0;
97
98   /**
99    * @copydoc Dali::Adaptor::SetPreRenderCallback()
100    */
101   virtual void SetPreRenderCallback( CallbackBase* callback ) = 0;
102
103 protected:
104
105   /**
106    * Constructor
107    */
108   ThreadControllerInterface() { }
109
110 private:
111
112   // Undefined copy constructor.
113   ThreadControllerInterface( const ThreadControllerInterface& );
114
115   // Undefined assignment operator.
116   ThreadControllerInterface& operator=( const ThreadControllerInterface& );
117 };
118
119 } // namespace Adaptor
120
121 } // namespace Internal
122
123 } // namespace Dali
124
125 #endif // __DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H__