Enable multi-selection in nick list
[quassel.git] / src / uisupport / inputline.h
index b0d59bd..ff6091d 100644 (file)
@@ -1,11 +1,11 @@
 /***************************************************************************
- *   Copyright (C) 2005/06 by The Quassel Team                             *
+ *   Copyright (C) 2005-08 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        *
@@ -28,29 +28,34 @@ class TabCompleter;
 class InputLine : public QLineEdit {
   Q_OBJECT
 
-  public:
-    InputLine(QWidget *parent = 0);
-    ~InputLine();
-    
-  protected:
-    virtual bool event(QEvent *);
-    virtual void keyPressEvent(QKeyEvent * event);
-
-  private slots:
-    void enter();
-
-  public slots:
-    void updateNickList(QStringList);
-    
-  signals:
-    void nickListUpdated(QStringList);
-    
-  private:
-    qint32 idx;
-    QStringList history;
-    QStringList nickList;
-
-    TabCompleter *tabComplete;
+public:
+  InputLine(QWidget *parent = 0);
+  ~InputLine();
+
+protected:
+  //    virtual bool event(QEvent *);
+  virtual void keyPressEvent(QKeyEvent * event);
+
+private slots:
+  void on_returnPressed();
+  void on_textChanged(QString newText);
+
+  bool addToHistory(const QString &text, bool temporary = false);
+
+signals:
+  void sendText(QString text);
+
+private:
+  QStringList history;
+  QHash<int, QString> tempHistory;
+  qint32 idx;
+  TabCompleter *tabCompleter;
+
+  int bindModifier;
+  int jumpModifier;
+
+  void resetLine();
+  void showHistoryEntry();
 };
 
 #endif