[dali_1.4.36] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-adaptor-impl.h
1 #ifndef DALI_TOOLKIT_ADAPTOR_IMPL_H
2 #define DALI_TOOLKIT_ADAPTOR_IMPL_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/integration-api/adaptors/render-surface-interface.h>
22
23 namespace Dali
24 {
25 class EglInterface;
26 class DisplayConnection;
27 class ThreadSynchronizationInterface;
28 class Window;
29
30 namespace Integration
31 {
32 class Scene;
33 }
34
35 using WindowContainer = std::vector<Window>;
36
37 namespace Internal
38 {
39
40 namespace Adaptor
41 {
42
43 class GraphicsInterface;
44 class SceneHolder;
45
46 } // namespace Adaptor
47
48 } // namespace Internal
49
50 namespace Integration
51 {
52
53 class GlAbstraction;
54
55 } // namespace Integration
56
57 namespace Internal
58 {
59 namespace Adaptor
60 {
61
62 class Adaptor
63 {
64 public:
65   static Dali::Adaptor& New();
66   static Dali::Adaptor& Get();
67   Adaptor();
68   ~Adaptor();
69
70   void Start( Dali::Window window );
71
72   bool AddIdle( CallbackBase* callback, bool hasReturnValue );
73   void RemoveIdle( CallbackBase* callback );
74   void RunIdles();
75
76   static Integration::Scene GetScene( Dali::Window window );
77
78   Dali::RenderSurfaceInterface& GetSurface();
79   Dali::WindowContainer GetWindows();
80   Dali::SceneHolderList GetSceneHolders();
81
82   Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
83   void AddWindow( Internal::Adaptor::SceneHolder* window );
84   void RemoveWindow( Internal::Adaptor::SceneHolder* window );
85
86   Dali::Adaptor::AdaptorSignalType& ResizedSignal();
87   Dali::Adaptor::AdaptorSignalType& LanguageChangedSignal();
88   Dali::Adaptor::WindowCreatedSignalType& WindowCreatedSignal();
89
90   static Adaptor& GetImpl( Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
91   static const Adaptor& GetImpl( const Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
92
93 private:
94
95   Vector<CallbackBase*> mCallbacks;
96   std::vector<Internal::Adaptor::SceneHolder*> mWindows;
97   Dali::Adaptor::AdaptorSignalType mResizedSignal;
98   Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal;
99   Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal;
100 };
101
102 } // namespace Adaptor
103 } // namespace Internal
104 } // namespace Dali
105
106 #endif // DALI_TOOLKIT_ADAPTOR_IMPL_H