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;
61 QString const alignDefaultLabel;
69 void showData(std::string const & data)
71 initialiseParams(data);
76 updateView(); // make sure its up-to-date
81 bool isVisibleView() const { return QDialog::isVisible(); }
82 void checkStatus() { updateView(); }
83 void redraw() { redrawView(); }
85 void updateData(std::string const & data)
87 initialiseParams(data);
90 void partialUpdateView(int /*id*/) {}
91 std::string name() const { return "paragraph"; }
96 void showEvent(QShowEvent * e)
98 #if (QT_VERSION >= 0x040200)
100 std::string key = name_ + "/geometry";
101 QDialog::restoreGeometry(settings.value(key.c_str()).toByteArray());
103 QDialog::showEvent(e);
106 void closeEvent(QCloseEvent * e)
108 #if (QT_VERSION >= 0x040200)
110 std::string key = name_ + "/geometry";
111 settings.setValue(key.c_str(), QDialog::saveGeometry());
113 QDialog::closeEvent(e);
120 void on_synchronizedViewCB_toggled();
122 void on_restorePB_clicked();
124 void on_linespacing_activated(int);
126 void on_applyPB_clicked();
130 bool initialiseParams(std::string const & /*data*/) { return true; }
131 /// clean-up on hide.
132 void clearParams() {}
134 void dispatchParams();
136 bool isBufferDependent() const { return true; }
138 ParagraphParameters & params();
140 ParagraphParameters const & params() const;
142 bool haveMulitParSelection();
144 bool canIndent() const;
146 LyXAlignment alignPossible() const;
148 LyXAlignment alignDefault() const;
151 ParagraphParameters multiparsel_;
154 } // namespace frontend
157 #endif // QPARAGRAPH_H