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
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;
36 class GuiMath : public GuiDialog, public Controller
39 GuiMath(LyXView & lv, std::string const & name);
41 /// Nothing to initialise in this case.
42 bool initialiseParams(std::string const &) { return true; }
44 void dispatchParams() {}
45 bool isBufferDependent() const { return true; }
47 Controller & controller() { return *this; }
50 void dispatchFunc(kb_action action,
51 std::string const & arg = std::string()) const;
52 /// Insert a math symbol into the doc.
53 void dispatchInsert(std::string const & name) const;
54 /// Insert a subscript.
55 void dispatchSubscript() const;
56 /// Insert a superscript.
57 void dispatchSuperscript() const;
58 /// Insert a cube root
59 void dispatchCubeRoot() const;
61 void dispatchMatrix(std::string const & str) const;
62 /// Insert a variable size delimiter
63 void dispatchDelim(std::string const & str) const;
64 /// Insert a big delimiter
65 void dispatchBigDelim(std::string const & str) const;
66 /// Switch between display and inline
67 void dispatchToggleDisplay() const;
68 /** A request to the kernel to launch a dialog.
69 * \param name the dialog identifier.
71 void showDialog(std::string const & name) const;
73 /// \return the math unicode symbol associated to a TeX name.
74 MathSymbol const & mathSymbol(std::string tex_name) const;
75 /// \return the TeX name associated to a math unicode symbol.
76 std::string const & texName(char_type math_symbol) const;
79 /// TeX-name / Math-symbol map.
80 std::map<std::string, MathSymbol> math_symbols_;
81 /// Math-symbol / TeX-name map.
82 /// This one is for fast search, it contains the same data as
84 std::map<char_type, std::string> tex_names_;
88 } // namespace frontend