Merge "atspi: disable atspi using environment variable" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / common / configuration-manager.h
1 #ifndef DALI_INTERNAL_ENVIRONMENT_CONFIGURATION_MANAGER_H
2 #define DALI_INTERNAL_ENVIRONMENT_CONFIGURATION_MANAGER_H
3
4 /*
5  * Copyright (c) 2021 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 <memory>
23 #include <string>
24
25 namespace Dali
26 {
27 class FileStream;
28
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33 class GraphicsInterface;
34 class ThreadController;
35
36 /**
37  * This class retrieves and caches the system configuration.
38  * Some of the methods in this class can block system until GL has been initialized,
39  * only at the first time the DALi application is launched in the system.
40  */
41 class ConfigurationManager
42 {
43 public:
44   /**
45    * @brief Constructor
46    */
47   ConfigurationManager(std::string systemCachePath, GraphicsInterface* graphics, ThreadController* threadController);
48
49   /**
50    * @brief Virtual Destructor for interface cleanup
51    */
52   virtual ~ConfigurationManager();
53
54   /**
55    * @brief Retrieve all keys from the config file if the file exists.
56    */
57   void RetrieveKeysFromConfigFile(const std::string& configFilePath);
58
59   /**
60    * @brief Get the maximum texture size.
61    * @return The maximum texture size
62    */
63   uint32_t GetMaxTextureSize();
64
65   /**
66    * @brief Get the shader language version that the system supports
67    * @return the shader language version.
68    */
69   uint32_t GetShadingLanguageVersion();
70
71   /**
72    * @brief Check whether multiple window is supported
73    * @return Whether multiple window is supported
74    */
75   bool IsMultipleWindowSupported();
76
77   /**
78    * @brief Check whether blend equation advanced (extension) is supported
79    * @return Whether blend equation advanced (extension is supported
80    */
81   bool IsAdvancedBlendEquationSupported();
82
83   // Deleted copy constructor.
84   ConfigurationManager(const ConfigurationManager&) = delete;
85
86   // Deleted move constructor.
87   ConfigurationManager(const ConfigurationManager&&) = delete;
88
89   // Deleted assignment operator.
90   ConfigurationManager& operator=(const ConfigurationManager&) = delete;
91
92   // Deleted move assignment operator.
93   ConfigurationManager& operator=(const ConfigurationManager&&) = delete;
94
95 private:                                                          // Data
96   std::string        mSystemCacheFilePath;                        ///< The path of system cache file
97   GraphicsInterface* mGraphics;                                   ///< Graphics interface
98   ThreadController*  mThreadController;                           ///< The thread controller
99   unsigned int       mMaxTextureSize;                             ///< The largest texture that the GL can handle
100   unsigned int       mShaderLanguageVersion;                      ///< The shader language version that the system supports.
101   bool               mIsMultipleWindowSupported : 1;              ///< Whether multiple window is supported by the GLES
102   bool               mIsAdvancedBlendEquationSupported : 1;       ///< Whether blend equation advanced (extension) is supported by the GLES
103   bool               mMaxTextureSizeCached : 1;                   ///< Whether we have checked the maximum texture size
104   bool               mIsMultipleWindowSupportedCached : 1;        ///< Whether we have checked the support of multiple window
105   bool               mIsAdvancedBlendEquationSupportedCached : 1; ///< Whether we have checked the support of blend equation advanced (extension)
106   bool               mShaderLanguageVersionCached : 1;            ///< Whether we have checked the shader language version
107 };
108
109 } // namespace Adaptor
110 } // namespace Internal
111 } // namespace Dali
112
113 #endif // DALI_INTERNAL_ENVIRONMENT_CONFIGURATION_MANAGER_H