Merge "Add support for new accessibility actions" into devel/master
[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 object profiler status interval ( 0 == off )
83    */
84   unsigned int GetObjectProfilerInterval() const;
85
86   /**
87    * @return performance statistics log level ( 0 == off )
88    */
89   unsigned int GetPerformanceStatsLoggingOptions() const;
90
91   /**
92    * @return performance statistics log frequency in seconds
93    */
94   unsigned int GetPerformanceStatsLoggingFrequency() const;
95
96   /**
97    * @return performance time stamp output ( 0 == off)
98    */
99   unsigned int GetPerformanceTimeStampOutput() const;
100
101   /**
102    * @return pan-gesture logging level ( 0 == off )
103    */
104   unsigned int GetPanGestureLoggingLevel() const;
105
106   /**
107    * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
108    */
109   int GetPanGesturePredictionMode() const;
110
111   /**
112    * @return pan-gesture prediction amount
113    */
114   int GetPanGesturePredictionAmount() const;
115
116   /**
117    * @return maximum pan-gesture prediction amount
118    */
119   int GetPanGestureMaximumPredictionAmount() const;
120
121   /**
122    * @return minimum pan-gesture prediction amount
123    */
124   int GetPanGestureMinimumPredictionAmount() const;
125
126   /**
127    * @brief Gets the prediction amount to adjust when the pan velocity is changed.
128    *
129    * If the pan velocity is accelerating, the prediction amount will be increased
130    * by the specified amount until it reaches the upper bound. If the pan velocity
131    * is decelerating, the prediction amount will be decreased by the specified
132    * amount until it reaches the lower bound.
133    *
134    * @return pan-gesture prediction amount adjustment
135    */
136   int GetPanGesturePredictionAmountAdjustment() const;
137
138   /**
139    * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
140    */
141   int GetPanGestureSmoothingMode() const;
142
143   /**
144    * @return pan-gesture smoothing amount
145    */
146   float GetPanGestureSmoothingAmount() const;
147
148   /**
149    * @return The minimum distance before a pan can be started (-1 means it's not set)
150    */
151   int GetMinimumPanDistance() const;
152
153   /**
154    * @return The minimum events before a pan can be started (-1 means it's not set)
155    */
156   int GetMinimumPanEvents() const;
157
158   /**
159    * @return The width of the window
160    */
161   unsigned int GetWindowWidth() const;
162
163   /**
164    * @return The height of the window
165    */
166   unsigned int GetWindowHeight() const;
167
168   /**
169    * @brief Get the graphics status time
170    */
171   int GetGlesCallTime() const;
172
173   /**
174    * @return true if performance server is required
175    */
176   bool PerformanceServerRequired() const;
177
178   /**
179    * @return Gets the window name.
180    */
181   const std::string& GetWindowName() const;
182
183   /**
184    * @return Gets the window class.
185    */
186   const std::string& GetWindowClassName() const;
187
188 private: // Internal
189
190   /**
191    * Parses the environment options.
192    * Called from the constructor
193    */
194   void ParseEnvironmentOptions();
195
196 private: // Data
197
198   std::string mWindowName;                        ///< name of the window
199   std::string mWindowClassName;                   ///< name of the class the window belongs to
200   unsigned int mNetworkControl;                   ///< whether network control is enabled
201   unsigned int mFpsFrequency;                     ///< how often fps is logged out in seconds
202   unsigned int mUpdateStatusFrequency;            ///< how often update status is logged out in frames
203   unsigned int mObjectProfilerInterval;           ///< how often object counts are logged out in seconds
204   unsigned int mPerformanceStatsLevel;            ///< performance statistics logging bitmask
205   unsigned int mPerformanceStatsFrequency;        ///< performance statistics logging frequency (seconds)
206   unsigned int mPerformanceTimeStampOutput;       ///< performance time stamp output ( bitmask)
207   unsigned int mPanGestureLoggingLevel;           ///< pan-gesture log level
208   int mPanGesturePredictionMode;                  ///< prediction mode for pan gestures
209   int mPanGesturePredictionAmount;                ///< prediction amount for pan gestures
210   int mPanGestureMaxPredictionAmount;             ///< maximum prediction amount for pan gestures
211   int mPanGestureMinPredictionAmount;             ///< minimum prediction amount for pan gestures
212   int mPanGesturePredictionAmountAdjustment;      ///< adjustment of prediction amount for pan gestures
213   int mPanGestureSmoothingMode;                   ///< prediction mode for pan gestures
214   float mPanGestureSmoothingAmount;               ///< prediction amount for pan gestures
215   int mPanMinimumDistance;                        ///< minimum distance required before pan starts
216   int mPanMinimumEvents;                          ///< minimum events required before pan starts
217   int mGlesCallTime;                              ///< time in seconds between status updates
218   unsigned int mWindowWidth;                      ///< width of the window
219   unsigned int mWindowHeight;                     ///< height of the window
220
221   Dali::Integration::Log::LogFunction mLogFunction;
222
223   // Undefined copy constructor.
224   EnvironmentOptions( const EnvironmentOptions& );
225
226   // Undefined assignment operator.
227   EnvironmentOptions& operator=( const EnvironmentOptions& );
228
229 };
230
231 } // Adaptor
232 } // Internal
233 } // Dali
234
235 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__