]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiBox.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiBox.h
index cba4d4b45d2a8d15d34d6cec8f7cfb21afa346ac..813454a4d493598700c3f4e0fc79b5623e7bc5ae 100644 (file)
@@ -4,8 +4,8 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Jürgen Spitzmüller
- * \ author Martin Vermeer
+ * \author Jürgen Spitzmüller
+ * \author Martin Vermeer (with useful hints from Angus Leeming)
  *
  * Full author contact details are available in file CREDITS.
  */
 #ifndef GUIBOX_H
 #define GUIBOX_H
 
-#include "GuiDialogView.h"
-#include "ControlBox.h"
+#include "GuiDialog.h"
 #include "ui_BoxUi.h"
-
-#include <QDialog>
-
-#include <vector>
+#include "insets/InsetBox.h"
 
 
 namespace lyx {
 namespace frontend {
 
-class GuiBox;
-
-class GuiBoxDialog : public QDialog, public Ui::BoxUi {
+class GuiBox : public GuiDialog, public Ui::BoxUi
+{
        Q_OBJECT
+
 public:
-       GuiBoxDialog(GuiBox * form);
-protected Q_SLOTS:
-       virtual void change_adaptor();
-       virtual void innerBoxChanged(const QString &);
-       virtual void typeChanged(int);
-       virtual void restoreClicked();
-protected:
-       virtual void closeEvent(QCloseEvent * e);
-private:
-       GuiBox * form_;
-};
+       GuiBox(GuiView & lv);
 
+private Q_SLOTS:
+       void change_adaptor();
+       void innerBoxChanged(QString const &);
+       void typeChanged(int);
+       void restoreClicked();
+       void pagebreakClicked();
 
-class GuiBox : public GuiView<GuiBoxDialog>
-{
-public:
-       ///
-       GuiBox(GuiDialog &);
-       /// parent controller
-       ControlBox & controller()
-       { return static_cast<ControlBox &>(this->getController()); }
-       /// parent controller
-       ControlBox const & controller() const
-       { return static_cast<ControlBox const &>(this->getController()); }
+private:
        /// add and remove special lengths
        void setSpecial(bool ibox);
        /// only show valid inner box items
        void setInnerType(bool frameless, int i);
-private:
-       ///
-       friend class GuiBoxDialog;
+
        /// Apply changes
-       virtual void applyView();
+       void applyView();
        /// update
-       virtual void update_contents();
-       /// build the dialog
-       virtual void build_dialog();
+       void updateContents();
+
+       ///
+       bool initialiseParams(std::string const & data);
        ///
-       std::vector<std::string> ids_;
+       void clearParams();
        ///
-       std::vector<docstring> gui_names_;
+       void dispatchParams();
        ///
-       std::vector<std::string> ids_spec_;
+       bool isBufferDependent() const { return true; }
+
+       ///
+       QStringList ids_;
+       ///
+       QStringList gui_names_;
+       ///
+       QStringList ids_spec_;
+       ///
+       QStringList gui_names_spec_;
+
        ///
-       std::vector<docstring> gui_names_spec_;
+       InsetBoxParams params_;
 };
 
 } // namespace frontend