X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientsettings.h;h=c927250cc52cacf7944b35c4ab6a82fbcf959368;hp=20dc9188385ddbe9282e74a5cae8a1002773511a;hb=f824db0e31b54969e0b7fa0b5405b1e9173d482c;hpb=9806b265c4ef42f956a1e2a8cb1596f5228c4228 diff --git a/src/client/clientsettings.h b/src/client/clientsettings.h index 20dc9188..c927250c 100644 --- a/src/client/clientsettings.h +++ b/src/client/clientsettings.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,20 +18,18 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _CLIENTSETTINGS_H_ -#define _CLIENTSETTINGS_H_ +#ifndef CLIENTSETTINGS_H +#define CLIENTSETTINGS_H #include "settings.h" #include "types.h" class ClientSettings : public Settings { +public: + virtual ~ClientSettings(); - public: - virtual ~ClientSettings(); - - protected: - ClientSettings(QString group = "General"); - +protected: + ClientSettings(QString group = "General"); }; // Deriving from CoreAccountSettings: @@ -42,38 +40,56 @@ class ClientSettings : public Settings { // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core! class CoreAccountSettings : public ClientSettings { +public: + // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY) + CoreAccountSettings(const QString &subgroup = "General"); - public: - // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY) - CoreAccountSettings(const QString &subgroup = "General"); + virtual void notify(const QString &key, QObject *receiver, const char *slot); - QList knownAccounts(); - AccountId lastAccount(); - void setLastAccount(AccountId); - AccountId autoConnectAccount(); - void setAutoConnectAccount(AccountId); + QList knownAccounts(); + AccountId lastAccount(); + void setLastAccount(AccountId); + AccountId autoConnectAccount(); + void setAutoConnectAccount(AccountId); - void storeAccountData(AccountId id, const QVariantMap &data); - QVariantMap retrieveAccountData(AccountId); - void removeAccount(AccountId); + void storeAccountData(AccountId id, const QVariantMap &data); + QVariantMap retrieveAccountData(AccountId); + void removeAccount(AccountId); - void setJumpKeyMap(const QHash &keyMap); - QHash jumpKeyMap(); + void setJumpKeyMap(const QHash &keyMap); + QHash jumpKeyMap(); - protected: - void setAccountValue(const QString &key, const QVariant &data); - QVariant accountValue(const QString &key, const QVariant &def = QVariant()); +protected: + void setAccountValue(const QString &key, const QVariant &data); + QVariant accountValue(const QString &key, const QVariant &def = QVariant()); - private: - QString _subgroup; +private: + QString _subgroup; }; -class BufferSettings : public CoreAccountSettings { -public: - BufferSettings(BufferId bufferId); +class NotificationSettings : public ClientSettings { - void setLastSeen(QDateTime); - QDateTime lastSeen(); -}; + public: + enum HighlightNickType { + NoNick = 0x00, + CurrentNick= 0x01, + AllNicks = 0x02 + }; + + NotificationSettings(); + + inline void setValue(const QString &key, const QVariant &data) { setLocalValue(key, data); } + inline QVariant value(const QString &key, const QVariant &def = QVariant()) { return localValue(key, def); } + inline void remove(const QString &key) { removeLocalKey(key); } + + void setHighlightList(const QVariantList &highlightList); + QVariantList highlightList(); + void setHighlightNick(HighlightNickType); + HighlightNickType highlightNick(); + + void setNicksCaseSensitive(bool); + bool nicksCaseSensitive(); + +}; #endif