LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
dynamicssettings.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef DYNAMICSSETTINGS_H_
23 #define DYNAMICSSETTINGS_H_
24 
25 #include "Common.h"
26 
27 #include <glib.h>
28 #include <QEasingCurve>
29 #include <QtGlobal>
30 
31 namespace IconAnimationType
32 {
33  enum Enum
34  {
37  };
38 }
39 
41 {
42 public:
43 
45  QEasingCurve snapbackAnimCurve;
46 
51 
55 
58 
63 
65 
66  //TODO: TEMP: temporarily in place to avoid having to immediately implement and solve a bigger problem of determining, dynamically, the right amount
67  // to scroll vertically when an icon is being reordered and pulled to the top or bottom page border.
68  // This temp impl. will work as long as the row sizes are uniform (and the spacings between). It should be set to approx 1x row height + inter-row space
71 
73 
74  qreal iconInstallModeOpacity; //when the app is installing/updating/failed, this is the opacity of the main icon painted
75 
78 
80 
81 public:
83 
84  if (G_UNLIKELY(s_instance == 0))
85  new DynamicsSettings;
86 
87  return s_instance;
88  }
89 
91  return DiUiDynamics();
92  }
93 
94  static IconAnimationType::Enum animName2Type(const QString& name);
95  static QString animType2Name(IconAnimationType::Enum a);
96 
97 private:
98 
99  static DynamicsSettings* s_instance;
100 
101 private:
102 
104  ~DynamicsSettings();
105 
106  void readSettings(const char* filePath);
107  void verify();
108 
109 };
110 
111 // -------------------------------------------------------------------------------------------------------------
112 
113 #define AS_CURVE(x) (static_cast<QEasingCurve::Type>(AnimationSettings::instance()->x))
114 
115 #endif /* ANIMATIONSETTINGS_H */