X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientsettings.h;h=dd413e0d73608775a760f48920135555c031bbe8;hp=01353d7d1315cb7e2905a178c15e1d8cf3581eb8;hb=695758015a80eb8c158a9ac4c0f1c0b547e70df3;hpb=6d55e659fa87565462d7f3e92da594fdcf9708a2 diff --git a/src/client/clientsettings.h b/src/client/clientsettings.h index 01353d7d..dd413e0d 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-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,25 +15,33 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _CLIENTSETTINGS_H_ -#define _CLIENTSETTINGS_H_ +#ifndef CLIENTSETTINGS_H +#define CLIENTSETTINGS_H #include "settings.h" + #include "types.h" -class ClientSettings : public Settings { +class QHostAddress; +class QSslSocket; - public: +class ClientSettings : public Settings +{ +public: virtual ~ClientSettings(); - protected: +protected: ClientSettings(QString group = "General"); - }; + +// ======================================== +// CoreAccountSettings +// ======================================== + // Deriving from CoreAccountSettings: // MySettings() : CoreAccountSettings("MyGroup") {}; // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently @@ -41,17 +49,25 @@ 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: +class CoreAccountSettings : public ClientSettings +{ +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); + bool autoConnectOnStartup(); + void setAutoConnectOnStartup(bool); + bool autoConnectToFixedAccount(); + void setAutoConnectToFixedAccount(bool); + + void clearAccounts(); void storeAccountData(AccountId id, const QVariantMap &data); QVariantMap retrieveAccountData(AccountId); @@ -60,21 +76,27 @@ class CoreAccountSettings : public ClientSettings { void setJumpKeyMap(const QHash &keyMap); QHash jumpKeyMap(); - protected: + void setBufferViewOverlay(const QSet &viewIds); + QSet bufferViewOverlay(); + void setAccountValue(const QString &key, const QVariant &data); QVariant accountValue(const QString &key, const QVariant &def = QVariant()); - private: +private: QString _subgroup; }; -class NotificationSettings : public ClientSettings { - public: +// ======================================== +// NotificationSettings +// ======================================== +class NotificationSettings : public ClientSettings +{ +public: enum HighlightNickType { - NoNick = 0x00, - CurrentNick= 0x01, - AllNicks = 0x02 + NoNick = 0x00, + CurrentNick = 0x01, + AllNicks = 0x02 }; NotificationSettings(); @@ -91,6 +113,80 @@ class NotificationSettings : public ClientSettings { void setNicksCaseSensitive(bool); bool nicksCaseSensitive(); +}; + + +// ======================================== +// CoreConnectionSettings +// ======================================== + +class CoreConnectionSettings : public ClientSettings +{ +public: + enum NetworkDetectionMode { + UseQNetworkConfigurationManager = 1, // UseSolid is gone + UsePingTimeout, + NoActiveDetection + }; + + CoreConnectionSettings(); + + void setNetworkDetectionMode(NetworkDetectionMode mode); + NetworkDetectionMode networkDetectionMode(); + + void setAutoReconnect(bool autoReconnect); + bool autoReconnect(); + + void setPingTimeoutInterval(int interval); + int pingTimeoutInterval(); + void setReconnectInterval(int interval); + int reconnectInterval(); }; + + +// ======================================== +// TabCompletionSettings +// ======================================== + +class TabCompletionSettings : public ClientSettings +{ +public: + enum SortMode { + Alphabetical, + LastActivity + }; + + TabCompletionSettings(); + + void setCompletionSuffix(const QString &); + QString completionSuffix(); + + void setAddSpaceMidSentence(bool); + bool addSpaceMidSentence(); + + void setSortMode(SortMode); + SortMode sortMode(); + + void setCaseSensitivity(Qt::CaseSensitivity); + Qt::CaseSensitivity caseSensitivity(); + + void setUseLastSpokenTo(bool); + bool useLastSpokenTo(); +}; + + +// ======================================== +// ItemViewSettings +// ======================================== +class ItemViewSettings : public ClientSettings +{ +public: + ItemViewSettings(const QString &group = "ItemViews"); + + bool displayTopicInTooltip(); + bool mouseWheelChangesBuffer(); +}; + + #endif