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.
15 #include "GuiDialog.h"
17 #include "FontEnums.h"
27 MathSymbol(char_type uc = '?', unsigned char fc = 0,
28 FontFamily ff = SYMBOL_FAMILY)
29 : unicode(uc), fontcode(fc), fontfamily(ff)
32 unsigned char fontcode;
33 FontFamily fontfamily;
37 class GuiMath : public GuiDialog
40 GuiMath(GuiView & lv, QString const & name, QString const & title);
42 /// Nothing to initialise in this case.
43 bool initialiseParams(std::string const &) { return true; }
45 void dispatchParams() {}
46 bool isBufferDependent() const { return true; }
49 void dispatchFunc(FuncCode action,
50 std::string const & arg = std::string()) const;
51 /// Insert a math symbol into the doc.
52 void dispatchInsert(std::string const & name) const;
53 /// Insert a subscript.
54 void dispatchSubscript() const;
55 /// Insert a superscript.
56 void dispatchSuperscript() const;
57 /// Insert a cube root
58 void dispatchCubeRoot() const;
60 void dispatchMatrix(std::string const & str) const;
61 /// Insert a variable size delimiter
62 void dispatchDelim(std::string const & str) const;
63 /// Insert a big delimiter
64 void dispatchBigDelim(std::string const & str) const;
65 /// Switch between display and inline
66 void dispatchToggleDisplay() const;
67 /** A request to the kernel to launch a dialog.
68 * \param name the dialog identifier.
70 void showDialog(std::string const & name) const;
72 /// \return the math unicode symbol associated to a TeX name.
73 MathSymbol const & mathSymbol(std::string tex_name) const;
74 /// \return the TeX name associated to a math unicode symbol.
75 std::string const & texName(char_type math_symbol) const;
78 /// TeX-name / Math-symbol map.
79 std::map<std::string, MathSymbol> math_symbols_;
80 /// Math-symbol / TeX-name map.
81 /// This one is for fast search, it contains the same data as
83 std::map<char_type, std::string> tex_names_;
87 } // namespace frontend