]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlMath.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlMath.h
1 // -*- C++ -*-
2 /**
3  * \file ControlMath.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  *
11  * ControlMath2 is a controller class for the Math Panel dialog.
12  */
13
14 #ifndef CONTROLMATH_H
15 #define CONTROLMATH_H
16
17
18 #include "Dialog.h"
19 #include "lfuns.h" // for kb_action
20
21 namespace lyx {
22 namespace frontend {
23
24 class ControlMath : public Dialog::Controller {
25 public:
26         ControlMath(Dialog &);
27
28         /// Nothing to initialise in this case.
29         virtual bool initialiseParams(std::string const &) { return true; }
30         virtual void clearParams() {}
31         virtual void dispatchParams() {}
32         virtual bool isBufferDependent() const { return true; }
33
34         /// dispatch an LFUN
35         void dispatchFunc(kb_action action, std::string const & arg = std::string()) const;
36         /// Insert a math symbol into the doc.
37         void dispatchInsert(std::string const & name) const;
38         /// Insert a subscript.
39         void dispatchSubscript() const;
40         /// Insert a superscript.
41         void dispatchSuperscript() const;
42         /// Insert a cube root
43         void dispatchCubeRoot() const;
44         /// Insert a matrix
45         void dispatchMatrix(std::string const & str) const;
46         /// Insert a delimiter
47         void dispatchDelim(std::string const & str) const;
48         /// Wwitch between display and inline
49         void dispatchToggleDisplay() const;
50         /** A request to the kernel to launch a dialog.
51          *  \param name the dialog identifier.
52          */
53         void showDialog(std::string const & name) const;
54 };
55
56
57 extern char const * function_names[];
58 extern int const nr_function_names;
59 extern char const * latex_arrow[];
60 extern int const nr_latex_arrow;
61 extern char const * latex_bop[];
62 extern int const nr_latex_bop;
63 extern char const * latex_brel[];
64 extern int const nr_latex_brel;
65 extern char const * latex_dots[];
66 extern int const nr_latex_dots;
67 extern char const * latex_greek[];
68 extern int const nr_latex_greek;
69 extern char const * latex_deco[];
70 extern int const nr_latex_deco;
71 extern char const * latex_misc[];
72 extern int const nr_latex_misc;
73 extern char const * latex_varsz[];
74 extern int const nr_latex_varsz;
75 extern char const * latex_ams_misc[];
76 extern int const nr_latex_ams_misc;
77 extern char const * latex_ams_arrows[];
78 extern int const nr_latex_ams_arrows;
79 extern char const * latex_ams_rel[];
80 extern int const nr_latex_ams_rel;
81 extern char const * latex_ams_nrel[];
82 extern int const nr_latex_ams_nrel;
83 extern char const * latex_ams_ops[];
84 extern int const nr_latex_ams_ops;
85
86 /**
87  * Return the mangled XPM filename of the given
88  * math symbol.
89  */
90 std::string const find_xpm(std::string const & name);
91
92 } // namespace frontend
93 } // namespace lyx
94
95 #endif // NOT CONTROLMATH