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
35 virtual ~ClientSettings();
38 ClientSettings(QString group = "General");
42 // ========================================
43 // CoreAccountSettings
44 // ========================================
46 // Deriving from CoreAccountSettings:
47 // MySettings() : CoreAccountSettings("MyGroup") {};
48 // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
49 // connected account. This is stored in CoreAccounts/$ACCID/MyGroup/$KEY) then.
51 // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
53 class CLIENT_EXPORT CoreAccountSettings : public ClientSettings
56 // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
57 CoreAccountSettings(const QString &subgroup = "General");
59 virtual void notify(const QString &key, QObject *receiver, const char *slot);
61 QList<AccountId> knownAccounts();
62 AccountId lastAccount();
63 void setLastAccount(AccountId);
64 AccountId autoConnectAccount();
65 void setAutoConnectAccount(AccountId);
66 bool autoConnectOnStartup();
67 void setAutoConnectOnStartup(bool);
68 bool autoConnectToFixedAccount();
69 void setAutoConnectToFixedAccount(bool);
73 void storeAccountData(AccountId id, const QVariantMap &data);
74 QVariantMap retrieveAccountData(AccountId);
75 void removeAccount(AccountId);
77 void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
78 QHash<int, BufferId> jumpKeyMap();
80 void setBufferViewOverlay(const QSet<int> &viewIds);
81 QSet<int> bufferViewOverlay();
83 void setAccountValue(const QString &key, const QVariant &data);
84 QVariant accountValue(const QString &key, const QVariant &def = QVariant());
91 // ========================================
92 // NotificationSettings
93 // ========================================
94 class CLIENT_EXPORT NotificationSettings : public ClientSettings
97 enum HighlightNickType {
103 NotificationSettings();
105 inline void setValue(const QString &key, const QVariant &data) { setLocalValue(key, data); }
106 inline QVariant value(const QString &key, const QVariant &def = QVariant()) { return localValue(key, def); }
107 inline void remove(const QString &key) { removeLocalKey(key); }
109 void setHighlightList(const QVariantList &highlightList);
110 QVariantList highlightList();
112 void setHighlightNick(HighlightNickType);
113 HighlightNickType highlightNick();
115 void setNicksCaseSensitive(bool);
116 bool nicksCaseSensitive();
120 // ========================================
121 // CoreConnectionSettings
122 // ========================================
124 class CLIENT_EXPORT CoreConnectionSettings : public ClientSettings
127 enum NetworkDetectionMode {
128 UseQNetworkConfigurationManager = 1, // UseSolid is gone
133 CoreConnectionSettings();
135 void setNetworkDetectionMode(NetworkDetectionMode mode);
136 NetworkDetectionMode networkDetectionMode();
138 void setAutoReconnect(bool autoReconnect);
139 bool autoReconnect();
141 void setPingTimeoutInterval(int interval);
142 int pingTimeoutInterval();
144 void setReconnectInterval(int interval);
145 int reconnectInterval();
149 // ========================================
150 // TabCompletionSettings
151 // ========================================
153 class CLIENT_EXPORT TabCompletionSettings : public ClientSettings
161 TabCompletionSettings();
163 void setCompletionSuffix(const QString &);
164 QString completionSuffix();
166 void setAddSpaceMidSentence(bool);
167 bool addSpaceMidSentence();
169 void setSortMode(SortMode);
172 void setCaseSensitivity(Qt::CaseSensitivity);
173 Qt::CaseSensitivity caseSensitivity();
175 void setUseLastSpokenTo(bool);
176 bool useLastSpokenTo();
180 // ========================================
182 // ========================================
183 class CLIENT_EXPORT ItemViewSettings : public ClientSettings
186 ItemViewSettings(const QString &group = "ItemViews");
188 bool displayTopicInTooltip();
189 bool mouseWheelChangesBuffer();