]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlMath.h
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlMath.h
index 597ab179ecb1fb6edad1e29b54aabfe3017cbcc8..615298b9a52369c69d0322d2f1b70c20dff7263a 100644 (file)
@@ -4,99 +4,51 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Alejandro Aguilar Sierra
- * \author John Levon
  * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
+ *
+ * ControlMath2 is a controller class for the Math Panel dialog.
  */
 
-#ifndef CONTROL_MATH_H
-#define CONTROL_MATH_H
-
-#include "commandtags.h"
-#include "ControlDialog_impl.h"
-
-#include "ButtonController.h"
-#include "ButtonPolicies.h"
+#ifndef CONTROLMATH_H
+#define CONTROLMATH_H
 
-#include "LString.h"
-#include <boost/shared_ptr.hpp>
-#include <map>
 
+#include "Dialog.h"
+#include "lfuns.h" // for kb_action
 
-class GUIMathSub;
 
-
-class ControlMath : public ControlDialogBD {
+class ControlMath : public Dialog::Controller {
 public:
-       ///
-       ControlMath(LyXView &, Dialogs &);
-
-       /// dispatch an LFUN
-       void dispatchFunc(kb_action act, string const & arg = string()) const;
-       /// dispatch a symbol insert
-       void insertSymbol(string const & sym, bool bs = true) const;
-
-       ///
-       void addDaughter(void * key, ViewBase * v, ButtonControllerBase * bc);
-       ///
-       void showDaughter(void *);
-       
-private:
-       ///
-       virtual void apply();
-
-       ///
-       typedef boost::shared_ptr<GUIMathSub> DaughterPtr;
-       ///
-       typedef std::map<void *, DaughterPtr> 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.
-       GUIMathSub * active_;
-};
-
+       ControlMath(Dialog &);
 
-class ControlMathSub : public ControlDialogBD {
-public:
-       ///
-       ControlMathSub(LyXView &, Dialogs &, ControlMath const & p);
+       /// Nothing to initialise in this case.
+       virtual bool initialiseParams(string const &) { return true; }
+       virtual void clearParams() {}
+       virtual void dispatchParams() {}
+       virtual bool isBufferDependent() const { return true; }
 
        /// dispatch an LFUN
-       void dispatchFunc(kb_action act, string const & arg = string()) const;
-       /// dispatch a symbol insert
-       void insertSymbol(string const & sym, bool bs = true) const;
-
-private:
-       ///
-       virtual void apply();
-       ///
-       ControlMath const & parent_;
-};
-
-
-class GUIMathSub {
-public:
-       ///
-       GUIMathSub(LyXView & lv, Dialogs & d,
-                  ControlMath const & p,
-                  ViewBase * v,
-                  ButtonControllerBase * bc);
-       ///
-       ControlMathSub & controller() { return controller_; }
-
-private:
-       ///
-       ControlMathSub controller_;
-       ///
-       boost::scoped_ptr<ButtonControllerBase> bc_;
-       ///
-       boost::scoped_ptr<ViewBase> view_;
+       void dispatchFunc(kb_action action, string const & arg = string()) const;
+       /// Insert a math symbol into the doc.
+       void dispatchInsert(string const & name) const;
+       /// Insert a subscript.
+       void dispatchSubscript() const;
+       /// Insert a superscript.
+       void dispatchSuperscript() const;
+       /// Insert a cube root
+       void dispatchCubeRoot() const;
+       /// Insert a matrix
+       void dispatchMatrix(string const & str) const;
+       /// Insert a delimiter
+       void dispatchDelim(string const & str) const;
+       /// Wwitch between display and inline
+       void dispatchToggleDisplay() const;
+       /** A request to the kernel to launch a dialog.
+        *  \param name the dialog identifier.
+        */
+       void showDialog(string const & name) const;
 };
 
 
@@ -134,5 +86,5 @@ extern int const nr_latex_ams_ops;
  * math symbol.
  */
 string const find_xpm(string const & name);
-#endif /* CONTROL_MATH_H */
+
+#endif // NOT CONTROLMATH