*
* \author Edwin Leuven
* \author John Levon
+ * \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef GUIPARAGRAPH_H
#define GUIPARAGRAPH_H
-#include "GuiDialog.h"
-#include "ControlParagraph.h"
-#include "Layout.h"
+#include "DialogView.h"
+#include "GuiView.h"
+#include "qt_helpers.h"
#include "ui_ParagraphUi.h"
+#include "Layout.h"
+#include "ParagraphParameters.h"
+
+#include <QDialog>
+#include <QShowEvent>
+#include <QGridLayout>
+
#include <map>
namespace lyx {
namespace frontend {
-class GuiParagraphDialog : public GuiDialog, public Ui::ParagraphUi
+class GuiParagraph
+ : public DialogView, public Ui::ParagraphUi
{
Q_OBJECT
public:
- GuiParagraphDialog(LyXView & lv);
+ GuiParagraph(GuiView & lv);
+
+ /// Dialog inherited methods
+ //@{
+ void applyView();
+ void updateView();
+ void dispatchParams();
+ void enableView(bool enable);
+ bool isBufferDependent() const { return true; }
+ virtual FuncCode getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
+ void saveSession() const;
+ void restoreSession();
+ //@}
+
+private:
///
void checkAlignmentRadioButtons();
///
void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
///
- LyXAlignment getAlignmentFromDialog();
-private:
+ LyXAlignment getAlignmentFromDialog() const;
///
- void closeEvent(QCloseEvent * e);
+ ParagraphParameters const & params() const;
///
- typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
- RadioMap radioMap;
+ bool haveMultiParSelection() const;
+ ///
+ bool canIndent() const;
+ ///
+ bool hasLabelwidth() const;
+ ///
+ LyXAlignment alignPossible() const;
///
- typedef std::map<LyXAlignment, docstring> AlignmentLabels;
- AlignmentLabels labelMap;
-
+ LyXAlignment alignDefault() const;
+
private Q_SLOTS:
///
- void change_adaptor();
+ void changed();
+ ///
+ void on_synchronizedViewCB_toggled();
+ ///
+ void on_restorePB_clicked();
///
- void enableLinespacingValue(int);
- /// parent controller
- ControlParagraph & controller();
+ void on_linespacing_activated(int);
/// Apply changes
- void applyView();
- /// update
- void updateContents();
+ void on_applyPB_clicked();
+ /// Apply changes and close
+ void on_okPB_clicked();
+ /// Close/Cancel dialog
+ void on_closePB_clicked();
+
+private:
+ ///
+ typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
+ ///
+ RadioMap radioMap_;
+
+ ///
+ QString alignDefaultLabel_;
+ ///
+ ParagraphParameters params_;
};
} // namespace frontend