Make tabcompletion key configurable via shortcuts. fixes 1018
[quassel.git] / src / uisupport / tabcompleter.h
index d249943..47aebb0 100644 (file)
@@ -35,6 +35,11 @@ class TabCompleter : public QObject {
   Q_OBJECT
 
 public:
+  enum Type {
+    UserTab = 0x01,
+    ChannelTab = 0x02
+  };
+
   explicit TabCompleter(MultiLineEdit *inputLine_);
 
   void reset();
@@ -42,11 +47,15 @@ public:
 
   virtual bool eventFilter(QObject *obj, QEvent *event);
 
+public slots:
+  void onTabCompletionKey();
+
 private:
+
   struct CompletionKey {
-    inline CompletionKey(const QString &n) { nick = n; }
+    inline CompletionKey(const QString &n) { contents = n; }
     bool operator<(const CompletionKey &other) const;
-    QString nick;
+    QString contents;
   };
 
   QPointer<MultiLineEdit> _lineEdit;
@@ -55,6 +64,8 @@ private:
 
   static const Network *_currentNetwork;
   static BufferId _currentBufferId;
+  static QString _currentBufferName;
+  static Type _completionType;
 
   QMap<CompletionKey, QString> _completionMap;
   // QStringList completionTemplates;