X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ftabcompleter.h;h=47aebb09eb8ee7cd40411c3d86ac712eafff7d2e;hp=eb066e75584ca59d55288d392c44c7ab79fc70b0;hb=d650a89ba2410eea2b6b9a9be4644a7847d16d48;hpb=865638f28fa7824f98ac3b438763aed5124d58ee diff --git a/src/uisupport/tabcompleter.h b/src/uisupport/tabcompleter.h index eb066e75..47aebb09 100644 --- a/src/uisupport/tabcompleter.h +++ b/src/uisupport/tabcompleter.h @@ -27,7 +27,7 @@ #include "types.h" -class InputLine; +class MultiLineEdit; class IrcUser; class Network; @@ -35,32 +35,43 @@ class TabCompleter : public QObject { Q_OBJECT public: - TabCompleter(InputLine *inputLine_); + enum Type { + UserTab = 0x01, + ChannelTab = 0x02 + }; + + explicit TabCompleter(MultiLineEdit *inputLine_); void reset(); void complete(); 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 inputLine; - bool enabled; - QString nickSuffix; + QPointer _lineEdit; + bool _enabled; + QString _nickSuffix; static const Network *_currentNetwork; static BufferId _currentBufferId; + static QString _currentBufferName; + static Type _completionType; - QMap completionMap; + QMap _completionMap; // QStringList completionTemplates; - QMap::Iterator nextCompletion; - int lastCompletionLength; + QMap::Iterator _nextCompletion; + int _lastCompletionLength; void buildCompletionList();