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 QList<AccountId> knownAccounts() const;
58 AccountId lastAccount() const;
59 void setLastAccount(AccountId);
60 AccountId autoConnectAccount() const;
61 void setAutoConnectAccount(AccountId);
62 bool autoConnectOnStartup() const;
63 void setAutoConnectOnStartup(bool);
64 bool autoConnectToFixedAccount() const;
65 void setAutoConnectToFixedAccount(bool);
69 void storeAccountData(AccountId id, const QVariantMap &data);
70 QVariantMap retrieveAccountData(AccountId) const;
71 void removeAccount(AccountId);
73 void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
74 QHash<int, BufferId> jumpKeyMap() const;
76 void setBufferViewOverlay(const QSet<int> &viewIds);
77 QSet<int> bufferViewOverlay() const;
79 void setAccountValue(const QString &key, const QVariant &data);
80 QVariant accountValue(const QString &key, const QVariant &def = QVariant()) const;
83 QString keyForNotify(const QString &key) const override;
90 // ========================================
91 // NotificationSettings
92 // ========================================
93 class CLIENT_EXPORT NotificationSettings : public ClientSettings
96 enum HighlightNickType {
102 NotificationSettings();
104 void setValue(const QString &key, const QVariant &data);
105 QVariant value(const QString &key, const QVariant &def = {}) const;
106 void remove(const QString &key);
108 void setHighlightList(const QVariantList &highlightList);
109 QVariantList highlightList() const;
111 void setHighlightNick(HighlightNickType);
112 HighlightNickType highlightNick() const;
114 void setNicksCaseSensitive(bool);
115 bool nicksCaseSensitive() const;
119 // ========================================
120 // CoreConnectionSettings
121 // ========================================
123 class CLIENT_EXPORT CoreConnectionSettings : public ClientSettings
126 enum NetworkDetectionMode {
127 UseQNetworkConfigurationManager = 1, // UseSolid is gone
132 CoreConnectionSettings();
134 void setNetworkDetectionMode(NetworkDetectionMode mode);
135 NetworkDetectionMode networkDetectionMode() const;
137 void setAutoReconnect(bool autoReconnect);
138 bool autoReconnect() const;
140 void setPingTimeoutInterval(int interval);
141 int pingTimeoutInterval() const;
143 void setReconnectInterval(int interval);
144 int reconnectInterval() const;
148 // ========================================
149 // TabCompletionSettings
150 // ========================================
152 class CLIENT_EXPORT TabCompletionSettings : public ClientSettings
160 TabCompletionSettings();
162 void setCompletionSuffix(const QString &);
163 QString completionSuffix() const;
165 void setAddSpaceMidSentence(bool);
166 bool addSpaceMidSentence() const;
168 void setSortMode(SortMode);
169 SortMode sortMode() const;
171 void setCaseSensitivity(Qt::CaseSensitivity);
172 Qt::CaseSensitivity caseSensitivity() const;
174 void setUseLastSpokenTo(bool);
175 bool useLastSpokenTo() const;
179 // ========================================
181 // ========================================
182 class CLIENT_EXPORT ItemViewSettings : public ClientSettings
185 ItemViewSettings(const QString &group = "ItemViews");
187 bool displayTopicInTooltip() const;
188 bool mouseWheelChangesBuffer() const;