]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QListings.h
e9eb84854b7b3a0c964878471d75de42124bf350
[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         /// turn off inline when float is clicked
38         void on_floatCB_stateChanged(int state);
39         /// turn off float when inline is clicked
40         void on_inlineCB_stateChanged(int state);
41 protected:
42         virtual void closeEvent(QCloseEvent * e);
43 private:
44         QListings * form_;
45 };
46
47
48 class ControlListings;
49
50 class QListings : public QController<ControlListings, QView<QListingsDialog> > {
51 public:
52         friend class QListingsDialog;
53
54         QListings(Dialog &);
55 private:
56         /// Apply changes
57         virtual void apply();
58         /// update
59         virtual void update_contents();
60         /// build the dialog
61         virtual void build_dialog();
62 };
63
64 } // namespace frontend
65 } // namespace lyx
66
67 #endif // QLISTINGS_H