]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiParagraph.h
07f0c4863dd0e61794dafa8e82b5c81dc81276ac
[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 // Uncomment this if you prefer dock widget
18 //#define USE_DOCK_WIDGET
19
20 #include "Layout.h"
21 #include "ui_ParagraphUi.h"
22 #include "DialogView.h"
23 #include "ParagraphParameters.h"
24 #include "GuiView.h"
25 #include "qt_helpers.h"
26 #include "support/debug.h"
27
28 #include <QCloseEvent>
29 #include <QDialog>
30 #include <QSettings>
31 #include <QShowEvent>
32 #include <QGridLayout>
33
34 #include <map>
35 #include <string>
36
37 namespace lyx {
38 namespace frontend {
39
40 class GuiParagraph
41         : public DialogView, public Ui::ParagraphUi
42 {
43         Q_OBJECT
44 public:
45         GuiParagraph(GuiView & lv);
46
47         /// Dialog inherited methods
48         //@{
49         void updateView();
50         void dispatchParams();
51         bool isBufferDependent() const { return true; }
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 haveMulitParSelection();
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