Don't use a const ref for bool
[quassel.git] / src / client / clientsettings.h
index f3ac247..8d87398 100644 (file)
@@ -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  *
 #define CLIENTSETTINGS_H
 
 #include "settings.h"
+
 #include "types.h"
 
+class QHostAddress;
+class QSslSocket;
+
 class ClientSettings : public Settings {
 public:
   virtual ~ClientSettings();
@@ -32,6 +36,10 @@ protected:
   ClientSettings(QString group = "General");
 };
 
+// ========================================
+//  CoreAccountSettings
+// ========================================
+
 // Deriving from CoreAccountSettings:
 // MySettings() : CoreAccountSettings("MyGroup") {};
 // Then use accountValue() / setAccountValue() to retrieve/store data associated to the currently
@@ -51,6 +59,12 @@ public:
   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);
@@ -59,7 +73,9 @@ public:
   void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
   QHash<int, BufferId> jumpKeyMap();
 
-protected:
+  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());
 
@@ -67,29 +83,99 @@ private:
   QString _subgroup;
 };
 
+// ========================================
+//  NotificationSettings
+// ========================================
 class NotificationSettings : public ClientSettings {
+public:
+  enum HighlightNickType {
+    NoNick = 0x00,
+    CurrentNick= 0x01,
+    AllNicks = 0x02
+  };
 
-  public:
-    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();
+};
+
+// ========================================
+// CoreConnectionSettings
+// ========================================
+
+class CoreConnectionSettings : public ClientSettings {
+public:
+  enum NetworkDetectionMode {
+    UseSolid,
+    UsePingTimeout,
+    NoActiveDetection
+  };
 
-    void setNicksCaseSensitive(bool);
-    bool nicksCaseSensitive();
+  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