3 * \file insetlatexaccent.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_LATEX_ACCENT_H
13 #define INSET_LATEX_ACCENT_H
20 /** Insertion of accents
22 Proper handling of accented characters.
23 This is class is supposed to handle all LaTeX accents, it
24 is also possible that the class will change a bit so that
25 it also can handle other special characters (e.g. Hstroke)
26 Initiated by Ivan Schreter, later modified by Lgb.
28 class InsetLatexAccent : public InsetOld {
34 InsetLatexAccent(std::string const & str);
36 void metrics(MetricsInfo &, Dimension &) const;
38 void draw(PainterInfo & pi, int x, int y) const;
40 int lbearing(LyXFont const & font) const;
42 int rbearing(LyXFont const & font) const;
44 bool displayISO8859_9(PainterInfo & pi, int x, int y) const;
46 void write(Buffer const &, std::ostream &) const;
48 void read(Buffer const &, LyXLex & lex);
50 int latex(Buffer const &, std::ostream &,
51 LatexRunParams const &) const;
53 int ascii(Buffer const &, std::ostream &, int linelen) const;
55 int linuxdoc(Buffer const &, std::ostream &) const;
57 int docbook(Buffer const &, std::ostream &, bool mixcont) const;
59 bool directWrite() const;
61 virtual std::auto_ptr<InsetBase> clone() const;
63 InsetOld::Code lyxCode()const;
65 inline bool canDisplay();
66 // should this inset be handled like a normal charater
67 bool isChar() const { return true; }
69 /// all the accent types
115 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
116 /// Check if we know the modifier and can display it ok on screen.
117 void checkContents();
119 std::string contents;
120 /// can display as proper char
123 ACCENT_TYPES modtype;
125 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
127 /// add something to ascent - accent at the top
129 /// add something to descent - underlined char
131 /// international char
136 bool InsetLatexAccent::canDisplay()