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