1 /* This file is (c) 2013 Tvangeste <i.4m.l33t@yandex.ru>
2  * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
3 
4 #ifndef WORDLIST_HH
5 #define WORDLIST_HH
6 
7 #include <QListWidget>
8 #include <QLineEdit>
9 
10 #include "wordfinder.hh"
11 #include "delegate.hh"
12 
13 class WordList : public QListWidget
14 {
15   Q_OBJECT
16 public:
17   explicit WordList(QWidget * parent = 0);
18   void attachFinder(WordFinder * finder);
setTranslateLine(QLineEdit * line)19   virtual void setTranslateLine(QLineEdit * line)
20   { translateLine = line; }
21 
22 protected:
23   virtual void resizeEvent( QResizeEvent * ev );
24 
25 signals:
26   void statusBarMessage(QString const & message, int timeout = 0, QPixmap const & pixmap = QPixmap());
27   void contentChanged();
28 
29 public slots:
30 
31 private slots:
32   void prefixMatchUpdated();
33   void prefixMatchFinished();
34   void updateMatchResults( bool finished );
35 
36 private:
37   void refreshTranslateLine();
38 
39   WordFinder * wordFinder;
40   QLineEdit * translateLine;
41   WordListItemDelegate listItemDelegate;
42 
43   QVector< QSize > resizedSizes;
44 };
45 
46 #endif // WORDLIST_HH
47