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
21 /** Insertion of accents
23 Proper handling of accented characters.
24 This is class is supposed to handle all LaTeX accents, it
25 is also possible that the class will change a bit so that
26 it also can handle other special characters (e.g. Hstroke)
27 Initiated by Ivan Schreter, later modified by Lgb.
29 class InsetLatexAccent : public Inset {
35 InsetLatexAccent(string const & string);
37 void dimension(BufferView *, LyXFont const &, Dimension &) const;
39 void draw(BufferView *, LyXFont const &, int, float &) const;
41 int lbearing(LyXFont const & font) const;
43 int rbearing(LyXFont const & font) const;
45 bool displayISO8859_9(BufferView *, LyXFont const & font,
46 int baseline, float & x) const;
48 void write(Buffer const *, std::ostream &) const;
50 void read(Buffer const *, LyXLex & lex);
52 int latex(Buffer const *, std::ostream &, LatexRunParams const &,
53 bool fragile, bool free_spc) const;
55 int ascii(Buffer const *, std::ostream &, int linelen) const;
57 int linuxdoc(Buffer const *, std::ostream &) const;
59 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
61 bool directWrite() const;
63 virtual Inset * clone(Buffer const &, bool same_id = false) const;
65 Inset::Code lyxCode()const;
67 inline bool canDisplay();
68 // should this inset be handled like a normal charater
69 bool isChar() const { return true; }
71 /// all the accent types
117 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
118 /// Check if we know the modifier and can display it ok on screen.
119 void checkContents();
122 /// can display as proper char
125 ACCENT_TYPES modtype;
127 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
129 /// add something to ascent - accent at the top
131 /// add something to descent - underlined char
133 /// international char
138 bool InsetLatexAccent::canDisplay()