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(GuiView & 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 updateData(std::string const & data)
87 initialiseParams(data);
90 std::string name() const { return "paragraph"; }
95 void showEvent(QShowEvent * e)
98 QString key = name_ + "/geometry";
99 QDialog::restoreGeometry(settings.value(key).toByteArray());
100 QDialog::showEvent(e);
103 void closeEvent(QCloseEvent * e)
106 QString key = name_ + "/geometry";
107 settings.setValue(key, QDialog::saveGeometry());
108 QDialog::closeEvent(e);
115 void on_synchronizedViewCB_toggled();
117 void on_restorePB_clicked();
119 void on_linespacing_activated(int);
121 void on_applyPB_clicked();
125 bool initialiseParams(std::string const & /*data*/) { return true; }
126 /// clean-up on hide.
127 void clearParams() {}
129 void dispatchParams();
131 bool isBufferDependent() const { return true; }
133 ParagraphParameters & params();
135 ParagraphParameters const & params() const;
137 bool haveMulitParSelection();
139 bool canIndent() const;
141 LyXAlignment alignPossible() const;
143 LyXAlignment alignDefault() const;
146 ParagraphParameters multiparsel_;
149 } // namespace frontend
152 #endif // QPARAGRAPH_H