]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiParagraph.h
Speed up exit time
[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 "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         LyXAlignment alignDefault() const;
65
66 private Q_SLOTS:
67         ///
68         void changed();
69         ///
70         void on_synchronizedViewCB_toggled();
71         ///
72         void on_restorePB_clicked();
73         ///
74         void on_linespacing_activated(int);
75         /// Apply changes
76         void on_applyPB_clicked();
77         /// Apply changes and close
78         void on_okPB_clicked();
79         /// Close/Cancel dialog
80         void on_closePB_clicked();
81
82 private:
83         ///
84         typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
85         ///
86         RadioMap radioMap_;
87
88         ///
89         QString alignDefaultLabel_;
90         ///
91         ParagraphParameters params_;
92 };
93
94 } // namespace frontend
95 } // namespace lyx
96
97 #endif // QPARAGRAPH_H