[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Member Functions | Public Attributes | List of all members
KLFConfig Class Reference

Structure that stores klatexformula's configuration in memory. More...

#include <klfconfig.h>

Collaboration diagram for KLFConfig:
Collaboration graph
[legend]

Public Member Functions

 KLFConfig ()
 
KLFPluginConfigAccess getPluginConfigAccess (const QString &name)
 
void loadDefaults ()
 
int readFromConfig ()
 
void detectMissingSettings ()
 
int ensureHomeConfigDir ()
 
int writeToConfig ()
 
bool checkExePaths ()
 

Public Attributes

QString homeConfigDir
 
QString globalShareDir
 
QString homeConfigSettingsFile
 current (now, "new" klatexformula.conf) settings file More...
 
QString homeConfigSettingsFileIni
 OLD config file. More...
 
QString homeConfigDirRCCResources
 
QString homeConfigDirPlugins
 
QString homeConfigDirPluginData
 
QString homeConfigDirI18n
 
struct {
   bool   thisVersionMajFirstRun
 
   bool   thisVersionMajMinFirstRun
 
   bool   thisVersionMajMinRelFirstRun
 
   bool   thisVersionExactFirstRun
 
   QString   libraryFileName
 
   QString   libraryLibScheme
 
Core
 
struct {
   QString   locale
 When setting this, don't forget to call QLocale::setDefault(). More...
 
   bool   useSystemAppFont
 
   QFont   applicationFont
 
   QFont   latexEditFont
 
   QFont   preambleEditFont
 
   QSize   previewTooltipMaxSize
 
   QSize   labelOutputFixedSize
 
   QString   lastSaveDir
 
   int   symbolsPerLine
 
   QList< QColor >   userColorList
 
   QList< QColor >   colorChooseWidgetRecent
 
   QList< QColor >   colorChooseWidgetCustom
 
   int   maxUserColors
 
   bool   enableToolTipPreview
 
   bool   enableRealTimePreview
 
   int   autosaveLibraryMin
 
   bool   showHintPopups
 
   bool   clearLatexOnly
 
   QString   copyExportProfile
 
   QString   dragExportProfile
 
   bool   glowEffect
 
   QColor   glowEffectColor
 
   int   glowEffectRadius
 
   QStringList   customMathModes
 
   bool   showExportProfilesLabel
 
   bool   menuExportProfileAffectsDrag
 
   bool   menuExportProfileAffectsCopy
 
UI
 
struct {
   unsigned int   configFlags
 
   QTextCharFormat   fmtKeyword
 
   QTextCharFormat   fmtComment
 
   QTextCharFormat   fmtParenMatch
 
   QTextCharFormat   fmtParenMismatch
 
   QTextCharFormat   fmtLonelyParen
 
SyntaxHighlighter
 
struct {
   QString   tempDir
 
   QString   execLatex
 
   QString   execDvips
 
   QString   execGs
 
   QString   execEpstopdf
 
   QStringList   execenv
 
   double   lborderoffset
 
   double   tborderoffset
 
   double   rborderoffset
 
   double   bborderoffset
 
   bool   outlineFonts
 
BackendSettings
 
struct {
   QColor   colorFound
 
   QColor   colorNotFound
 
   bool   restoreURLs
 
   bool   confirmClose
 
   bool   groupSubCategories
 
   int   iconViewFlow
 
   bool   historyTagCopyToArchive
 
   QString   lastFileDialogPath
 
   int   treePreviewSizePercent
 
   int   listPreviewSizePercent
 
   int   iconPreviewSizePercent
 
LibraryBrowser
 
struct {
   QMap< QString, QMap< QString, QVariant > >   pluginConfig
 
Plugins
 
QFont defaultCMUFont
 
QFont defaultStdFont
 
QFont defaultTTFont
 

Detailed Description

Structure that stores klatexformula's configuration in memory.

This structure is more of a namespace than a class. Access it through the global object klfconfig.

See also KLFSettings for a graphical interface for editing these settings.

Definition at line 141 of file klfconfig.h.

Constructor & Destructor Documentation

KLFConfig::KLFConfig ( )

this doesn't do anything. It actually leaves every entry with undefined values. This is why it's important to call loadDefaults() quickly after building an instance of KLFConfig. readFromConfig() isn't enough, beacause it assumes the default values are already stored in the current fields.

Definition at line 134 of file klfconfig.cpp.

Member Function Documentation

bool KLFConfig::checkExePaths ( )

returns TRUE if the executable paths are valid.

Definition at line 382 of file klfconfig.cpp.

References BackendSettings, and QFileInfo::isExecutable().

Referenced by KLFMainWin::KLFMainWin().

void KLFConfig::detectMissingSettings ( )
int KLFConfig::ensureHomeConfigDir ( )
KLFPluginConfigAccess KLFConfig::getPluginConfigAccess ( const QString name)
void KLFConfig::loadDefaults ( )

call loadDefaults() before anything, at the beginning, to ensure that the values in this structure are not undefined. (the constructor doesn't set any values).

loadDefaults() will set reasonable default values for most settings, but will not start detecting system settings, specifically look for system executables, possibly other long detection tasks. To perform that, call detectMissingSettings().

In practice, main() calls, in order, loadDefaults(), readFromConfig(), and detectMissingSettings().

Definition at line 164 of file klfconfig.cpp.

References adjust_font_size(), BackendSettings, Core, defaultCMUFont, defaultStdFont, defaultTTFont, QFontDatabase::families(), QApplication::font(), globalShareDir, homeConfigDir, homeConfigDirI18n, homeConfigDirPluginData, homeConfigDirPlugins, homeConfigDirRCCResources, homeConfigSettingsFile, homeConfigSettingsFileIni, QDir::homePath(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klf_share_dir_abspath(), KLFCONFIG_TEST_FIXED_FONT, klfDbg, LibraryBrowser, Plugins, QFontInfo::pointSize(), QFont::setPointSize(), SyntaxHighlighter, QLocale::system(), and UI.

Referenced by main().

int KLFConfig::readFromConfig ( )
int KLFConfig::writeToConfig ( )

Member Data Documentation

QFont KLFConfig::applicationFont
int KLFConfig::autosaveLibraryMin

Definition at line 192 of file klfconfig.h.

struct { ... } KLFConfig::BackendSettings
double KLFConfig::bborderoffset

Definition at line 229 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), and KLFMainWin::saveSettings().

bool KLFConfig::clearLatexOnly
QList<QColor> KLFConfig::colorChooseWidgetCustom

Definition at line 188 of file klfconfig.h.

Referenced by main(), and KLFMainWin::saveSettings().

QList<QColor> KLFConfig::colorChooseWidgetRecent

Definition at line 187 of file klfconfig.h.

Referenced by main(), and KLFMainWin::saveSettings().

QColor KLFConfig::colorFound

Definition at line 236 of file klfconfig.h.

Referenced by KLFLibBrowser::KLFLibBrowser().

QColor KLFConfig::colorNotFound

Definition at line 237 of file klfconfig.h.

Referenced by KLFLibBrowser::KLFLibBrowser().

unsigned int KLFConfig::configFlags
bool KLFConfig::confirmClose
QString KLFConfig::copyExportProfile
struct { ... } KLFConfig::Core
QStringList KLFConfig::customMathModes

Definition at line 200 of file klfconfig.h.

Referenced by KLFMainWin::collectInput(), and KLFMainWin::KLFMainWin().

QFont KLFConfig::defaultCMUFont

Not a saved setting. This is set in loadDefaults()

Definition at line 259 of file klfconfig.h.

Referenced by KLFSettings::KLFSettings(), and loadDefaults().

QFont KLFConfig::defaultStdFont

Not a saved setting. This is set in loadDefaults()

Definition at line 261 of file klfconfig.h.

Referenced by KLFSettings::apply(), KLFSettings::KLFSettings(), and loadDefaults().

QFont KLFConfig::defaultTTFont

Not a saved setting. This is set in loadDefaults()

Definition at line 263 of file klfconfig.h.

Referenced by KLFSettings::KLFSettings(), and loadDefaults().

QString KLFConfig::dragExportProfile
bool KLFConfig::enableRealTimePreview
bool KLFConfig::enableToolTipPreview
QString KLFConfig::execDvips

Definition at line 222 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), main(), and KLFMainWin::saveSettings().

QStringList KLFConfig::execenv

Definition at line 225 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), and KLFMainWin::saveSettings().

QString KLFConfig::execEpstopdf
QString KLFConfig::execGs

Definition at line 223 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), main(), and KLFMainWin::saveSettings().

QString KLFConfig::execLatex

Definition at line 221 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), main(), and KLFMainWin::saveSettings().

QTextCharFormat KLFConfig::fmtComment

Definition at line 211 of file klfconfig.h.

Referenced by KLFLatexSyntaxHighlighter::refreshAll().

QTextCharFormat KLFConfig::fmtKeyword

Definition at line 210 of file klfconfig.h.

Referenced by KLFLatexSyntaxHighlighter::refreshAll().

QTextCharFormat KLFConfig::fmtLonelyParen

Definition at line 214 of file klfconfig.h.

Referenced by KLFLatexSyntaxHighlighter::refreshAll().

QTextCharFormat KLFConfig::fmtParenMatch

Definition at line 212 of file klfconfig.h.

Referenced by KLFLatexSyntaxHighlighter::refreshAll().

QTextCharFormat KLFConfig::fmtParenMismatch

Definition at line 213 of file klfconfig.h.

Referenced by KLFLatexSyntaxHighlighter::refreshAll().

QString KLFConfig::globalShareDir
bool KLFConfig::glowEffect
QColor KLFConfig::glowEffectColor
int KLFConfig::glowEffectRadius
bool KLFConfig::groupSubCategories
bool KLFConfig::historyTagCopyToArchive
QString KLFConfig::homeConfigDir
QString KLFConfig::homeConfigDirI18n

Definition at line 158 of file klfconfig.h.

Referenced by ensureHomeConfigDir(), klf_reload_translations(), and loadDefaults().

QString KLFConfig::homeConfigDirPluginData
QString KLFConfig::homeConfigDirPlugins

Definition at line 156 of file klfconfig.h.

Referenced by ensureHomeConfigDir(), loadDefaults(), main_cleanup(), and main_load_plugins().

QString KLFConfig::homeConfigDirRCCResources
QString KLFConfig::homeConfigSettingsFile

current (now, "new" klatexformula.conf) settings file

Definition at line 153 of file klfconfig.h.

Referenced by loadDefaults(), readFromConfig(), and writeToConfig().

QString KLFConfig::homeConfigSettingsFileIni

OLD config file.

Definition at line 154 of file klfconfig.h.

Referenced by loadDefaults(), and readFromConfig().

int KLFConfig::iconPreviewSizePercent

Definition at line 248 of file klfconfig.h.

Referenced by KLFLibDefaultView::KLFLibDefaultView().

int KLFConfig::iconViewFlow

Definition at line 242 of file klfconfig.h.

Referenced by KLFSettings::apply(), and KLFSettings::reset().

QSize KLFConfig::labelOutputFixedSize
QString KLFConfig::lastFileDialogPath
QString KLFConfig::lastSaveDir

Definition at line 184 of file klfconfig.h.

Referenced by KLFMainWin::slotSave().

QFont KLFConfig::latexEditFont

Definition at line 180 of file klfconfig.h.

Referenced by KLFSettings::apply(), KLFMainWin::KLFMainWin(), and KLFSettings::reset().

double KLFConfig::lborderoffset

Definition at line 226 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), and KLFMainWin::saveSettings().

struct { ... } KLFConfig::LibraryBrowser
QString KLFConfig::libraryFileName

The library file name, relative to homeConfigDir.

Definition at line 168 of file klfconfig.h.

Referenced by KLFMainWin::loadLibrary().

QString KLFConfig::libraryLibScheme

The lib scheme to use to store the library. This scheme will be given the full path to the library in the URL path part.

Definition at line 171 of file klfconfig.h.

Referenced by KLFMainWin::loadLibrary().

int KLFConfig::listPreviewSizePercent

Definition at line 247 of file klfconfig.h.

Referenced by KLFLibDefaultView::KLFLibDefaultView().

QString KLFConfig::locale
int KLFConfig::maxUserColors

Definition at line 189 of file klfconfig.h.

Referenced by main().

bool KLFConfig::menuExportProfileAffectsCopy
bool KLFConfig::menuExportProfileAffectsDrag
bool KLFConfig::outlineFonts

Definition at line 230 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), and KLFMainWin::saveSettings().

QMap<QString, QMap<QString, QVariant> > KLFConfig::pluginConfig
struct { ... } KLFConfig::Plugins
QFont KLFConfig::preambleEditFont
QSize KLFConfig::previewTooltipMaxSize

Definition at line 182 of file klfconfig.h.

Referenced by KLFSettings::apply(), KLFSettings::reset(), and KLFMainWin::slotEvaluate().

double KLFConfig::rborderoffset

Definition at line 228 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), and KLFMainWin::saveSettings().

bool KLFConfig::restoreURLs
bool KLFConfig::showExportProfilesLabel

Definition at line 201 of file klfconfig.h.

bool KLFConfig::showHintPopups
int KLFConfig::symbolsPerLine

Definition at line 185 of file klfconfig.h.

Referenced by KLFLatexSymbolsView::recalcLayout().

struct { ... } KLFConfig::SyntaxHighlighter
double KLFConfig::tborderoffset

Definition at line 227 of file klfconfig.h.

Referenced by KLFMainWin::loadSettings(), and KLFMainWin::saveSettings().

QString KLFConfig::tempDir
bool KLFConfig::thisVersionExactFirstRun

Definition at line 165 of file klfconfig.h.

bool KLFConfig::thisVersionMajFirstRun

Definition at line 162 of file klfconfig.h.

bool KLFConfig::thisVersionMajMinFirstRun

Definition at line 163 of file klfconfig.h.

Referenced by KLFMainWin::KLFMainWin(), and KLFMainWin::showEvent().

bool KLFConfig::thisVersionMajMinRelFirstRun

Definition at line 164 of file klfconfig.h.

int KLFConfig::treePreviewSizePercent

Definition at line 246 of file klfconfig.h.

Referenced by KLFLibDefaultView::KLFLibDefaultView().

struct { ... } KLFConfig::UI
QList<QColor> KLFConfig::userColorList

Definition at line 186 of file klfconfig.h.

Referenced by main(), and KLFMainWin::saveSettings().

bool KLFConfig::useSystemAppFont

Definition at line 178 of file klfconfig.h.

Referenced by KLFSettings::apply(), KLFMainWin::event(), main(), and KLFSettings::reset().


The documentation for this class was generated from the following files:

Generated by doxygen 1.8.11