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
18 #include "ui_ParagraphUi.h"
20 #include "ParagraphParameters.h"
22 #include "qt_helpers.h"
25 #include <QCloseEvent>
29 #include <QGridLayout>
38 : public QDialog, public Ui::ParagraphUi, public Controller, public Dialog
42 GuiParagraph(LyXView & lv);
49 void checkAlignmentRadioButtons();
51 void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
53 LyXAlignment getAlignmentFromDialog();
55 Controller & controller() { return *this; }
57 typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
60 QString const alignDefaultLabel;
68 void showData(std::string const & data)
70 initialiseParams(data);
75 updateView(); // make sure its up-to-date
80 bool isVisibleView() const { return QDialog::isVisible(); }
81 void checkStatus() { updateView(); }
82 void redraw() { redrawView(); }
84 void updateData(std::string const & data)
86 initialiseParams(data);
89 void partialUpdateView(int /*id*/) {}
90 std::string name() const { return "paragraph"; }
95 void showEvent(QShowEvent * e)
97 #if (QT_VERSION >= 0x040200)
99 std::string key = name_ + "/geometry";
100 QDialog::restoreGeometry(settings.value(key.c_str()).toByteArray());
102 QDialog::showEvent(e);
105 void closeEvent(QCloseEvent * e)
107 #if (QT_VERSION >= 0x040200)
109 std::string key = name_ + "/geometry";
110 settings.setValue(key.c_str(), QDialog::saveGeometry());
112 QDialog::closeEvent(e);
119 void on_synchronizedViewCB_toggled();
121 void on_restorePB_clicked();
123 void on_linespacing_activated(int);
125 void on_applyPB_clicked();
129 bool initialiseParams(std::string const & /*data*/) { return true; }
130 /// clean-up on hide.
131 void clearParams() {}
133 void dispatchParams();
135 bool isBufferDependent() const { return true; }
137 ParagraphParameters & params();
139 ParagraphParameters const & params() const;
141 bool haveMulitParSelection();
143 bool canIndent() const;
145 LyXAlignment alignPossible() const;
147 LyXAlignment alignDefault() const;
150 ParagraphParameters multiparsel_;
153 } // namespace frontend
156 #endif // QPARAGRAPH_H