]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsPanel.h
get rid of broken_header.h and some unneeded tests
[lyx.git] / src / frontends / xforms / FormMathsPanel.h
index e1a4fd3853fa684b82ab9c5881121a0b7cd45f1a..48427cff873588a3ea6258205d798921edbd202b 100644 (file)
  *
  * \author Alejandro Aguilar Sierra
  * \author John Levon
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef FORM_MATHSPANEL_H
 #define FORM_MATHSPANEL_H
 
-#include "commandtags.h"
+#include "FormDialogView.h"
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+namespace lyx {
+namespace frontend {
 
-#include "FormBaseDeprecated.h"
-
-#include <boost/shared_ptr.hpp>
-#include <map>
-
-class FormMathsBitmap;
-class FormMathsSub;
+class ControlMath;
 struct FD_maths_panel;
 
 /**
  * This class provides an XForms implementation of the maths panel.
  */
-class FormMathsPanel : public FormBaseBD {
+class FormMathsPanel
+       : public FormController<ControlMath, FormView<FD_maths_panel> > {
 public:
        ///
-       FormMathsPanel(LyXView &, Dialogs &);
-       /// dispatch an LFUN:
-       void dispatchFunc(kb_action action,
-                         string const & arg = string()) const;
-       /// dispatch a symbol insert
-       void insertSymbol(string const & sym, bool bs = true) const;
+       FormMathsPanel(Dialog &);
 
 private:
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc();
-
-       /// Build the dialog
-       virtual void build();
-       /// input handler
-       virtual bool input(FL_OBJECT *, long);
-
-       /// Pointer to the actual instantiation of the xforms form
-       virtual FL_FORM * form() const;
-
-       // Real GUI implementation
-       boost::scoped_ptr<FD_maths_panel> dialog_;
-
-       /** Add a bitmap dialog to the store of all daughters_ and
-        *  return a pointer to the dialog, so that bitmaps can be added to it.
-        */
-       FormMathsBitmap * addDaughter(FL_OBJECT * button, string const & title,
-                                     char const * const * data, int size);
-
+       /// Not needed.
+       virtual void apply() {}
        ///
-       void showDaughter(FL_OBJECT *);
+       virtual void update() {}
 
        ///
-       typedef boost::shared_ptr<FormMathsSub> DaughterDialog;
-       typedef std::map<FL_OBJECT *, DaughterDialog> Store;
-
-       /** The store of all daughter dialogs.
-        *  The map uses the button on the main panel to identify them.
-        */
-       Store daughters_;
-
-       /// A pointer to the currently active daughter dialog.
-       FormMathsSub * active_;
-
-       /// The ButtonController.
-       ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
-};
-
-
-class FormMathsSub : public FormBaseBD {
-public:
-       ///
-       FormMathsSub(LyXView &, Dialogs &, FormMathsPanel const &,
-                    string const &, bool allowResize = true);
-
+       virtual void build();
        ///
-       bool isVisible() const;
-
-protected:
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc();
-       /// The parent Maths Panel
-       FormMathsPanel const & parent_;
-private:
-       /// The ButtonController
-       ButtonController<IgnorantPolicy, xformsBC> bc_;
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
 };
 
+} // namespace frontend
+} // namespace lyx
 
-inline
-xformsBC & FormMathsSub::bc()
-{
-       return bc_;
-}
-
-inline
-xformsBC & FormMathsPanel::bc()
-{
-       return bc_;
-}
 #endif //  FORM_MATHSPANEL_H