luna-sysmgr-common
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Settings.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2008-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 __Settings_h__
23 #define __Settings_h__
24 
25 #include "Common.h"
26 
27 #include <string>
28 #include <vector>
29 #include <set>
30 #include <glib.h>
31 #include <QtGlobal>
32 #include <QVariant>
33 
34 class Settings
35 {
36 public:
37 
38  enum UiType {
39  UI_LUNA = 0,
41  };
42 
43  std::string lunaAppsPath; // default >> /var/luna/applications/
44  std::vector<std::string> lunaAppsPaths; // additional paths for applications...lunaAppsPath will be vector[0]
45  std::string pendingAppsPath; // default >> /var/palm/data/com.palm.appInstallService
46  std::string appInstallBase; //default >> /media/cryptofs/apps
47  std::string appInstallRelative; // default >> usr/palm/applications
48  std::string packageInstallBase; // default >> /media/cryptofs/apps // MUST BE EQUAL TO appInstallBase UNTIL FURTHER NOTICE!
49  std::string packageInstallRelative; //default >> usr/palm/packages
50  std::string serviceInstallBase; // default >> /media/cryptofs/apps
51  std::string serviceInstallRelative; //default >> usr/palm/services
52  std::string packageManifestsPath; //default >> /media/cryptofs/apps/usr/lib/ipkg/info
53  std::string downloadPathMedia; //default >> /media/internal/downloads
54  std::string appInstallerTmp; //default >> /media/internal/.tmp
55  std::string lunaPresetLaunchPointsPath; //default >> /usr/luna/launchpoints //for launchpoints that will never change (carrier cust stuff etc)
56  std::string lunaLaunchPointsPath; // default >> /var/luna/launchpoints/
57  std::string lunaSystemPath; // default >> /usr/lib/luna/system/luna-systemui/
58  std::string lunaAppLauncherPath; // default >> /usr/lib/luna/system/luna-applauncher/
59  std::string lunaSystemResourcesPath; // default >> /usr/lib/luna/system/luna-systemui/images/
60  std::string lunaSystemLocalePath; // default >> /usr/palm/sysmgr/localization
61  std::string lunaCustomizationLocalePath; // default >> /usr/palm/sysmgr-cust/localization
62  std::string lunaPrefsPath; // default >> /var/luna/preferences
63  std::string lunaCmdHandlerPath; // default >> /usr/palm/command-resource-handlers.json
64  std::string lunaCmdHandlerSavedPath; //default >> /var/usr/palm/command-resource-handlers-active.json
65  std::string lunaQmlUiComponentsPath; //default >> /usr/palm/sysmgr/uiComponents
66  std::string lunaScreenCapturesPath; // default >> /media/internal/screencaptures
67 
68  int cardLimit; // -1 to disable
69  std::set<std::string> appsToAllowInLowMemory;
71 
73 
74  std::string lunaSystemSoundsPath; // default >> /usr/palm/sounds
75  std::string lunaDefaultAlertSound; // default >> /usr/palm/sounds/alert.wav
76  std::string lunaDefaultRingtoneSound; // default >> /usr/palm/sounds/phone.wav
77 
80  std::string lunaSystemSoundTap;
86 
88 
92 
96 
101 
102  // parameters to control led pulsing
105 
106  // ALS
107  bool enableAls;
110 
111  // Parameters to control pen event throttling
114 
115  // Parameters to control gesture event throttling
117 
118  // Parameters to control touch event throttling
120 
121 
129 
137 
138  int homeDoubleClickDuration; // time to wait for a second Home button press
139 
141 
152 
155 
160 
161  std::string defaultLanguage;
162 
168  std::string launcherScrim;
169  std::string firstCardLaunch;
175 
183 
187  unsigned int dockModeMaxApps;
188  unsigned char dockModeNightBrightness;
192  unsigned int dockModeMenuHeight;
193 
196 
198  unsigned int virtualCoreNaviHeight;
199 
200  std::set<std::string> appsToLaunchAtBoot;
201  std::set<std::string> appsToKeepAlive;
202  std::set<std::string> appsToKeepAliveUntilMemPressure;
203  std::set<std::string> appsToDisableAccelCompositing;
205 
206  std::set<std::string> sucApps;
207 
209 
210  std::string fontBanner;
211  std::string fontActiveBanner;
212  std::string fontLockWindow;
213  std::string fontDockMode;
214  std::string fontQuicklaunch;
215  std::string fontBootupAnimation;
218  std::string fontKeyboardKeys;
219  std::string fontStatusBar;
220 
221 
223  bool tabletUi;
225 
237 
241 
242  bool demoMode;
243 
245 
247 
249  //...
250 
252 
262 
264 
265  std::string wifiInterfaceName; // default >> eth0
266  std::string wanInterfaceName; // default >> ppp0
267 
269 
272 
274  std::string logFileName; // default >> /var/log/lunasysmgr.log
275 
278 
279  static inline Settings* LunaSettings() {
280  if (G_LIKELY(s_settings))
281  return s_settings;
282 
283  s_settings = new Settings();
284  return s_settings;
285  }
286 
287 
288  void createNeededFolders();
289 
290  QVariant getSetting(const QString &key) const;
291 
292 private:
293  void load(const char* settingsFile);
294  void postLoad();
295  Settings();
296  ~Settings();
297 
298  static bool validateDownloadPath(const std::string& path);
299 
300  static Settings* s_settings;
301 };
302 
303 #endif // Settings
304