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)
100 #if (QT_VERSION >= 0x040200)
102 std::string key = name_ + "/geometry";
103 QDialog::restoreGeometry(settings.value(key.c_str()).toByteArray());
105 QDialog::showEvent(e);
108 void closeEvent(QCloseEvent * e)
110 #if (QT_VERSION >= 0x040200)
112 std::string key = name_ + "/geometry";
113 settings.setValue(key.c_str(), QDialog::saveGeometry());
115 QDialog::closeEvent(e);
122 void on_synchronizedViewCB_toggled();
124 void on_restorePB_clicked();
126 void on_linespacing_activated(int);
128 void on_applyPB_clicked();
132 bool initialiseParams(std::string const & /*data*/) { return true; }
133 /// clean-up on hide.
134 void clearParams() {}
136 void dispatchParams();
138 bool isBufferDependent() const { return true; }
140 ParagraphParameters & params();
142 ParagraphParameters const & params() const;
144 bool haveMulitParSelection();
146 bool canIndent() const;
148 LyXAlignment alignPossible() const;
150 LyXAlignment alignDefault() const;
153 ParagraphParameters multiparsel_;
156 } // namespace frontend
159 #endif // QPARAGRAPH_H