]> git.lyx.org Git - features.git/blob - src/frontends/qt/GuiParagraph.h
#10571 improved handling of WM's signal when switching from or to full-screen window
[features.git] / src / frontends / qt / 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 "ui_ParagraphUi.h"
19
20 #include "ParagraphParameters.h"
21
22 #include <map>
23
24 namespace lyx {
25 namespace frontend {
26
27 class GuiParagraph
28         : public DialogView, public Ui::ParagraphUi
29 {
30         Q_OBJECT
31 public:
32         GuiParagraph(GuiView & lv);
33
34         /// Dialog inherited methods
35         //@{
36         void applyView();
37         void updateView();
38         void dispatchParams();
39         void enableView(bool enable);
40         bool isBufferDependent() const { return true; }
41         virtual FuncCode getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
42         void saveSession(QSettings & settings) const;
43         void restoreSession();
44         //@}
45
46 private:
47         ///
48         void checkAlignmentRadioButtons();
49         ///
50         void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
51         ///
52         LyXAlignment getAlignmentFromDialog() const;
53         ///
54         ParagraphParameters const & params() const;
55         ///
56         bool haveMultiParSelection() const;
57         ///
58         bool canIndent() const;
59         ///
60         bool hasLabelwidth() const;
61         ///
62         LyXAlignment alignPossible() const;
63
64 private Q_SLOTS:
65         ///
66         void changed();
67         ///
68         void on_synchronizedViewCB_toggled();
69         ///
70         void on_linespacing_activated(int);
71         /// Apply changes
72         void on_buttonBox_clicked(QAbstractButton * button);
73
74 private:
75         ///
76         typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
77         ///
78         RadioMap radioMap_;
79
80         ///
81         QString alignDefaultLabel_;
82         ///
83         ParagraphParameters params_;
84 };
85
86 } // namespace frontend
87 } // namespace lyx
88
89 #endif // QPARAGRAPH_H