]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlMath.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlMath.h
index b75369ebfbacf2c72872e01db32db7fa312c6f17..0f220775ae9b2f33555a4c80146f1f3262c46c03 100644 (file)
@@ -4,14 +4,55 @@
  * 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
+ * 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
+#ifndef CONTROLMATH_H
+#define CONTROLMATH_H
+
+
+#include "Dialog.h"
+#include "lfuns.h" // for kb_action
+
+namespace lyx {
+namespace frontend {
+
+class ControlMath : public Dialog::Controller {
+public:
+       ControlMath(Dialog &);
+
+       /// Nothing to initialise in this case.
+       virtual bool initialiseParams(std::string const &) { return true; }
+       virtual void clearParams() {}
+       virtual void dispatchParams() {}
+       virtual bool isBufferDependent() const { return true; }
+
+       /// dispatch an LFUN
+       void dispatchFunc(kb_action action, std::string const & arg = std::string()) const;
+       /// Insert a math symbol into the doc.
+       void dispatchInsert(std::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(std::string const & str) const;
+       /// Insert a delimiter
+       void dispatchDelim(std::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(std::string const & name) const;
+};
+
 
 extern char const * function_names[];
 extern int const nr_function_names;
@@ -25,6 +66,8 @@ extern char const * latex_dots[];
 extern int const nr_latex_dots;
 extern char const * latex_greek[];
 extern int const nr_latex_greek;
+extern char const * latex_deco[];
+extern int const nr_latex_deco;
 extern char const * latex_misc[];
 extern int const nr_latex_misc;
 extern char const * latex_varsz[];
@@ -40,4 +83,13 @@ extern int const nr_latex_ams_nrel;
 extern char const * latex_ams_ops[];
 extern int const nr_latex_ams_ops;
 
-#endif /* CONTROL_MATH_H */
+/**
+ * Return the mangled XPM filename of the given
+ * math symbol.
+ */
+std::string const find_xpm(std::string const & name);
+
+} // namespace frontend
+} // namespace lyx
+
+#endif // NOT CONTROLMATH