]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiParagraph.h
949fcc868bee6d46d5d4f471e9cd1ff4a1ff2871
[lyx.git] / src / frontends / qt4 / GuiParagraph.h
1 // -*- C++ -*-
2 /**
3  * \file GuiParagraph.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  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUIPARAGRAPH_H
15 #define GUIPARAGRAPH_H
16
17 #include "DialogView.h"
18 #include "GuiView.h"
19 #include "qt_helpers.h"
20 #include "ui_ParagraphUi.h"
21
22 #include "Layout.h"
23 #include "ParagraphParameters.h"
24
25 #include <QDialog>
26 #include <QSettings>
27 #include <QShowEvent>
28 #include <QGridLayout>
29
30 #include <map>
31
32 namespace lyx {
33 namespace frontend {
34
35 class GuiParagraph
36         : public DialogView, public Ui::ParagraphUi
37 {
38         Q_OBJECT
39 public:
40         GuiParagraph(GuiView & lv);
41
42         /// Dialog inherited methods
43         //@{
44         void updateView();
45         void dispatchParams();
46         void enableView(bool enable);
47         bool isBufferDependent() const { return true; }
48         virtual FuncCode getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
49         //@}
50
51 private:
52         ///
53         void checkAlignmentRadioButtons();
54         ///
55         void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
56         ///
57         LyXAlignment getAlignmentFromDialog();
58         ///
59         ParagraphParameters & params();
60         ///
61         ParagraphParameters const & params() const;
62         ///
63         bool haveMultiParSelection();
64         ///
65         bool canIndent() const;
66         ///
67         LyXAlignment alignPossible() const;
68         ///
69         LyXAlignment alignDefault() const;
70
71 private Q_SLOTS:
72         ///
73         void changed();
74         ///
75         void on_synchronizedViewCB_toggled();
76         ///
77         void on_restorePB_clicked();
78         ///
79         void on_linespacing_activated(int);
80         /// Apply changes
81         void on_applyPB_clicked();
82
83 private:
84         ///
85         typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
86         ///
87         RadioMap radioMap_;
88
89         ///
90         QString alignDefaultLabel_;
91         ///
92         ParagraphParameters multiparsel_;
93 };
94
95 } // namespace frontend
96 } // namespace lyx
97
98 #endif // QPARAGRAPH_H