File: dictheadwords.hh

package info (click to toggle)
goldendict 1.5.0~rc2%2Bgit20221126%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,376 kB
  • sloc: cpp: 60,569; ansic: 11,511; xml: 529; makefile: 74; sh: 42
file content (62 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __DICTHEADWORDS_H_INCLUDED__
#define __DICTHEADWORDS_H_INCLUDED__

#include <QDialog>
#include <QSet>
#include <QString>
#include <QStringList>
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QAction>

#include "config.hh"
#include "ui_dictheadwords.h"
#include "dictionary.hh"
#include "delegate.hh"
#include "helpwindow.hh"

class DictHeadwords : public QDialog
{
  Q_OBJECT

public:
  explicit DictHeadwords( QWidget * parent, Config::Class & cfg_,
                          Dictionary::Class * dict_ );
  virtual ~DictHeadwords();

  void setup( Dictionary::Class * dict_ );

protected:
  Config::Class & cfg;
  Dictionary::Class * dict;
  QStringList headers;
  QStringListModel * model;
  QSortFilterProxyModel * proxy;
  WordListItemDelegate * delegate;
  QString dictId;

  QAction helpAction;

  void saveHeadersToFile();
  bool eventFilter( QObject * obj, QEvent * ev );

private:
  Ui::DictHeadwords ui;
private slots:
  void savePos();
  void filterChangedInternal();
  void filterChanged();
  void exportButtonClicked();
  void okButtonClicked();
  void itemClicked( const QModelIndex & index );
  void autoApplyStateChanged( int state );
  void showHeadwordsNumber();
  virtual void reject();
  void helpRequested();

signals:
  void headwordSelected( QString const &, QString const & );
  void closeDialog();
};

#endif // __DICTHEADWORDS_H_INCLUDED__