]> git.lyx.org Git - features.git/blob - src/frontends/qt4/QParagraph.h
Whitespace cleanup
[features.git] / src / frontends / qt4 / QParagraph.h
1 // -*- C++ -*-
2 /**
3  * \file QParagraph.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QPARAGRAPH_H
14 #define QPARAGRAPH_H
15
16 #include "QDialogView.h"
17
18 #include "Layout.h"
19 #include "ui/ParagraphUi.h"
20
21 #include <QDialog>
22 #include <QCloseEvent>
23
24 #include <map>
25
26 namespace lyx {
27 namespace frontend {
28
29 class QParagraph;
30
31 class QParagraphDialog : public QDialog, public Ui::QParagraphUi {
32         Q_OBJECT
33 public:
34         QParagraphDialog(QParagraph * form);
35         ///
36         void checkAlignmentRadioButtons();
37         ///
38         void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
39         ///
40         LyXAlignment getAlignmentFromDialog();
41 protected:
42         void closeEvent (QCloseEvent * e);
43 private:
44         QParagraph * form_;
45         typedef std::map<LyXAlignment, QRadioButton *> QPRadioMap;
46         QPRadioMap radioMap;
47 protected Q_SLOTS:
48         ///
49         void change_adaptor();
50         ///
51         void enableLinespacingValue(int);
52         ///
53         void on_alignDefaultCB_toggled(bool);
54 };
55
56
57 class ControlParagraph;
58
59 class QParagraph
60         : public QController<ControlParagraph, QView<QParagraphDialog> >
61 {
62 public:
63         friend class QParagraphDialog;
64
65         QParagraph(Dialog &);
66 private:
67         /// Apply changes
68         virtual void apply();
69         /// update
70         virtual void update_contents();
71         /// build the dialog
72         virtual void build_dialog();
73 };
74
75 } // namespace frontend
76 } // namespace lyx
77
78 #endif // QPARAGRAPH_H