1
/***************************************************************************
2
* Copyright (C) 2006-2008 by Thomas Schweitzer *
3
* thomas-schweitzer(at)arcor.de *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License version 2.0 as *
7
* published by the Free Software Foundation. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program in the file LICENSE.GPL; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18
***************************************************************************/
20
#ifndef UIGUISETTINGS_H
21
#define UIGUISETTINGS_H
30
#include <QStringList>
31
#include <QCoreApplication>
33
class UiGuiSettings : public QObject
38
UiGuiSettings(bool portableMode, QString globalFilesDirectoryStr);
39
virtual ~UiGuiSettings();
42
bool setValueByName(QString settingName, QVariant value);
43
QVariant getValueByName(QString settingName);
44
void updateAllDependend();
45
QStringList getAvailableTranslations();
47
// Only one slot per possible value type needed, because wanted setting
48
// is recognized by the sender objects name.
50
void handleValueChangeFromExtern(int value);
51
void handleValueChangeFromExtern(bool value);
52
void handleValueChangeFromExtern(QDate value);
53
void handleValueChangeFromExtern(QByteArray value);
55
// Each possible setting needs an own signal.
57
void versionInSettingsFile(QString value);
58
void windowIsMaximized(bool value);
59
void windowPosition(QPoint value);
60
void windowSize(QSize value);
61
void fileEncoding(QString value);
62
void recentlyOpenedListSize(int value);
63
void loadLastOpenedFileOnStartup(bool value);
64
void lastOpenedFiles(QString value);
65
void lastSelectedIndenterID(int value);
66
void syntaxHighlightningEnabled(bool value);
67
void whiteSpaceIsVisible(bool value);
68
void indenterParameterTooltipsEnabled(bool value);
69
void tabWidth(int value);
70
void language(int value);
71
void checkForUpdate(bool value);
72
void lastUpdateCheck(QDate value);
73
void mainWindowState(QByteArray value);
76
void emitSignalForSetting(QString settingName);
77
void readAvailableTranslations();
79
//! Stores the mnemonics of the available translations.
80
QStringList availableTranslations;
82
//! The settings file.
85
//! This map holds all possible settings defined by their name as QString. The value is of the type QVariant.
86
QMap<QString, QVariant> settings;
88
QString globalFilesDirectoryStr;
89
QString indenterDirctoryStr;
93
#endif // UIGUISETTINGS_H