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