LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
operationalsettings.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2011-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 OPERATIONALSETTINGS_H_
23 #define OPERATIONALSETTINGS_H_
24 
25 #include "Common.h"
26 
27 #include <glib.h>
28 #include <QtGlobal>
29 #include <QSize>
30 #include <QSizeF>
31 #include <QColor>
32 #include <QPoint>
33 
35 {
36 public:
37 
38  //see PageSaver and PageRestore classes. Specifying one of the system recognized designators here will
39  // lead make the launcher show the first page with this designator that is found (if it is found), when it is
40  // FIRST brought up after a restart
41  // (default = "favorites")
43 
44  // similar to startOnPageDesignated, but will be in effect everytime the launcher is hidden and brought back up,
45  // not just on a restart; useful for when you ALWAYS want to see a particular page, regardless of where you last
46  // left off (e.g. launched an app from) when the launcher disappeared.
47  // (default = "" ; feature disabled)
49 
50  //the place where the launcher will save page info and other state to persist as user data
51  // (default = "/var/luna/preferences/launcher3/")
53 
54  //app blacklist location
55  // (default = "/var/luna/preferences/launcher3/control/blacklist.txt")
57 
58  // will ignore any saved content and will make the favorites page have all the apps available
59  // (default = false)
61 
62  // useAllContentInsteadOfEmptyFavorites
63  // This is a slightly lax version of forceFavoritesToAllContent. Whereas that one overrides even a found, non-empty
64  // favorites, this one will only override it if it is empty and this is set 'true'
65  // (default = false)
67 
68  // forces the launcher to save state each time it is hidden/disappears/minimizes
69  // (default = false)
71 
72  // this will use the epoch timestamp rather that the date for saving the launcher master-save file.
73  // This should remain set 'false' in most cases; setting to 'true' will create a lot of master files (since
74  // a new one will be created for every reorder or other change to the launcher pages)
75  // (default = false)
77 
78  // this will make it so there can only be 1 master file. It precludes some more nifty-er features with
79  // multiple configs, but they're not part of the FC features anyways
80  // (default = true)
82 
83  // this will control whether the AppMonitor recognizes and respects the ApplicationManager's "hidden" flag.
84  // if 'true', then an app descriptor with hidden set will have the same effect as the blacklisting of the app id
85  // if 'false', the flag will be ignored and the app will get added to the launcher just like any other app
86  // unless it's also been blacklisted
87  // (default = true)
89 
90  // this controls whether the rendering, when done manually (e.g. the icon layouts which paint icons on their own), uses
91  // "staged rendering", which does multiple passes over the thing to be painted. The potential benefit it avoiding interleaving
92  // of things that potentially require a lot of state changes, like textures->text->textures. All this is very platform specific
93  // and it's best to just experiment
94  // (default = true)
96 
97  // this is the path to the file that maps keywords and categories in a WebOSApp Application descriptor (ApplicationDescription)
98  // to a Page designator. Its format is in the QSettings INI format.
99  // It also defines the designator names for any auxiliary pages, *besides* favorites. In fact, never specify a designator named 'favorites' in this section
100  // (default = "/etc/palm/launcher3/app-keywords-to-designator-map.txt" )
102 
103  // this picks the index at which favorites will appear.
104  // If it is invalid (i.e. out of range when the pages are created), then index 0 will be used (which is the first, "leftmost" page)
105  // (one page is always guaranteed to exist)
106  // (default = 1)
108 
109  // this controls the naming of the files for the quicklaunch. Setting to true will assure there is only 1 copy of the quicklaunch save file
110  // used (similar to 'useSingleMasterSaveFileName'
111  // (default = true)
113 
114  // this picks the index at which the App Installer will place all the user installed applications, as they are installed
115  // It's an index, rather than a page name or designator, so that in the face of changing names in configs, this can still "work".
116  // It will be up to the product team to assure that this index is always in line with what the file pointed to by 'appKeywordsToPageDesignatorMapFilepath'
117  // has listed in terms of auxiliary pages, and appropriately matches this index to what page is the "app page"
118  // if it is invalid, then index 0 will be used.
119  // (default = 2 ; immediately to the right of Favorites , at default = 1)
121 
122  // since a requirement is that the app catalog app appear on the page 'installedAppPageIndex' along with the user installed apps, this var holds the WebOS appid
123  // (e.g. com.palm.app.findapps) of that app, so that during an INITIAL scan, it can be placed on the correct page
124  // leave blank to disable this feature; in that case, the app catalog app will end up on whatever page the default icon placement policy decides
125  // (default = com.palm.app.findapps)
127 
128  // similar to above, this is the index of the page that has the system settings...
129  // (default = 3 ; this is the right most (last) page on the default 4-page layout)
131 
132  // this string is compared with the category() of a WebOS app to determine if that app is a "settings" app that needs to go on the
133  // page at index "settingsPageIndex". It will be compared WITH case-sensitivity. If it is blank, it will be ignored (i.e. match none)
134  // (default = Settings)
136 
137  // this is the index for the page that is for the rest of the built-in apps that come on the factory device
138  // (default = 0 ; immediately to the left of Favorites , at default = 1. The system page is by default the first page)
140 
141  // this flag selects whether or not the app keywords -> page designator mappings in 'appKeywordsToPageDesignatorMapFilepath'
142  // should be used prior to attempting to apply the logic of installedAppsPageIndex, settingsPageIndex , systemAppsPageIndex
143  // if true, then an app that has stats that match something in the mappings loaded from the map file will use the page pointed to
144  // by that map, rather than the more coarse (installed app, settings app, system app) buckets
145  // (default = false)
147 
148  // this setting only applies to the INITIAL state of the launcher - i.e. how it comes from a fresh flash WITHOUT a restored profile.
149  // if set to true, then a multi page configuration will be created based on apps' categories and keywords and various other system properties such
150  // as which page designators were defined, etc...essentially a big glob logic of a lot of the variables above and the mechanisms they control
151  // (e.g. installedAppsPageIndex , etc)
152  // if set to false, then a "static" configurator is used, which uses legacy (json formatted) layout files, subject to customization, to try and create
153  // an initial configuration based on the apps that are installed
154  // the legacy files ARE expected to be modified with the correct designators, as per contents of appKeywordsToPageDesignatorMapFilepath
155  // (default = false ; using static configurator, per GEMSTONE-RD specs)
157 
158  // if true, then icons in "reorder mode" (with the decorators 'nd stuff) can be launched normally
159  // (default = false)
161 
162  // if true, the old launcher (bfish) customization files for launcher layout and quicklaunch will be ignored (the defaults in /etc/palm/ will not be, and will be used instead)
163  // (default = true)
165 
166  // for dumping diagnostics into the log dir, to be collected with the rest of the logs
167  // (default = /var/log , /tmp on desktop)
168  QString logDirPath;
169 
170  // what to use for archiving debugs and things
171  // (default = /bin/tar)
173 
174  // strictly for debug; simply archives everything in the saved dir when the launcher starts the init
175  // (default = false)
177 
178  // whereas debugArchiveLauncherSavesOnLauncherInit is for debugging the issues with corrupt launcher save files, 'safeLauncherBoot' will
179  // take action to prevent a boot with corrupt files. It will delete the entire 'savedPagesDirectory', and then exit LunaSysMgr (a forced "reboot")
180  // (default = true). Change it to false to debug/inspect corruptions. Setting this to true (which should be the setting for Production) will *not* save
181  // launcher files, as the debug flag suggests
183 
184 public:
186 
187  if (G_UNLIKELY(s_instance == 0))
189 
190  return s_instance;
191  }
192 
193 private:
194 
195  static OperationalSettings* s_instance;
196 
197 private:
198 
201 
202  void readSettings(const char* filePath);
203  void verify();
204 };
205 
206 
207 #endif /* OPERATIONALSETTINGS_H_ */