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 {
30 virtual ~ClientSettings();
33 ClientSettings(QString group = "General");
37 // Deriving from CoreAccountSettings:
38 // MySettings() : CoreAccountSettings("MyGroup") {};
39 // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
40 // connected account. This is stored in CoreAccounts/$ACCID/MyGroup/$KEY) then.
42 // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
44 class CoreAccountSettings : public ClientSettings {
47 // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
48 CoreAccountSettings(const QString &subgroup = "General");
50 QList<AccountId> knownAccounts();
51 AccountId lastAccount();
52 void setLastAccount(AccountId);
53 AccountId autoConnectAccount();
54 void setAutoConnectAccount(AccountId);
56 void storeAccountData(AccountId id, const QVariantMap &data);
57 QVariantMap retrieveAccountData(AccountId);
58 void removeAccount(AccountId);
60 void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
61 QHash<int, BufferId> jumpKeyMap();
64 void setAccountValue(const QString &key, const QVariant &data);
65 QVariant accountValue(const QString &key, const QVariant &def = QVariant());