]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QListings.h
Fix assertion with LOF and LOT by transfering the test from TocWidget::select() to...
[lyx.git] / src / frontends / qt4 / QListings.h
1 // -*- C++ -*-
2 /**
3  * \file QListings.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Bo Peng
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QLISTINGS_H
13 #define QLISTINGS_H
14
15 #include "QDialogView.h"
16 #include "ui/ListingsUi.h"
17
18 #include <QDialog>
19 #include <QCloseEvent>
20
21 namespace lyx {
22 namespace frontend {
23
24 class QListings;
25
26 class QListingsDialog : public QDialog, public Ui::QListingsUi {
27         Q_OBJECT
28 public:
29         QListingsDialog(QListings * form);
30         /// get values from all the widgets and form a string
31         std::string construct_params();
32 protected Q_SLOTS:
33         virtual void change_adaptor();
34         /// AFAIK, QValidator only works for QLineEdit so 
35         /// I have to validate listingsED (QTextEdit) manually.
36         void validate_listings_params();
37 protected:
38         virtual void closeEvent(QCloseEvent * e);
39 private:
40         QListings * form_;
41 };
42
43
44 class ControlListings;
45
46 class QListings : public QController<ControlListings, QView<QListingsDialog> > {
47 public:
48         friend class QListingsDialog;
49
50         QListings(Dialog &);
51 private:
52         /// Apply changes
53         virtual void apply();
54         /// update
55         virtual void update_contents();
56         /// build the dialog
57         virtual void build_dialog();
58 };
59
60 } // namespace frontend
61 } // namespace lyx
62
63 #endif // QLISTINGS_H