[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
klfconfig.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file klfconfig.h
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2011 by Philippe Faist
5  * philippe.faist at bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id: klfconfig.h 603 2011-02-26 23:14:55Z phfaist $ */
23 
24 #ifndef KLFCONFIG_H
25 #define KLFCONFIG_H
26 
27 #include <qglobal.h>
28 #include <QString>
29 #include <QFont>
30 #include <QSize>
31 #include <QColor>
32 #include <QSettings>
33 #include <QTextCharFormat>
34 #include <QMap>
35 
36 #include <klfbackend.h>
37 
38 class KLFConfig;
39 
61 class KLF_EXPORT KLFPluginConfigAccess
62 {
63  KLFConfig *_config;
64  QString _pluginname;
65 public:
67  KLFPluginConfigAccess(KLFConfig *configObject, const QString& pluginName);
69  virtual ~KLFPluginConfigAccess();
70 
74  virtual QString homeConfigDir() const;
75 
81  virtual QString globalShareDir() const;
82 
86  virtual QString tempDir() const;
87 
100  virtual QString homeConfigPluginDataDir(bool createIfNeeded = true) const;
101 
107  virtual QVariant readValue(const QString& key) const;
108 
121  virtual QVariant makeDefaultValue(const QString& key, const QVariant& defaultValue);
122 
130  virtual void writeValue(const QString& key, const QVariant& value);
131 };
132 
133 
135 
141 class KLF_EXPORT KLFConfig {
142 public:
143 
148  KLFConfig();
149 
150 
159 
160  struct {
161 
166 
172 
173  } Core;
174 
175  struct {
176 
204 
205  } UI;
206 
207  struct {
208 
209  unsigned int configFlags;
215 
216  } SyntaxHighlighter;
217 
218  struct {
219 
231 
232  } BackendSettings;
233 
234  struct {
235 
238 
245 
249 
250  } LibraryBrowser;
251 
252  struct {
253 
255 
256  } Plugins;
257 
264 
265  KLFPluginConfigAccess getPluginConfigAccess(const QString& name);
266 
277  void loadDefaults();
278  int readFromConfig();
279  void detectMissingSettings();
280 
281  int ensureHomeConfigDir();
282 
283  int writeToConfig();
284 
285 
287  bool checkExePaths();
288 
289 private:
290  int readFromConfig_v2(const QString& fname);
291  int readFromConfig_v1();
292 
293 };
294 
295 
296 
297 
298 KLF_EXPORT extern KLFConfig klfconfig;
299 
300 
301 
302 
303 
304 #endif

Generated by doxygen 1.8.2