Merge "Add file stream API." into devel/master
[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) 2019 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 RenderSurfaceInterface;
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( Dali::RenderSurfaceInterface* surface ) = 0;
87
88   /**
89    * Deletes the surface.
90    * @param[in] surface The surface to be deleted
91    */
92   virtual void DeleteSurface( Dali::RenderSurfaceInterface* surface ) = 0;
93
94   /**
95    * Resize the surface.
96    */
97   virtual void ResizeSurface() = 0;
98
99   /**
100    * @copydoc Dali::Adaptor::SetRenderRefreshRate()
101    */
102   virtual void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) = 0;
103
104   /**
105    * @copydoc Dali::Adaptor::SetPreRenderCallback()
106    */
107   virtual void SetPreRenderCallback( CallbackBase* callback ) = 0;
108
109 protected:
110
111   /**
112    * Constructor
113    */
114   ThreadControllerInterface() { }
115
116 private:
117
118   // Undefined copy constructor.
119   ThreadControllerInterface( const ThreadControllerInterface& );
120
121   // Undefined assignment operator.
122   ThreadControllerInterface& operator=( const ThreadControllerInterface& );
123 };
124
125 } // namespace Adaptor
126
127 } // namespace Internal
128
129 } // namespace Dali
130
131 #endif // DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H