Merge pull request #97 from Bombe/focus-host-input
[quassel.git] / src / client / clientsettings.h
index ec354d9..dd413e0 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 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,7 +15,7 @@
  *   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
 class QHostAddress;
 class QSslSocket;
 
-class ClientSettings : public Settings {
+class ClientSettings : public Settings
+{
 public:
-  virtual ~ClientSettings();
+    virtual ~ClientSettings();
 
 protected:
-  ClientSettings(QString group = "General");
+    ClientSettings(QString group = "General");
 };
 
+
 // ========================================
 //  CoreAccountSettings
 // ========================================
@@ -47,91 +49,144 @@ protected:
 //
 // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core!
 
-class CoreAccountSettings : public ClientSettings {
+class 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(const QString &subgroup = "General");
 
-  virtual void notify(const QString &key, QObject *receiver, const char *slot);
+    virtual void notify(const QString &key, QObject *receiver, const char *slot);
 
-  QList<AccountId> knownAccounts();
-  AccountId lastAccount();
-  void setLastAccount(AccountId);
-  AccountId autoConnectAccount();
-  void setAutoConnectAccount(AccountId);
+    QList<AccountId> knownAccounts();
+    AccountId lastAccount();
+    void setLastAccount(AccountId);
+    AccountId autoConnectAccount();
+    void setAutoConnectAccount(AccountId);
+    bool autoConnectOnStartup();
+    void setAutoConnectOnStartup(bool);
+    bool autoConnectToFixedAccount();
+    void setAutoConnectToFixedAccount(bool);
 
-  void storeAccountData(AccountId id, const QVariantMap &data);
-  QVariantMap retrieveAccountData(AccountId);
-  void removeAccount(AccountId);
+    void clearAccounts();
 
-  void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
-  QHash<int, BufferId> jumpKeyMap();
+    void storeAccountData(AccountId id, const QVariantMap &data);
+    QVariantMap retrieveAccountData(AccountId);
+    void removeAccount(AccountId);
 
-protected:
-  void setAccountValue(const QString &key, const QVariant &data);
-  QVariant accountValue(const QString &key, const QVariant &def = QVariant());
+    void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
+    QHash<int, BufferId> jumpKeyMap();
+
+    void setBufferViewOverlay(const QSet<int> &viewIds);
+    QSet<int> bufferViewOverlay();
+
+    void setAccountValue(const QString &key, const QVariant &data);
+    QVariant accountValue(const QString &key, const QVariant &def = QVariant());
 
 private:
-  QString _subgroup;
+    QString _subgroup;
 };
 
+
 // ========================================
 //  NotificationSettings
 // ========================================
-class NotificationSettings : public ClientSettings {
+class NotificationSettings : public ClientSettings
+{
 public:
-  enum HighlightNickType {
-    NoNick = 0x00,
-    CurrentNick= 0x01,
-    AllNicks = 0x02
-  };
+    enum HighlightNickType {
+        NoNick = 0x00,
+        CurrentNick = 0x01,
+        AllNicks = 0x02
+    };
 
-  NotificationSettings();
+    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); }
+    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 setHighlightList(const QVariantList &highlightList);
+    QVariantList highlightList();
 
-  void setHighlightNick(HighlightNickType);
-  HighlightNickType highlightNick();
+    void setHighlightNick(HighlightNickType);
+    HighlightNickType highlightNick();
 
-  void setNicksCaseSensitive(bool);
-  bool nicksCaseSensitive();
+    void setNicksCaseSensitive(bool);
+    bool nicksCaseSensitive();
 };
 
 
 // ========================================
-//  KnownHostsSettings
+// CoreConnectionSettings
 // ========================================
-class KnownHostsSettings : public ClientSettings {
+
+class CoreConnectionSettings : public ClientSettings
+{
 public:
-  KnownHostsSettings();
+    enum NetworkDetectionMode {
+        UseQNetworkConfigurationManager = 1, // UseSolid is gone
+        UsePingTimeout,
+        NoActiveDetection
+    };
 
-  QByteArray knownDigest(const QHostAddress &address);
-  void saveKnownHost(const QHostAddress &address, const QByteArray &certDigest);
-  bool isKnownHost(const QHostAddress &address, const QByteArray &certDigest);
+    CoreConnectionSettings();
 
-#ifdef HAVE_SSL
-  QByteArray knownDigest(const QSslSocket *socket);
-  void saveKnownHost(const QSslSocket *socket);
-  bool isKnownHost(const QSslSocket *socket);
-#endif
+    void setNetworkDetectionMode(NetworkDetectionMode mode);
+    NetworkDetectionMode networkDetectionMode();
+
+    void setAutoReconnect(bool autoReconnect);
+    bool autoReconnect();
+
+    void setPingTimeoutInterval(int interval);
+    int pingTimeoutInterval();
+
+    void setReconnectInterval(int interval);
+    int reconnectInterval();
 };
 
+
 // ========================================
-// NickCompletionSettings
+// TabCompletionSettings
 // ========================================
 
-class NickCompletionSettings : public ClientSettings {
+class TabCompletionSettings : public ClientSettings
+{
 public:
-  NickCompletionSettings();
+    enum SortMode {
+        Alphabetical,
+        LastActivity
+    };
+
+    TabCompletionSettings();
 
-  void setCompletionSuffix(const QString &);
-  QString completionSuffix();
+    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