63c2f34e394860ee972401aa04bf9eeb09ae3cfb
[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) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include <dali/integration-api/debug.h>
21
22 namespace Dali
23 {
24 namespace Internal
25 {
26 namespace Adaptor
27 {
28
29 /**
30  * Contains environment options which define settings and the ability to install a log function.
31  */
32 class EnvironmentOptions
33 {
34
35 public:
36
37   /**
38    * Constructor
39    */
40   EnvironmentOptions();
41
42   /**
43    * non-virtual destructor, not intended as a base class
44    */
45   ~EnvironmentOptions();
46
47   /**
48    * @param logFunction logging function
49    * @param logFilterOptions bitmask of the logging options defined in intergration/debug.h (e.g.
50    * @param logFrameRateFrequency frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
51    * @param logupdateStatusFrequency frequency of how often the update status is logged in number of frames
52    * @param logPerformanceLevel performance logging, 0 = disabled,  1+ =  enabled
53    * @param logPanGestureLevel pan-gesture logging, 0 = disabled,  1 = enabled
54    */
55   void SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
56                        unsigned int logFrameRateFrequency,
57                        unsigned int logupdateStatusFrequency,
58                        unsigned int logPerformanceLevel,
59                        unsigned int logPanGestureLevel );
60
61   /**
62    * Install the log function for the current thread.
63    */
64   void InstallLogFunction() const;
65
66   /**
67    * Un-install the log function for the current thread.
68    */
69   void UnInstallLogFunction() 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 logPerformanceLevel performance log level ( 0 = off )
83    */
84   unsigned int GetPerformanceLoggingLevel() const;
85
86   /**
87    * @return pan-gesture logging level ( 0 == off )
88    */
89   unsigned int GetPanGestureLoggingLevel() const;
90
91   /**
92    * @return pan-gesture smoothing mode ( 0 == no smoothing )
93    */
94   unsigned int GetPanGestureSmoothingMode() const;
95
96   /**
97    * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
98    *
99    * @param[in] mode The smoothing mode to use
100    */
101   void SetPanGesturePredictionMode(unsigned int mode) { mPanGesturePredictionMode = mode; }
102
103 private:
104
105   unsigned int mFpsFrequency;                     ///< how often fps is logged out in seconds
106   unsigned int mUpdateStatusFrequency;            ///< how often update status is logged out in frames
107   unsigned int mPerformanceLoggingLevel;          ///< performance log level
108   unsigned int mPanGestureLoggingLevel;           ///< pan-gesture log level
109   unsigned int mPanGesturePredictionMode;         ///< prediction mode for pan gestures
110
111   Dali::Integration::Log::LogFunction mLogFunction;
112
113   // Undefined copy constructor.
114   EnvironmentOptions( const EnvironmentOptions& );
115
116   // Undefined assignment operator.
117   EnvironmentOptions& operator=( const EnvironmentOptions& );
118
119 };
120
121 } // Adaptor
122 } // Internal
123 } // Dali
124
125 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__