4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUIPARAGRAPH_H
15 #define GUIPARAGRAPH_H
17 // Uncomment this if you prefer dock widget
18 //#define USE_DOCK_WIDGET
21 #include "ui_ParagraphUi.h"
23 #include "ParagraphParameters.h"
25 #include "qt_helpers.h"
28 #include <QCloseEvent>
32 #include <QGridLayout>
41 : public QDialog, public Ui::ParagraphUi, public Dialog
45 GuiParagraph(LyXView & lv);
52 void checkAlignmentRadioButtons();
54 void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
56 LyXAlignment getAlignmentFromDialog();
58 typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
60 typedef std::map<LyXAlignment, docstring> AlignmentLabels;
61 AlignmentLabels labelMap;
63 QString const alignDefaultLabel;
71 void showData(std::string const & data)
73 initialiseParams(data);
78 updateView(); // make sure its up-to-date
83 bool isVisibleView() const { return QDialog::isVisible(); }
84 void checkStatus() { updateView(); }
85 void redraw() { redrawView(); }
87 void updateData(std::string const & data)
89 initialiseParams(data);
92 void partialUpdateView(int /*id*/) {}
93 std::string name() const { return "paragraph"; }
98 void showEvent(QShowEvent * e)
101 QString key = name_ + "/geometry";
102 QDialog::restoreGeometry(settings.value(key).toByteArray());
103 QDialog::showEvent(e);
106 void closeEvent(QCloseEvent * e)
109 QString key = name_ + "/geometry";
110 settings.setValue(key, QDialog::saveGeometry());
111 QDialog::closeEvent(e);
118 void on_synchronizedViewCB_toggled();
120 void on_restorePB_clicked();
122 void on_linespacing_activated(int);
124 void on_applyPB_clicked();
128 bool initialiseParams(std::string const & /*data*/) { return true; }
129 /// clean-up on hide.
130 void clearParams() {}
132 void dispatchParams();
134 bool isBufferDependent() const { return true; }
136 ParagraphParameters & params();
138 ParagraphParameters const & params() const;
140 bool haveMulitParSelection();
142 bool canIndent() const;
144 LyXAlignment alignPossible() const;
146 LyXAlignment alignDefault() const;
149 ParagraphParameters multiparsel_;
152 } // namespace frontend
155 #endif // QPARAGRAPH_H