]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiParagraph.h
do what the FIXME suggested
[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 "support/debug.h"
26
27 #include <QDialog>
28 #include <QSettings>
29 #include <QShowEvent>
30 #include <QGridLayout>
31
32 #include <map>
33 #include <string>
34
35 namespace lyx {
36 namespace frontend {
37
38 class GuiParagraph
39         : public DialogView, public Ui::ParagraphUi
40 {
41         Q_OBJECT
42 public:
43         GuiParagraph(GuiView & lv);
44
45         /// Dialog inherited methods
46         //@{
47         void updateView();
48         void dispatchParams();
49         void enableView(bool enable);
50         bool isBufferDependent() const { return true; }
51         virtual kb_action getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
52         //@}
53
54 private:
55         ///
56         void checkAlignmentRadioButtons();
57         ///
58         void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
59         ///
60         LyXAlignment getAlignmentFromDialog();
61         ///
62         ParagraphParameters & params();
63         ///
64         ParagraphParameters const & params() const;
65         ///
66         bool haveMultiParSelection();
67         ///
68         bool canIndent() const;
69         ///
70         LyXAlignment alignPossible() const;
71         ///
72         LyXAlignment alignDefault() const;
73
74 private Q_SLOTS:
75         ///
76         void changed();
77         ///
78         void on_synchronizedViewCB_toggled();
79         ///
80         void on_restorePB_clicked();
81         ///
82         void on_linespacing_activated(int);
83         /// Apply changes
84         void on_applyPB_clicked();
85
86 private:
87         ///
88         typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
89         ///
90         RadioMap radioMap;
91         ///
92         typedef std::map<LyXAlignment, docstring> AlignmentLabels;
93         ///
94         AlignmentLabels labelMap;
95         ///
96         QString const alignDefaultLabel;
97         ///
98         ParagraphParameters multiparsel_;
99 };
100
101 } // namespace frontend
102 } // namespace lyx
103
104 #endif // QPARAGRAPH_H