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.
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 ControlMath : public Controller {
38 ControlMath(Dialog &);
40 /// Nothing to initialise in this case.
41 virtual bool initialiseParams(std::string const &) { return true; }
42 virtual void clearParams() {}
43 virtual void dispatchParams() {}
44 virtual bool isBufferDependent() const { return true; }
47 void dispatchFunc(kb_action action, std::string const & arg = std::string()) const;
48 /// Insert a math symbol into the doc.
49 void dispatchInsert(std::string const & name) const;
50 /// Insert a subscript.
51 void dispatchSubscript() const;
52 /// Insert a superscript.
53 void dispatchSuperscript() const;
54 /// Insert a cube root
55 void dispatchCubeRoot() const;
57 void dispatchMatrix(std::string const & str) const;
58 /// Insert a variable size delimiter
59 void dispatchDelim(std::string const & str) const;
60 /// Insert a big delimiter
61 void dispatchBigDelim(std::string const & str) const;
62 /// Switch between display and inline
63 void dispatchToggleDisplay() const;
64 /** A request to the kernel to launch a dialog.
65 * \param name the dialog identifier.
67 void showDialog(std::string const & name) const;
69 /// \return the math unicode symbol associated to a TeX name.
70 MathSymbol const & mathSymbol(std::string tex_name) const;
71 /// \return the TeX name associated to a math unicode symbol.
72 std::string const & texName(char_type math_symbol) const;
75 /// TeX-name / Math-symbol map.
76 std::map<std::string, MathSymbol> math_symbols_;
77 /// Math-symbol / TeX-name map.
78 /// This one is for fast search, it contains the same data as
80 std::map<char_type, std::string> tex_names_;
84 } // namespace frontend
87 #endif // NOT CONTROLMATH