]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiParagraph.h
* fix spelling in comments to please John.
[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 <QShowEvent>
27 #include <QGridLayout>
28
29 #include <map>
30
31 namespace lyx {
32 namespace frontend {
33
34 class GuiParagraph
35         : public DialogView, public Ui::ParagraphUi
36 {
37         Q_OBJECT
38 public:
39         GuiParagraph(GuiView & lv);
40
41         /// Dialog inherited methods
42         //@{
43         void applyView();
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         void saveSession() const;
50         void restoreSession();
51         //@}
52
53 private:
54         ///
55         void checkAlignmentRadioButtons();
56         ///
57         void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
58         ///
59         LyXAlignment getAlignmentFromDialog() const;
60         ///
61         ParagraphParameters const & params() const;
62         ///
63         bool haveMultiParSelection() const;
64         ///
65         bool canIndent() const;
66         ///
67         bool hasLabelwidth() const;
68         ///
69         LyXAlignment alignPossible() const;
70         ///
71         LyXAlignment alignDefault() const;
72
73 private Q_SLOTS:
74         ///
75         void changed();
76         ///
77         void on_synchronizedViewCB_toggled();
78         ///
79         void on_restorePB_clicked();
80         ///
81         void on_linespacing_activated(int);
82         /// Apply changes
83         void on_applyPB_clicked();
84         /// Apply changes and close
85         void on_okPB_clicked();
86         /// Close/Cancel dialog
87         void on_closePB_clicked();
88
89 private:
90         ///
91         typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
92         ///
93         RadioMap radioMap_;
94
95         ///
96         QString alignDefaultLabel_;
97         ///
98         ParagraphParameters params_;
99 };
100
101 } // namespace frontend
102 } // namespace lyx
103
104 #endif // QPARAGRAPH_H