]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiParagraph.h
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiParagraph.h
index ff6cdccff857ae37a457ba3ec761b8d4fc383786..ee9a06bf9976b29ae22822c3f26253d753384515 100644 (file)
@@ -6,6 +6,7 @@
  *
  * \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 "support/debug.h"
+
+#include <QDialog>
+#include <QSettings>
+#include <QShowEvent>
+#include <QGridLayout>
+
 #include <map>
+#include <string>
 
 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 updateView();
+       void dispatchParams();
+       void enableView(bool enable);
+       bool isBufferDependent() const { return true; }
+       virtual kb_action getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
+       //@}
+
+private:
        ///
        void checkAlignmentRadioButtons();
        ///
        void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
        ///
        LyXAlignment getAlignmentFromDialog();
-private:
        ///
-       void closeEvent(QCloseEvent * e);
+       ParagraphParameters & params();
+       ///
+       ParagraphParameters const & params() const;
+       ///
+       bool haveMultiParSelection();
+       ///
+       bool canIndent() const;
+       ///
+       LyXAlignment alignPossible() const;
+       ///
+       LyXAlignment alignDefault() const;
+
+private Q_SLOTS:
+       ///
+       void changed();
+       ///
+       void on_synchronizedViewCB_toggled();
+       ///
+       void on_restorePB_clicked();
+       ///
+       void on_linespacing_activated(int);
+       /// Apply changes
+       void on_applyPB_clicked();
+
+private:
        ///
        typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
+       ///
        RadioMap radioMap;
        ///
        typedef std::map<LyXAlignment, docstring> AlignmentLabels;
+       ///
        AlignmentLabels labelMap;
-               
-private Q_SLOTS:
        ///
-       void change_adaptor();
+       QString const alignDefaultLabel;
        ///
-       void enableLinespacingValue(int);
-       /// parent controller
-       ControlParagraph & controller();
-       /// Apply changes
-       void applyView();
-       /// update
-       void updateContents();
+       ParagraphParameters multiparsel_;
 };
 
 } // namespace frontend