21 #ifndef TULIPSETTINGS_H
22 #define TULIPSETTINGS_H
25 #include <QNetworkProxy>
28 #include <tulip/GlGraphRenderingParameters.h>
29 #include <tulip/Size.h>
30 #include <tulip/Graph.h>
39 class TLP_QT_SCOPE TulipSettings:
public QSettings, GlDefaultSelectionColorManager {
41 Q_ENUMS(DisplayProperty)
45 static const QString RemoteLocationsConfigEntry;
46 static const QString RecentDocumentsConfigEntry;
47 static const QString PluginsToRemoveConfigEntry;
48 static const QString DefaultColorConfigEntry;
49 static const QString DefaultLabelColorConfigEntry;
50 static const QString DefaultSizeConfigEntry;
51 static const QString DefaultShapeConfigEntry;
52 static const QString DefaultSelectionColorEntry;
53 static const QString FavoriteAlgorithmsEntry;
54 static const QString FirstRunEntry;
56 static const QString ProxyEnabledEntry;
57 static const QString ProxyTypeEntry;
58 static const QString ProxyHostEntry;
59 static const QString ProxyPortEntry;
60 static const QString ProxyUseAuthEntry;
61 static const QString ProxyUsernameEntry;
62 static const QString ProxyPasswordEntry;
64 static const QString AutomaticPerfectAspectRatioEntry;
65 static const QString ViewOrthoEntry;
66 static const QString AutomaticMapMetricEntry;
67 static const QString ResultPropertyStoredEntry;
68 static const QString RunningTimeComputedEntry;
70 static TulipSettings &instance();
72 static QString elementKey(const QString& configEntry, tlp::
ElementType elem);
77 QStringList recentDocuments() const;
83 void addToRecentDocuments(const QString &);
88 void checkRecentDocuments();
96 void addRemoteLocation(const QString& remoteLocation);
104 void removeRemoteLocation(const QString& remoteLocation);
111 const QStringList remoteLocations() const;
112 const QStringList pluginsToRemove() const;
114 void markPluginForRemoval(const QString& pluginLibrary);
115 void unmarkPluginForRemoval(const QString& pluginLibrary);
118 void setDefaultColor(tlp::
ElementType elem, const tlp::Color& color);
120 tlp::Color defaultLabelColor();
121 void setDefaultLabelColor(const tlp::Color& color);
124 void setDefaultSize(tlp::
ElementType elem, const tlp::Size& size);
127 void setDefaultShape(tlp::
ElementType elem,
int shape);
130 tlp::Color defaultSelectionColor();
132 void setDefaultSelectionColor(const tlp::Color& color);
134 QSet<QString> favoriteAlgorithms() const;
135 void addFavoriteAlgorithm(const QString&name);
136 void removeFavoriteAlgorithm(const QString&name);
139 bool isProxyEnabled() const;
140 void setProxyEnabled(
bool);
142 QNetworkProxy::ProxyType proxyType() const;
143 void setProxyType(QNetworkProxy::ProxyType);
145 QString proxyHost() const;
146 void setProxyHost(const QString&);
148 unsigned int proxyPort() const;
149 void setProxyPort(
unsigned int);
151 bool isUseProxyAuthentification() const;
152 void setUseProxyAuthentification(
bool);
154 QString proxyUsername() const;
155 void setProxyUsername(const QString&);
157 QString proxyPassword() const;
158 void setProxyPassword(const QString&);
160 void applyProxySettings();
162 bool isFirstRun() const;
163 void setFirstRun(
bool);
165 bool isAutomaticMapMetric() const;
166 void setAutomaticMapMetric(
bool);
168 bool isAutomaticRatio() const;
169 void setAutomaticRatio(
bool);
171 bool isViewOrtho() const;
172 void setViewOrtho(
bool);
174 bool isResultPropertyStored() const;
175 void setResultPropertyStored(
bool);
177 bool isRunningTimeComputed() const;
178 void setRunningTimeComputed(
bool);
182 static TulipSettings *_instance;
184 void setFavoriteAlgorithms(const QSet<QString> &lst);
187 #endif // TULIPSETTINGS_H