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, Observable {
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 AutomaticDisplayDefaultViews;
65 static const QString AutomaticPerfectAspectRatioEntry;
66 static const QString ViewOrthoEntry;
67 static const QString AutomaticMapMetricEntry;
68 static const QString ResultPropertyStoredEntry;
69 static const QString RunningTimeComputedEntry;
70 static const QString SeedForRandomSequenceEntry;
72 static const QString WarnUserAboutGraphicsCardEntry;
74 static TulipSettings &instance();
76 static QString elementKey(const QString& configEntry, tlp::ElementType elem);
78 void synchronizeViewSettings();
83 QStringList recentDocuments() const;
89 void addToRecentDocuments(const QString &);
94 void checkRecentDocuments();
102 void addRemoteLocation(const QString& remoteLocation);
110 void removeRemoteLocation(const QString& remoteLocation);
117 const QStringList remoteLocations() const;
118 const QStringList pluginsToRemove() const;
120 void markPluginForRemoval(const QString& pluginLibrary);
121 void unmarkPluginForRemoval(const QString& pluginLibrary);
123 tlp::Color defaultColor(tlp::ElementType elem);
124 void setDefaultColor(tlp::ElementType elem, const tlp::Color& color);
126 tlp::Color defaultLabelColor();
127 void setDefaultLabelColor(const tlp::Color& color);
129 tlp::Size defaultSize(tlp::ElementType elem);
130 void setDefaultSize(tlp::ElementType elem, const tlp::Size& size);
132 int defaultShape(tlp::ElementType elem);
133 void setDefaultShape(tlp::ElementType elem,
int shape);
136 tlp::Color defaultSelectionColor();
138 void setDefaultSelectionColor(const tlp::Color& color);
140 QSet<QString> favoriteAlgorithms() const;
141 void addFavoriteAlgorithm(const QString&name);
142 void removeFavoriteAlgorithm(const QString&name);
145 bool isProxyEnabled() const;
146 void setProxyEnabled(
bool);
148 QNetworkProxy::ProxyType proxyType() const;
149 void setProxyType(QNetworkProxy::ProxyType);
151 QString proxyHost() const;
152 void setProxyHost(const QString&);
154 unsigned int proxyPort() const;
155 void setProxyPort(
unsigned int);
157 bool isUseProxyAuthentification() const;
158 void setUseProxyAuthentification(
bool);
160 QString proxyUsername() const;
161 void setProxyUsername(const QString&);
163 QString proxyPassword() const;
164 void setProxyPassword(const QString&);
166 void applyProxySettings();
168 bool isFirstRun() const;
169 void setFirstRun(
bool);
171 bool displayDefaultViews() const;
172 void setDisplayDefaultViews(
bool);
174 bool isAutomaticMapMetric() const;
175 void setAutomaticMapMetric(
bool);
177 bool isAutomaticRatio() const;
178 void setAutomaticRatio(
bool);
180 bool isViewOrtho() const;
181 void setViewOrtho(
bool);
183 bool isResultPropertyStored() const;
184 void setResultPropertyStored(
bool);
186 bool isRunningTimeComputed() const;
187 void setRunningTimeComputed(
bool);
189 unsigned int seedOfRandomSequence() const;
190 void setSeedOfRandomSequence(
unsigned int);
191 void initSeedOfRandomSequence();
193 bool warnUserAboutGraphicsCard() const;
194 void setWarnUserAboutGraphicsCard(
bool);
196 void treatEvent(const Event &message);
200 static TulipSettings *_instance;
202 void setFavoriteAlgorithms(const QSet<QString> &lst);
205 #endif // TULIPSETTINGS_H