]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiParagraph.h
getting rid of superfluous lyx::support:: statements.
[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         /// update
48         void updateView();
49
50 private:
51         ///
52         void checkAlignmentRadioButtons();
53         ///
54         void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
55         ///
56         LyXAlignment getAlignmentFromDialog();
57         ///
58         typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
59         RadioMap radioMap;
60         typedef std::map<LyXAlignment, docstring> AlignmentLabels;
61         AlignmentLabels labelMap;
62
63         QString const alignDefaultLabel;
64
65         void applyView() {}
66         void enableView(bool enable);
67
68         std::string name() const { return "paragraph"; }
69
70 private:
71         QString name_;
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
85 private:
86         ///
87         bool initialiseParams(std::string const & /*data*/) { return true; }
88         /// clean-up on hide.
89         void clearParams() {}
90         ///
91         void dispatchParams();
92         ///
93         bool isBufferDependent() const { return true; }
94         ///
95         ParagraphParameters & params();
96         ///
97         ParagraphParameters const & params() const;
98         ///
99         bool haveMulitParSelection();
100         ///
101         bool canIndent() const;
102         ///
103         LyXAlignment alignPossible() const;
104         ///
105         LyXAlignment alignDefault() const;
106
107 private:
108         ParagraphParameters multiparsel_;
109 };
110
111 } // namespace frontend
112 } // namespace lyx
113
114 #endif // QPARAGRAPH_H