5648dca05ff25742606da505a26abdb468d1834b
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / adaptor-internal-services.h
1 #ifndef DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H
2 #define DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_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 // EXTERNAL INCLUDES
22 #include <dali/integration-api/core.h>
23 #include <dali/integration-api/gl-abstraction.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/integration-api/render-surface.h>
27 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
28 #include <dali/integration-api/adaptor-framework/trigger-event-factory-interface.h>
29 #include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
30 #include <dali/internal/graphics/common/graphics-interface.h>
31 #include <dali/internal/graphics/gles/egl-factory-interface.h>
32 #include <dali/internal/network/common/socket-factory-interface.h>
33 #include <dali/internal/network/common/trace-interface.h>
34 #include <dali/internal/system/common/performance-interface.h>
35 #include <dali/internal/window-system/common/display-connection.h>
36
37 namespace Dali
38 {
39
40 namespace Internal
41 {
42
43 namespace Adaptor
44 {
45
46 /**
47  * A class to contain various interfaces provided by the adaptor which
48  * can be used by the cross platform parts of adaptor.
49  * E.g. any files held in adaptors/base/ directory
50  *
51  */
52 class AdaptorInternalServices
53 {
54
55 public:
56
57   /**
58    * @return core
59    */
60   virtual Dali::Integration::Core& GetCore() = 0;
61
62   /**
63    * @return platform abstraction
64    */
65   virtual Dali::Integration::PlatformAbstraction& GetPlatformAbstractionInterface() = 0;
66
67   /**
68    * Used to access the Display Connection interface from the Render thread
69    * @return the Display Connection interface
70    */
71   virtual Dali::DisplayConnection& GetDisplayConnectionInterface() = 0;
72
73   /**
74    * Used to access the abstracted graphics interface
75    * This also contains the depth and stencil buffers
76    * @return the graphics interface
77    */
78   virtual GraphicsInterface& GetGraphicsInterface() = 0;
79
80   /**
81    * Used by update-thread to notify core (main-thread) it has messages to process
82    * @return trigger event ProcessCoreEvents
83    */
84   virtual TriggerEventInterface& GetProcessCoreEventsTrigger() = 0;
85
86   /**
87    * @return trigger event factory interface
88    */
89   virtual TriggerEventFactoryInterface& GetTriggerEventFactoryInterface() = 0;
90
91   /**
92    * @return socket factory interface
93    */
94   virtual SocketFactoryInterface& GetSocketFactoryInterface() = 0;
95
96   /**
97    * @return render surface
98    */
99   virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0;
100
101   /**
102    * @return performance interface
103    */
104   virtual PerformanceInterface* GetPerformanceInterface() = 0;
105
106   /**
107    * @return interface for logging to the kernel ( e.g. using ftrace )
108    */
109   virtual TraceInterface& GetKernelTraceInterface() = 0;
110
111   /**
112    * @return system trace interface, e.g. for using Tizen Trace (ttrace) or Android Trace (atrace)
113    */
114   virtual TraceInterface& GetSystemTraceInterface() = 0;
115
116
117 protected:
118
119   /**
120    * constructor
121    */
122   AdaptorInternalServices()
123   {
124   };
125
126   /**
127    * virtual destructor
128    */
129   virtual ~AdaptorInternalServices()
130   {
131   };
132
133   // Undefined copy constructor.
134   AdaptorInternalServices( const AdaptorInternalServices& ) = delete;
135
136   // Undefined assignment operator.
137   AdaptorInternalServices& operator=( const AdaptorInternalServices& ) = delete;
138 };
139
140 } // namespace Internal
141
142 } // namespace Adaptor
143
144 } // namespace Dali
145
146 #endif // DALI_INTERNAL_ADAPTOR_INTERNAL_SERVICES_H