]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QListings.h
Add support for listings package. Two listings command \lstinline, \lstinputlisting...
[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 protected Q_SLOTS:
31         virtual void change_adaptor();
32         /// AFAIK, QValidator only works for QLineEdit so 
33         /// I have to validate listingsED (QTextEdit) manually.
34         void validate_listings_params();
35 protected:
36         virtual void closeEvent(QCloseEvent * e);
37 private:
38         QListings * form_;
39 };
40
41
42 class ControlListings;
43
44 class QListings : public QController<ControlListings, QView<QListingsDialog> > {
45 public:
46         friend class QListingsDialog;
47
48         QListings(Dialog &);
49 private:
50         /// Apply changes
51         virtual void apply();
52         /// update
53         virtual void update_contents();
54         /// build the dialog
55         virtual void build_dialog();
56 };
57
58 } // namespace frontend
59 } // namespace lyx
60
61 #endif // QLISTINGS_H