]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiHSpace.h
Revert "Mark some intentional fall-throughs (in a way understandable to gcc)"
[lyx.git] / src / frontends / qt4 / GuiHSpace.h
index 5b0bdece3ba698a077922f5e29715f871890cb7f..9be11ab6896c92eeceed25c6432add9bc633e36f 100644 (file)
 #ifndef GUIHSPACE_H
 #define GUIHSPACE_H
 
-#include "GuiDialog.h"
+#include "InsetParamsWidget.h"
 #include "ui_HSpaceUi.h"
-#include "insets/InsetSpace.h"
 
 namespace lyx {
 namespace frontend {
 
-class GuiHSpace : public GuiDialog, public Ui::HSpaceUi
+class GuiHSpace : public InsetParamsWidget, public Ui::HSpaceUi
 {
        Q_OBJECT
 
 public:
-       GuiHSpace(GuiView & lv, bool math);
+       GuiHSpace(bool math_mode, QWidget * parent = 0);
 
 private Q_SLOTS:
        ///
-       void change_adaptor();
+       void changedSlot();
        ///
-       void enableWidgets(int);
-       ///
-       void patternChanged();
+       void enableWidgets() const;
 
 private:
-       ///
-       void setMath(bool custom);
-       /// Apply from dialog
-       void applyView();
-       /// Update the dialog
-       void updateContents();
-       ///
-       bool isValid();
-       ///
-       bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
-       void clearParams();
-       /// clean-up on hide.
-       void dispatchParams();
-       ///
-       bool isBufferDependent() const { return true; }
-
-       ///
-       InsetSpaceParams params_;
+       /// \name InsetParamsWidget inherited methods
+       //@{
+       InsetCode insetCode() const { return math_mode_ ? MATH_SPACE_CODE : SPACE_CODE; }
+       FuncCode creationCode() const { return LFUN_INSET_INSERT; }
+       QString dialogTitle() const { return qt_("Horizontal Space Settings"); }
+       void paramsToDialog(Inset const *);
+       docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
+       //@}
+       ///
+       bool const math_mode_;
 };
 
 } // namespace frontend