1 /***************************************************************************
2 * Copyright (C) 2005-2018 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
23 #include "client-export.h"
32 class CLIENT_EXPORT ClientSettings : public Settings
36 ClientSettings(QString group = "General");
40 // ========================================
41 // CoreAccountSettings
42 // ========================================
44 // Deriving from CoreAccountSettings:
45 // MySettings() : CoreAccountSettings("MyGroup") {};
46 // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
47 // connected account. This is stored in CoreAccounts/$ACCID/MyGroup/$KEY) then.
49 // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
51 class CLIENT_EXPORT CoreAccountSettings : public ClientSettings
54 // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
55 CoreAccountSettings(QString subgroup = "General");
57 void notify(const QString &key, QObject *receiver, const char *slot) override;
59 QList<AccountId> knownAccounts();
60 AccountId lastAccount();
61 void setLastAccount(AccountId);
62 AccountId autoConnectAccount();
63 void setAutoConnectAccount(AccountId);
64 bool autoConnectOnStartup();
65 void setAutoConnectOnStartup(bool);
66 bool autoConnectToFixedAccount();
67 void setAutoConnectToFixedAccount(bool);
71 void storeAccountData(AccountId id, const QVariantMap &data);
72 QVariantMap retrieveAccountData(AccountId);
73 void removeAccount(AccountId);
75 void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
76 QHash<int, BufferId> jumpKeyMap();
78 void setBufferViewOverlay(const QSet<int> &viewIds);
79 QSet<int> bufferViewOverlay();
81 void setAccountValue(const QString &key, const QVariant &data);
82 QVariant accountValue(const QString &key, const QVariant &def = QVariant());
89 // ========================================
90 // NotificationSettings
91 // ========================================
92 class CLIENT_EXPORT NotificationSettings : public ClientSettings
95 enum HighlightNickType {
101 NotificationSettings();
103 inline void setValue(const QString &key, const QVariant &data) { setLocalValue(key, data); }
104 inline QVariant value(const QString &key, const QVariant &def = QVariant()) { return localValue(key, def); }
105 inline void remove(const QString &key) { removeLocalKey(key); }
107 void setHighlightList(const QVariantList &highlightList);
108 QVariantList highlightList();
110 void setHighlightNick(HighlightNickType);
111 HighlightNickType highlightNick();
113 void setNicksCaseSensitive(bool);
114 bool nicksCaseSensitive();
118 // ========================================
119 // CoreConnectionSettings
120 // ========================================
122 class CLIENT_EXPORT CoreConnectionSettings : public ClientSettings
125 enum NetworkDetectionMode {
126 UseQNetworkConfigurationManager = 1, // UseSolid is gone
131 CoreConnectionSettings();
133 void setNetworkDetectionMode(NetworkDetectionMode mode);
134 NetworkDetectionMode networkDetectionMode();
136 void setAutoReconnect(bool autoReconnect);
137 bool autoReconnect();
139 void setPingTimeoutInterval(int interval);
140 int pingTimeoutInterval();
142 void setReconnectInterval(int interval);
143 int reconnectInterval();
147 // ========================================
148 // TabCompletionSettings
149 // ========================================
151 class CLIENT_EXPORT TabCompletionSettings : public ClientSettings
159 TabCompletionSettings();
161 void setCompletionSuffix(const QString &);
162 QString completionSuffix();
164 void setAddSpaceMidSentence(bool);
165 bool addSpaceMidSentence();
167 void setSortMode(SortMode);
170 void setCaseSensitivity(Qt::CaseSensitivity);
171 Qt::CaseSensitivity caseSensitivity();
173 void setUseLastSpokenTo(bool);
174 bool useLastSpokenTo();
178 // ========================================
180 // ========================================
181 class CLIENT_EXPORT ItemViewSettings : public ClientSettings
184 ItemViewSettings(const QString &group = "ItemViews");
186 bool displayTopicInTooltip();
187 bool mouseWheelChangesBuffer();