Make the style engine fix a little less obscure by copying the string explicitely...
[quassel.git] / src / uisupport / tabcompleter.h
index c8a75f7..193b2f5 100644 (file)
@@ -1,11 +1,11 @@
 /***************************************************************************
- *   Copyright (C) 2005/06 by The Quassel Team                             *
+ *   Copyright (C) 2005/06 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
+ *   (at your option) version 3.                                           *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 #ifndef _TABCOMPLETER_H_
 #define _TABCOMPLETER_H_
 
-#include <QtCore>
 #include <QObject>
-#include <QLineEdit>
+#include <QStringList>
+#include <QPointer>
+
+class InputLine;
+class IrcUser;
 
 class TabCompleter : public QObject {
   Q_OBJECT
   
-  public:
-    TabCompleter(QLineEdit *l, QObject *parent = 0);
-    void disable();
-    void complete();
+public:
+  TabCompleter(InputLine *inputLine_);
+  
+  void reset();
+  void complete();
+
+  virtual bool eventFilter(QObject *obj, QEvent *event);
+
+private slots:
+  void ircUserJoinedOrParted(IrcUser *ircUser);
+  
+private:
+  QPointer<InputLine> inputLine;
+  bool enabled;
+  QString nickSuffix;
+
+  QStringList completionList;
+  // QStringList completionTemplates;
+  
+  QStringList::Iterator nextCompletion;
+  int lastCompletionLength;
+  
+  void buildCompletionList();
   
-  public slots:
-    void updateNickList(QStringList);
-    void updateChannelList(QStringList);
-    
-  private:
-    bool enabled;
-    QString startOfLineSuffix;
-    QLineEdit *lineEdit;
-    QStringList completionTemplates;
-    QStringList channelList;
-
-    QStringList nickList;
-    QStringList completionList;
-    QStringList::Iterator nextCompletion;
-    int lastCompletionLength;
-        
-    void buildCompletionList();
-    
 };
 
 #endif