Removed Setters from EnvironmentOptions & added WindowClassName as an environment...
[platform/core/uifw/dali-adaptor.git] / adaptors / base / environment-options.h
1 #ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
2 #define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
3
4 /*
5  * Copyright (c) 2015 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/debug.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace Adaptor
29 {
30
31 /**
32  * This class provides the environment options which define settings as well as
33  * the ability to install a log function.
34  *
35  */
36 class EnvironmentOptions
37 {
38
39 public:
40
41   /**
42    * Constructor
43    */
44   EnvironmentOptions();
45
46   /**
47    * non-virtual destructor, not intended as a base class
48    */
49   ~EnvironmentOptions();
50
51   /**
52    * @param logFunction logging function
53    */
54   void SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction );
55
56   /**
57    * Install the log function for the current thread.
58    */
59   void InstallLogFunction() const;
60
61   /**
62    * Un-install the log function for the current thread.
63    */
64   void UnInstallLogFunction() const;
65
66   /**
67    * @return whether network control is enabled or not ( 0 = off, 1 = on )
68    */
69   unsigned int GetNetworkControlMode() const;
70
71   /**
72    * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
73    */
74   unsigned int GetFrameRateLoggingFrequency() const;
75
76   /**
77    * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
78    */
79   unsigned int GetUpdateStatusLoggingFrequency() const;
80
81   /**
82    * @return performance statistics log level ( 0 == off )
83    */
84   unsigned int GetPerformanceStatsLoggingOptions() const;
85
86   /**
87    * @return performance statistics log frequency in seconds
88    */
89   unsigned int GetPerformanceStatsLoggingFrequency() const;
90
91   /**
92    * @return performance time stamp output ( 0 == off)
93    */
94   unsigned int GetPerformanceTimeStampOutput() const;
95
96   /**
97    * @return pan-gesture logging level ( 0 == off )
98    */
99   unsigned int GetPanGestureLoggingLevel() const;
100
101   /**
102    * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
103    */
104   int GetPanGesturePredictionMode() const;
105
106   /**
107    * @return pan-gesture prediction amount
108    */
109   int GetPanGesturePredictionAmount() const;
110
111   /**
112    * @return maximum pan-gesture prediction amount
113    */
114   int GetPanGestureMaximumPredictionAmount() const;
115
116   /**
117    * @return minimum pan-gesture prediction amount
118    */
119   int GetPanGestureMinimumPredictionAmount() const;
120
121   /**
122    * @brief Gets the prediction amount to adjust when the pan velocity is changed.
123    *
124    * If the pan velocity is accelerating, the prediction amount will be increased
125    * by the specified amount until it reaches the upper bound. If the pan velocity
126    * is decelerating, the prediction amount will be decreased by the specified
127    * amount until it reaches the lower bound.
128    *
129    * @return pan-gesture prediction amount adjustment
130    */
131   int GetPanGesturePredictionAmountAdjustment() const;
132
133   /**
134    * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
135    */
136   int GetPanGestureSmoothingMode() const;
137
138   /**
139    * @return pan-gesture smoothing amount
140    */
141   float GetPanGestureSmoothingAmount() const;
142
143   /**
144    * @return The minimum distance before a pan can be started (-1 means it's not set)
145    */
146   int GetMinimumPanDistance() const;
147
148   /**
149    * @return The minimum events before a pan can be started (-1 means it's not set)
150    */
151   int GetMinimumPanEvents() const;
152
153   /**
154    * @return The width of the window
155    */
156   unsigned int GetWindowWidth() const;
157
158   /**
159    * @return The height of the window
160    */
161   unsigned int GetWindowHeight() const;
162
163   /**
164    * @brief Get the graphics status time
165    */
166   int GetGlesCallTime() const;
167
168   /**
169    * @return true if performance server is required
170    */
171   bool PerformanceServerRequired() const;
172
173   /**
174    * @return Gets the window name.
175    */
176   const std::string& GetWindowName() const;
177
178   /**
179    * @return Gets the window class.
180    */
181   const std::string& GetWindowClassName() const;
182
183 private: // Internal
184
185   /**
186    * Parses the environment options.
187    * Called from the constructor
188    */
189   void ParseEnvironmentOptions();
190
191 private: // Data
192
193   std::string mWindowName;                        ///< name of the window
194   std::string mWindowClassName;                   ///< name of the class the window belongs to
195   unsigned int mNetworkControl;                   ///< whether network control is enabled
196   unsigned int mFpsFrequency;                     ///< how often fps is logged out in seconds
197   unsigned int mUpdateStatusFrequency;            ///< how often update status is logged out in frames
198   unsigned int mPerformanceStatsLevel;            ///< performance statistics logging bitmask
199   unsigned int mPerformanceStatsFrequency;        ///< performance statistics logging frequency (seconds)
200   unsigned int mPerformanceTimeStampOutput;       ///< performance time stamp output ( bitmask)
201   unsigned int mPanGestureLoggingLevel;           ///< pan-gesture log level
202   int mPanGesturePredictionMode;                  ///< prediction mode for pan gestures
203   int mPanGesturePredictionAmount;                ///< prediction amount for pan gestures
204   int mPanGestureMaxPredictionAmount;             ///< maximum prediction amount for pan gestures
205   int mPanGestureMinPredictionAmount;             ///< minimum prediction amount for pan gestures
206   int mPanGesturePredictionAmountAdjustment;      ///< adjustment of prediction amount for pan gestures
207   int mPanGestureSmoothingMode;                   ///< prediction mode for pan gestures
208   float mPanGestureSmoothingAmount;               ///< prediction amount for pan gestures
209   int mPanMinimumDistance;                        ///< minimum distance required before pan starts
210   int mPanMinimumEvents;                          ///< minimum events required before pan starts
211   int mGlesCallTime;                              ///< time in seconds between status updates
212   unsigned int mWindowWidth;                      ///< width of the window
213   unsigned int mWindowHeight;                     ///< height of the window
214
215   Dali::Integration::Log::LogFunction mLogFunction;
216
217   // Undefined copy constructor.
218   EnvironmentOptions( const EnvironmentOptions& );
219
220   // Undefined assignment operator.
221   EnvironmentOptions& operator=( const EnvironmentOptions& );
222
223 };
224
225 } // Adaptor
226 } // Internal
227 } // Dali
228
229 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__