[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
QTextCharFormat fmtComment
Definition: klfconfig.h:211
bool menuExportProfileAffectsDrag
Definition: klfconfig.h:202
QFont defaultCMUFont
Definition: klfconfig.h:259
QString locale
When setting this, don&#39;t forget to call QLocale::setDefault().
Definition: klfconfig.h:177
bool groupSubCategories
Definition: klfconfig.h:241
QList< QColor > colorChooseWidgetRecent
Definition: klfconfig.h:187
QFont applicationFont
Definition: klfconfig.h:179
QFont defaultTTFont
Definition: klfconfig.h:263
QString homeConfigDirRCCResources
Definition: klfconfig.h:155
bool menuExportProfileAffectsCopy
Definition: klfconfig.h:203
QMap< QString, QMap< QString, QVariant > > pluginConfig
Definition: klfconfig.h:254
QList< QColor > userColorList
Definition: klfconfig.h:186
unsigned int configFlags
Definition: klfconfig.h:209
int treePreviewSizePercent
Definition: klfconfig.h:246
KLFConfig klfconfig
Definition: klfconfig.cpp:88
bool showHintPopups
Definition: klfconfig.h:193
bool glowEffect
Definition: klfconfig.h:197
double rborderoffset
Definition: klfconfig.h:228
QFont latexEditFont
Definition: klfconfig.h:180
QColor glowEffectColor
Definition: klfconfig.h:198
int listPreviewSizePercent
Definition: klfconfig.h:247
QString homeConfigDirI18n
Definition: klfconfig.h:158
bool thisVersionMajMinFirstRun
Definition: klfconfig.h:163
QFont preambleEditFont
Definition: klfconfig.h:181
QStringList customMathModes
Definition: klfconfig.h:200
QString tempDir
Definition: klfconfig.h:220
Utility class for plugins to access their configuration space in KLFConfig.
Definition: klfconfig.h:61
bool restoreURLs
Definition: klfconfig.h:239
bool outlineFonts
Definition: klfconfig.h:230
QTextCharFormat fmtKeyword
Definition: klfconfig.h:210
QFont defaultStdFont
Definition: klfconfig.h:261
Structure that stores klatexformula&#39;s configuration in memory.
Definition: klfconfig.h:141
bool historyTagCopyToArchive
Definition: klfconfig.h:243
QString execLatex
Definition: klfconfig.h:221
QList< QColor > colorChooseWidgetCustom
Definition: klfconfig.h:188
double lborderoffset
Definition: klfconfig.h:226
QColor colorNotFound
Definition: klfconfig.h:237
QTextCharFormat fmtParenMismatch
Definition: klfconfig.h:213
bool confirmClose
Definition: klfconfig.h:240
int symbolsPerLine
Definition: klfconfig.h:185
QString lastSaveDir
Definition: klfconfig.h:184
QSize previewTooltipMaxSize
Definition: klfconfig.h:182
QString homeConfigSettingsFileIni
OLD config file.
Definition: klfconfig.h:154
int iconViewFlow
Definition: klfconfig.h:242
QString dragExportProfile
Definition: klfconfig.h:196
QString execGs
Definition: klfconfig.h:223
QTextCharFormat fmtParenMatch
Definition: klfconfig.h:212
QString libraryFileName
Definition: klfconfig.h:168
bool useSystemAppFont
Definition: klfconfig.h:178
int autosaveLibraryMin
Definition: klfconfig.h:192
QStringList execenv
Definition: klfconfig.h:225
QString execDvips
Definition: klfconfig.h:222
bool clearLatexOnly
Definition: klfconfig.h:194
int maxUserColors
Definition: klfconfig.h:189
QString homeConfigDir
Definition: klfconfig.h:151
QString homeConfigDirPluginData
Definition: klfconfig.h:157
QString lastFileDialogPath
Definition: klfconfig.h:244
bool thisVersionMajMinRelFirstRun
Definition: klfconfig.h:164
QString copyExportProfile
Definition: klfconfig.h:195
bool showExportProfilesLabel
Definition: klfconfig.h:201
bool thisVersionMajFirstRun
Definition: klfconfig.h:162
int iconPreviewSizePercent
Definition: klfconfig.h:248
QString globalShareDir
Definition: klfconfig.h:152
QColor colorFound
Definition: klfconfig.h:236
QSize labelOutputFixedSize
Definition: klfconfig.h:183
QString execEpstopdf
Definition: klfconfig.h:224
QTextCharFormat fmtLonelyParen
Definition: klfconfig.h:214
QString homeConfigSettingsFile
current (now, &quot;new&quot; klatexformula.conf) settings file
Definition: klfconfig.h:153
QString libraryLibScheme
Definition: klfconfig.h:171
double tborderoffset
Definition: klfconfig.h:227
bool enableRealTimePreview
Definition: klfconfig.h:191
bool enableToolTipPreview
Definition: klfconfig.h:190
QString homeConfigDirPlugins
Definition: klfconfig.h:156
bool thisVersionExactFirstRun
Definition: klfconfig.h:165
double bborderoffset
Definition: klfconfig.h:229
int glowEffectRadius
Definition: klfconfig.h:199

Generated by doxygen 1.8.5