1 /***************************************************************************
2 * Copyright (C) 2005-2020 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"
31 class CLIENT_EXPORT ClientSettings : public Settings
34 ClientSettings(QString group = "General");
37 // ========================================
38 // CoreAccountSettings
39 // ========================================
41 // Deriving from CoreAccountSettings:
42 // MySettings() : CoreAccountSettings("MyGroup") {};
43 // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
44 // connected account. This is stored in CoreAccounts/$ACCID/MyGroup/$KEY) then.
46 // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
48 class CLIENT_EXPORT CoreAccountSettings : public ClientSettings
51 // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
52 CoreAccountSettings(QString subgroup = "General");
54 QList<AccountId> knownAccounts() const;
55 AccountId lastAccount() const;
56 void setLastAccount(AccountId);
57 AccountId autoConnectAccount() const;
58 void setAutoConnectAccount(AccountId);
59 bool autoConnectOnStartup() const;
60 void setAutoConnectOnStartup(bool);
61 bool autoConnectToFixedAccount() const;
62 void setAutoConnectToFixedAccount(bool);
66 void storeAccountData(AccountId id, const QVariantMap& data);
67 QVariantMap retrieveAccountData(AccountId) const;
68 void removeAccount(AccountId);
70 void setJumpKeyMap(const QHash<int, BufferId>& keyMap);
71 QHash<int, BufferId> jumpKeyMap() const;
73 void setBufferViewOverlay(const QSet<int>& viewIds);
74 QSet<int> bufferViewOverlay() const;
76 void setAccountValue(const QString& key, const QVariant& data);
77 QVariant accountValue(const QString& key, const QVariant& def = QVariant()) const;
80 QString keyForNotify(const QString& key) const override;
86 // ========================================
87 // NotificationSettings
88 // ========================================
89 class CLIENT_EXPORT NotificationSettings : public ClientSettings
92 enum HighlightNickType
99 NotificationSettings();
101 void setValue(const QString& key, const QVariant& data);
102 QVariant value(const QString& key, const QVariant& def = {}) const;
103 void remove(const QString& key);
105 void setHighlightList(const QVariantList& highlightList);
106 QVariantList highlightList() const;
108 void setHighlightNick(HighlightNickType);
109 HighlightNickType highlightNick() const;
111 void setNicksCaseSensitive(bool);
112 bool nicksCaseSensitive() const;
115 // ========================================
116 // CoreConnectionSettings
117 // ========================================
119 class CLIENT_EXPORT CoreConnectionSettings : public ClientSettings
122 enum NetworkDetectionMode
124 UseQNetworkConfigurationManager = 1, // UseSolid is gone
129 CoreConnectionSettings();
131 void setNetworkDetectionMode(NetworkDetectionMode mode);
132 NetworkDetectionMode networkDetectionMode() const;
134 void setAutoReconnect(bool autoReconnect);
135 bool autoReconnect() const;
137 void setPingTimeoutInterval(int interval);
138 int pingTimeoutInterval() const;
140 void setReconnectInterval(int interval);
141 int reconnectInterval() const;
144 // ========================================
145 // TabCompletionSettings
146 // ========================================
148 class CLIENT_EXPORT TabCompletionSettings : public ClientSettings
157 TabCompletionSettings();
159 void setCompletionSuffix(const QString&);
160 QString completionSuffix() const;
162 void setAddSpaceMidSentence(bool);
163 bool addSpaceMidSentence() const;
165 void setSortMode(SortMode);
166 SortMode sortMode() const;
168 void setCaseSensitivity(Qt::CaseSensitivity);
169 Qt::CaseSensitivity caseSensitivity() const;
171 void setUseLastSpokenTo(bool);
172 bool useLastSpokenTo() const;
175 // ========================================
177 // ========================================
178 class CLIENT_EXPORT ItemViewSettings : public ClientSettings
181 ItemViewSettings(const QString& group = "ItemViews");
183 bool displayTopicInTooltip() const;
184 bool mouseWheelChangesBuffer() const;