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