(PanGesture) Two motions before pan & ability to set the min distance/events via...
[platform/core/uifw/dali-adaptor.git] / adaptors / base / environment-options.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include "environment-options.h"
20
21 namespace Dali
22 {
23
24 namespace Internal
25 {
26
27 namespace Adaptor
28 {
29
30 EnvironmentOptions::EnvironmentOptions()
31 : mFpsFrequency(0),
32   mUpdateStatusFrequency(0),
33   mPerformanceLoggingLevel(0),
34   mPanGestureLoggingLevel(0),
35   mPanGesturePredictionMode(-1),
36   mPanGesturePredictionAmount(-1.0f), ///< only sets value in pan gesture if greater than 0
37   mPanMinimumDistance(-1),
38   mPanMinimumEvents(-1),
39   mLogFunction( NULL )
40 {
41 }
42
43 EnvironmentOptions::~EnvironmentOptions()
44 {
45 }
46
47 void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
48                              unsigned int logFrameRateFrequency,
49                              unsigned int logupdateStatusFrequency,
50                              unsigned int logPerformanceLevel,
51                              unsigned int logPanGestureLevel )
52 {
53   mLogFunction = logFunction;
54   mFpsFrequency = logFrameRateFrequency;
55   mUpdateStatusFrequency = logupdateStatusFrequency;
56   mPerformanceLoggingLevel = logPerformanceLevel;
57   mPanGestureLoggingLevel = logPanGestureLevel;
58 }
59
60 void EnvironmentOptions::InstallLogFunction() const
61 {
62   Dali::Integration::Log::InstallLogFunction( mLogFunction );
63 }
64
65 void EnvironmentOptions::UnInstallLogFunction() const
66 {
67   Dali::Integration::Log::UninstallLogFunction();
68 }
69
70 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
71 {
72   return mFpsFrequency;
73 }
74
75 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
76 {
77   return mUpdateStatusFrequency;
78 }
79
80 unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
81 {
82   return mPerformanceLoggingLevel;
83 }
84
85 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
86 {
87   return mPanGestureLoggingLevel;
88 }
89
90 int EnvironmentOptions::GetPanGestureSmoothingMode() const
91 {
92   return mPanGesturePredictionMode;
93 }
94
95 float EnvironmentOptions::GetPanGesturePredictionAmount() const
96 {
97   return mPanGesturePredictionAmount;
98 }
99
100 int EnvironmentOptions::GetMinimumPanDistance() const
101 {
102   return mPanMinimumDistance;
103 }
104
105 int EnvironmentOptions::GetMinimumPanEvents() const
106 {
107   return mPanMinimumEvents;
108 }
109
110 void EnvironmentOptions::SetPanGesturePredictionMode(unsigned int mode)
111 {
112   mPanGesturePredictionMode = mode;
113 }
114
115 void EnvironmentOptions::SetPanGesturePredictionAmount(unsigned int amount)
116 {
117   mPanGesturePredictionAmount = amount;
118 }
119
120 void EnvironmentOptions::SetMinimumPanDistance( int distance )
121 {
122   mPanMinimumDistance = distance;
123 }
124
125 void EnvironmentOptions::SetMinimumPanEvents( int events )
126 {
127   mPanMinimumEvents = events;
128 }
129
130 } // Adaptor
131
132 } // Internal
133
134 } // Dali