4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
17 #include "lfuns.h" // for kb_action
26 MathSymbol(char_type uc = '?', unsigned char fc = 0,
27 Font::FONT_FAMILY ff = Font::SYMBOL_FAMILY)
28 : unicode(uc), fontcode(fc), fontfamily(ff)
31 unsigned char fontcode;
32 Font::FONT_FAMILY fontfamily;
35 class ControlMath : public Dialog::Controller {
37 ControlMath(Dialog &);
39 /// Nothing to initialise in this case.
40 virtual bool initialiseParams(std::string const &) { return true; }
41 virtual void clearParams() {}
42 virtual void dispatchParams() {}
43 virtual bool isBufferDependent() const { return true; }
46 void dispatchFunc(kb_action action, std::string const & arg = std::string()) const;
47 /// Insert a math symbol into the doc.
48 void dispatchInsert(std::string const & name) const;
49 /// Insert a subscript.
50 void dispatchSubscript() const;
51 /// Insert a superscript.
52 void dispatchSuperscript() const;
53 /// Insert a cube root
54 void dispatchCubeRoot() const;
56 void dispatchMatrix(std::string const & str) const;
57 /// Insert a variable size delimiter
58 void dispatchDelim(std::string const & str) const;
59 /// Insert a big delimiter
60 void dispatchBigDelim(std::string const & str) const;
61 /// Switch between display and inline
62 void dispatchToggleDisplay() const;
63 /** A request to the kernel to launch a dialog.
64 * \param name the dialog identifier.
66 void showDialog(std::string const & name) const;
68 /// \return the math unicode symbol associated to a TeX name.
69 MathSymbol const & mathSymbol(std::string tex_name) const;
70 /// \return the TeX name associated to a math unicode symbol.
71 std::string const & texName(char_type math_symbol) const;
74 /// TeX-name / Math-symbol map.
75 std::map<std::string, MathSymbol> math_symbols_;
76 /// Math-symbol / TeX-name map.
77 /// This one is for fast search, it contains the same data as
79 std::map<char_type, std::string> tex_names_;
83 extern char const * function_names[];
84 extern int const nr_function_names;
85 extern char const * latex_arrow[];
86 extern int const nr_latex_arrow;
87 extern char const * latex_bop[];
88 extern int const nr_latex_bop;
89 extern char const * latex_brel[];
90 extern int const nr_latex_brel;
91 extern char const * latex_dots[];
92 extern int const nr_latex_dots;
93 extern char const * latex_greek[];
94 extern int const nr_latex_greek;
95 extern char const * latex_deco[];
96 extern int const nr_latex_deco;
97 extern char const * latex_misc[];
98 extern int const nr_latex_misc;
99 extern char const * latex_varsz[];
100 extern int const nr_latex_varsz;
101 extern char const * latex_ams_misc[];
102 extern int const nr_latex_ams_misc;
103 extern char const * latex_ams_arrows[];
104 extern int const nr_latex_ams_arrows;
105 extern char const * latex_ams_rel[];
106 extern int const nr_latex_ams_rel;
107 extern char const * latex_ams_nrel[];
108 extern int const nr_latex_ams_nrel;
109 extern char const * latex_ams_ops[];
110 extern int const nr_latex_ams_ops;
111 extern char const * latex_delimiters[];
112 extern int const nr_latex_delimiters;
115 * Return the mangled XPM filename of the given
118 std::string const find_xpm(std::string const & name);
120 } // namespace frontend
123 #endif // NOT CONTROLMATH