* GuiParagraph.{cpp, h}:
[lyx.git] / src / frontends / qt4 / GuiParagraph.h
blob335fc23cd9ec1d93065007e3c72fc29a5ff5abba
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.
7 * \author Edwin Leuven
8 * \author John Levon
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUIPARAGRAPH_H
15 #define GUIPARAGRAPH_H
17 #include "DialogView.h"
18 #include "GuiView.h"
19 #include "qt_helpers.h"
20 #include "ui_ParagraphUi.h"
22 #include "Layout.h"
23 #include "ParagraphParameters.h"
25 #include <QDialog>
26 #include <QSettings>
27 #include <QShowEvent>
28 #include <QGridLayout>
30 #include <map>
32 namespace lyx {
33 namespace frontend {
35 class GuiParagraph
36 : public DialogView, public Ui::ParagraphUi
38 Q_OBJECT
39 public:
40 GuiParagraph(GuiView & lv);
42 /// Dialog inherited methods
43 //@{
44 void applyView();
45 void updateView();
46 void dispatchParams();
47 void enableView(bool enable);
48 bool isBufferDependent() const { return true; }
49 virtual FuncCode getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
50 void saveSession() const;
51 void restoreSession();
52 //@}
54 private:
55 ///
56 void checkAlignmentRadioButtons();
57 ///
58 void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
59 ///
60 LyXAlignment getAlignmentFromDialog() const;
61 ///
62 ParagraphParameters const & params() const;
63 ///
64 bool haveMultiParSelection() const;
65 ///
66 bool canIndent() const;
67 ///
68 bool hasLabelwidth() const;
69 ///
70 LyXAlignment alignPossible() const;
71 ///
72 LyXAlignment alignDefault() const;
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 /// Apply changes and close
86 void on_okPB_clicked();
87 /// Close/Cancel dialog
88 void on_closePB_clicked();
90 private:
91 ///
92 typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
93 ///
94 RadioMap radioMap_;
96 ///
97 QString alignDefaultLabel_;
98 ///
99 ParagraphParameters params_;
102 } // namespace frontend
103 } // namespace lyx
105 #endif // QPARAGRAPH_H