22 #ifndef TULIPSETTINGS_H
23 #define TULIPSETTINGS_H
25 #include <QtCore/QSettings>
26 #include <QtCore/QStringList>
27 #include <tulip/tulipconf.h>
28 #include <tulip/Graph.h>
29 #include <tulip/Color.h>
30 #include <tulip/Size.h>
31 #include <QtNetwork/QNetworkProxy>
38 class TLP_QT_SCOPE TulipSettings:
public QSettings {
40 Q_ENUMS(DisplayProperty)
44 static const QString RemoteLocationsConfigEntry;
45 static const QString RecentDocumentsConfigEntry;
46 static const QString PluginsToRemoveConfigEntry;
47 static const QString DefaultColorConfigEntry;
48 static const QString DefaultSizeConfigEntry;
49 static const QString DefaultShapeConfigEntry;
50 static const QString DefaultSelectionColorEntry;
51 static const QString FavoriteAlgorithmsEntry;
52 static const QString FirstRunEntry;
54 static const QString ProxyEnabledEntry;
55 static const QString ProxyTypeEntry;
56 static const QString ProxyHostEntry;
57 static const QString ProxyPortEntry;
58 static const QString ProxyUseAuthEntry;
59 static const QString ProxyUsernameEntry;
60 static const QString ProxyPasswordEntry;
62 static const QString AutomaticPerfectAspectRatioEntry;
63 static const QString AutomaticMapMetricEntry;
65 static TulipSettings &instance();
67 static QString elementKey(const QString& configEntry, tlp::ElementType elem);
72 QStringList recentDocuments() const;
78 void addToRecentDocuments(const QString &);
83 void checkRecentDocuments();
91 void addRemoteLocation(const QString& remoteLocation);
99 void removeRemoteLocation(const QString& remoteLocation);
106 const QStringList remoteLocations() const;
107 const QStringList pluginsToRemove() const;
109 void markPluginForRemoval(const QString& pluginLibrary);
110 void unmarkPluginForRemoval(const QString& pluginLibrary);
112 tlp::Color defaultColor(tlp::ElementType elem);
113 void setDefaultColor(tlp::ElementType elem, const tlp::Color& color);
115 tlp::Size defaultSize(tlp::ElementType elem);
116 void setDefaultSize(tlp::ElementType elem, const tlp::Size& size);
118 int defaultShape(tlp::ElementType elem);
119 void setDefaultShape(tlp::ElementType elem,
int shape);
121 tlp::Color defaultSelectionColor();
122 void setDefaultSelectionColor(const tlp::Color& color);
124 QSet<QString> favoriteAlgorithms() const;
125 void addFavoriteAlgorithm(const QString&name);
126 void removeFavoriteAlgorithm(const QString&name);
129 bool isProxyEnabled() const;
130 void setProxyEnabled(
bool);
132 QNetworkProxy::ProxyType proxyType() const;
133 void setProxyType(QNetworkProxy::ProxyType);
135 QString proxyHost() const;
136 void setProxyHost(const QString&);
138 unsigned int proxyPort() const;
139 void setProxyPort(
unsigned int);
141 bool isUseProxyAuthentification() const;
142 void setUseProxyAuthentification(
bool);
144 QString proxyUsername() const;
145 void setProxyUsername(const QString&);
147 QString proxyPassword() const;
148 void setProxyPassword(const QString&);
150 void applyProxySettings();
152 bool isFirstRun() const;
153 void setFirstRun(
bool);
155 bool isAutomaticMapMetric() const;
156 void setAutomaticMapMetric(
bool);
158 bool isAutomaticRatio() const;
159 void setAutomaticRatio(
bool);
163 static TulipSettings *_instance;
165 void setFavoriteAlgorithms(const QSet<QString> &lst);
168 #endif // TULIPSETTINGS_H