/***************************************************************************
- * Copyright (C) 2005/06 by the Quassel IRC 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 *
#ifndef _TABCOMPLETER_H_
#define _TABCOMPLETER_H_
-#include <QtCore>
#include <QObject>
-#include <QLineEdit>
+#include <QPointer>
+#include <QString>
+#include <QMap>
+
+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;
+
+ QMap<QString, QString> completionMap;
+ // QStringList completionTemplates;
+
+ QMap<QString, QString>::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