/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-2022 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 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
+#pragma once
+
+#include "client-export.h"
#include "settings.h"
#include "types.h"
-class ClientSettings : public Settings {
-public:
- virtual ~ClientSettings();
+class QHostAddress;
+class QSslSocket;
+class CLIENT_EXPORT ClientSettings : public Settings
+{
protected:
- ClientSettings(QString group = "General");
+ ClientSettings(QString group = "General");
};
+// ========================================
+// CoreAccountSettings
+// ========================================
+
// Deriving from CoreAccountSettings:
// MySettings() : CoreAccountSettings("MyGroup") {};
// Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
//
// Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
-class CoreAccountSettings : public ClientSettings {
+class CLIENT_EXPORT CoreAccountSettings : public ClientSettings
+{
public:
- // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
- CoreAccountSettings(const QString &subgroup = "General");
+ // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY)
+ CoreAccountSettings(QString subgroup = "General");
+
+ QList<AccountId> knownAccounts() const;
+ AccountId lastAccount() const;
+ void setLastAccount(AccountId);
+ AccountId autoConnectAccount() const;
+ void setAutoConnectAccount(AccountId);
+ bool autoConnectOnStartup() const;
+ void setAutoConnectOnStartup(bool);
+ bool autoConnectToFixedAccount() const;
+ void setAutoConnectToFixedAccount(bool);
- virtual void notify(const QString &key, QObject *receiver, const char *slot);
+ void clearAccounts();
- QList<AccountId> knownAccounts();
- AccountId lastAccount();
- void setLastAccount(AccountId);
- AccountId autoConnectAccount();
- void setAutoConnectAccount(AccountId);
+ void storeAccountData(AccountId id, const QVariantMap& data);
+ QVariantMap retrieveAccountData(AccountId) const;
+ void removeAccount(AccountId);
- void storeAccountData(AccountId id, const QVariantMap &data);
- QVariantMap retrieveAccountData(AccountId);
- void removeAccount(AccountId);
+ void setJumpKeyMap(const QHash<int, BufferId>& keyMap);
+ QHash<int, BufferId> jumpKeyMap() const;
- void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
- QHash<int, BufferId> jumpKeyMap();
+ void setBufferViewOverlay(const QSet<int>& viewIds);
+ QSet<int> bufferViewOverlay() const;
+
+ void setAccountValue(const QString& key, const QVariant& data);
+ QVariant accountValue(const QString& key, const QVariant& def = QVariant()) const;
protected:
- void setAccountValue(const QString &key, const QVariant &data);
- QVariant accountValue(const QString &key, const QVariant &def = QVariant());
+ QString keyForNotify(const QString& key) const override;
private:
- QString _subgroup;
+ QString _subgroup;
};
-class NotificationSettings : public ClientSettings {
-
- public:
- enum HighlightNickType {
- NoNick = 0x00,
- CurrentNick= 0x01,
- AllNicks = 0x02
+// ========================================
+// NotificationSettings
+// ========================================
+class CLIENT_EXPORT NotificationSettings : public ClientSettings
+{
+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 setValue(const QString& key, const QVariant& data);
+ QVariant value(const QString& key, const QVariant& def = {}) const;
+ void remove(const QString& key);
- void setHighlightList(const QVariantList &highlightList);
- QVariantList highlightList();
+ void setHighlightList(const QVariantList& highlightList);
+ QVariantList highlightList() const;
void setHighlightNick(HighlightNickType);
- HighlightNickType highlightNick();
+ HighlightNickType highlightNick() const;
void setNicksCaseSensitive(bool);
- bool nicksCaseSensitive();
+ bool nicksCaseSensitive() const;
+};
+
+// ========================================
+// CoreConnectionSettings
+// ========================================
+
+class CLIENT_EXPORT CoreConnectionSettings : public ClientSettings
+{
+public:
+ enum NetworkDetectionMode
+ {
+ UseQNetworkConfigurationManager = 1, // UseSolid is gone
+ UsePingTimeout,
+ NoActiveDetection
+ };
+
+ CoreConnectionSettings();
+
+ void setNetworkDetectionMode(NetworkDetectionMode mode);
+ NetworkDetectionMode networkDetectionMode() const;
+
+ void setAutoReconnect(bool autoReconnect);
+ bool autoReconnect() const;
+
+ void setPingTimeoutInterval(int interval);
+ int pingTimeoutInterval() const;
+
+ void setReconnectInterval(int interval);
+ int reconnectInterval() const;
+};
+
+// ========================================
+// TabCompletionSettings
+// ========================================
+
+class CLIENT_EXPORT TabCompletionSettings : public ClientSettings
+{
+public:
+ enum SortMode
+ {
+ Alphabetical,
+ LastActivity
+ };
+
+ TabCompletionSettings();
+
+ void setCompletionSuffix(const QString&);
+ QString completionSuffix() const;
+
+ void setAddSpaceMidSentence(bool);
+ bool addSpaceMidSentence() const;
+
+ void setSortMode(SortMode);
+ SortMode sortMode() const;
+
+ void setCaseSensitivity(Qt::CaseSensitivity);
+ Qt::CaseSensitivity caseSensitivity() const;
+
+ void setUseLastSpokenTo(bool);
+ bool useLastSpokenTo() const;
+};
+
+// ========================================
+// ItemViewSettings
+// ========================================
+class CLIENT_EXPORT ItemViewSettings : public ClientSettings
+{
+public:
+ ItemViewSettings(const QString& group = "ItemViews");
+ bool displayTopicInTooltip() const;
+ bool mouseWheelChangesBuffer() const;
};
-#endif