1 /***************************************************************************
2 * Copyright (C) 2005-08 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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef CLIENTSETTINGS_H
22 #define CLIENTSETTINGS_H
27 class ClientSettings : public Settings {
29 virtual ~ClientSettings();
32 ClientSettings(QString group = "General");
35 // Deriving from CoreAccountSettings:
36 // MySettings() : CoreAccountSettings("MyGroup") {};
37 // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
38 // connected account. This is stored in CoreAccounts/$ACCID/MyGroup/$KEY) then.
40 // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
42 class CoreAccountSettings : public ClientSettings {
44 // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
45 CoreAccountSettings(const QString &subgroup = "General");
47 virtual void notify(const QString &key, QObject *receiver, const char *slot);
49 QList<AccountId> knownAccounts();
50 AccountId lastAccount();
51 void setLastAccount(AccountId);
52 AccountId autoConnectAccount();
53 void setAutoConnectAccount(AccountId);
55 void storeAccountData(AccountId id, const QVariantMap &data);
56 QVariantMap retrieveAccountData(AccountId);
57 void removeAccount(AccountId);
59 void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
60 QHash<int, BufferId> jumpKeyMap();
63 void setAccountValue(const QString &key, const QVariant &data);
64 QVariant accountValue(const QString &key, const QVariant &def = QVariant());
70 class NotificationSettings : public ClientSettings {
73 enum HighlightNickType {
79 NotificationSettings();
81 inline void setValue(const QString &key, const QVariant &data) { setLocalValue(key, data); }
82 inline QVariant value(const QString &key, const QVariant &def = QVariant()) { return localValue(key, def); }
83 inline void remove(const QString &key) { removeLocalKey(key); }
85 void setHighlightList(const QVariantList &highlightList);
86 QVariantList highlightList();
88 void setHighlightNick(HighlightNickType);
89 HighlightNickType highlightNick();
91 void setNicksCaseSensitive(bool);
92 bool nicksCaseSensitive();