]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiParagraph.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiParagraph.h
index feddbbd709f967e072e362bc4ff0fe217d6304a2..408765bbe433c0472641b62ecd9ba28ad63e1f4a 100644 (file)
 #ifndef GUIPARAGRAPH_H
 #define GUIPARAGRAPH_H
 
-// Uncomment this if you prefer dock widget
-//#define USE_DOCK_WIDGET
-
-#include "Layout.h"
-#include "ui_ParagraphUi.h"
 #include "DialogView.h"
-#include "ParagraphParameters.h"
 #include "GuiView.h"
 #include "qt_helpers.h"
-#include "support/debug.h"
+#include "ui_ParagraphUi.h"
+
+#include "Layout.h"
+#include "ParagraphParameters.h"
 
-#include <QCloseEvent>
 #include <QDialog>
-#include <QSettings>
 #include <QShowEvent>
 #include <QGridLayout>
 
 #include <map>
-#include <string>
 
 namespace lyx {
 namespace frontend {
@@ -44,8 +38,17 @@ class GuiParagraph
 public:
        GuiParagraph(GuiView & lv);
 
-       /// update
+       /// 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:
        ///
@@ -53,22 +56,19 @@ private:
        ///
        void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
        ///
-       LyXAlignment getAlignmentFromDialog();
+       LyXAlignment getAlignmentFromDialog() const;
        ///
-       typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
-       RadioMap radioMap;
-       typedef std::map<LyXAlignment, docstring> AlignmentLabels;
-       AlignmentLabels labelMap;
-
-       QString const alignDefaultLabel;
-
-       void applyView() {}
-       void enableView(bool enable);
-
-       std::string name() const { return "paragraph"; }
-
-private:
-       QString name_;
+       ParagraphParameters const & params() const;
+       ///
+       bool haveMultiParSelection() const;
+       ///
+       bool canIndent() const;
+       ///
+       bool hasLabelwidth() const;
+       ///
+       LyXAlignment alignPossible() const;
+       ///
+       LyXAlignment alignDefault() const;
 
 private Q_SLOTS:
        ///
@@ -81,31 +81,21 @@ private Q_SLOTS:
        void on_linespacing_activated(int);
        /// Apply changes
        void on_applyPB_clicked();
+       /// Apply changes and close
+       void on_okPB_clicked();
+       /// Close/Cancel dialog
+       void on_closePB_clicked();
 
 private:
        ///
-       bool initialiseParams(std::string const & /*data*/) { return true; }
-       /// clean-up on hide.
-       void clearParams() {}
-       ///
-       void dispatchParams();
-       ///
-       bool isBufferDependent() const { return true; }
-       ///
-       ParagraphParameters & params();
-       ///
-       ParagraphParameters const & params() const;
-       ///
-       bool haveMulitParSelection();
+       typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
        ///
-       bool canIndent() const;
+       RadioMap radioMap_;
+
        ///
-       LyXAlignment alignPossible() const;
+       QString alignDefaultLabel_;
        ///
-       LyXAlignment alignDefault() const;
-
-private:
-       ParagraphParameters multiparsel_;
+       ParagraphParameters params_;
 };
 
 } // namespace frontend