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
24 /** Insertion of accents
26 Proper handling of accented characters.
27 This is class is supposed to handle all LaTeX accents, it
28 is also possible that the class will change a bit so that
29 it also can handle other special characters (e.g. Hstroke)
30 Initiated by Ivan Schreter, later modified by Lgb.
32 class InsetLatexAccent : public Inset {
38 InsetLatexAccent(string const & string);
40 int ascent(BufferView *, LyXFont const &) const;
42 int descent(BufferView *, LyXFont const &) const;
44 int width(BufferView *, LyXFont const &) const;
46 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
48 int lbearing(LyXFont const & font) const;
50 int rbearing(LyXFont const & font) const;
52 bool displayISO8859_9(BufferView *, LyXFont const & font,
53 int baseline, float & x) const;
55 void write(Buffer const *, std::ostream &) const;
57 void read(Buffer const *, LyXLex & lex);
59 int latex(Buffer const *, std::ostream &,
60 bool fragile, bool free_spc) const;
62 int ascii(Buffer const *, std::ostream &, int linelen) const;
64 int linuxdoc(Buffer const *, std::ostream &) const;
66 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
68 bool deletable() const;
70 bool directWrite() const;
72 virtual Inset * clone(Buffer const &, bool same_id = false) const;
74 Inset::Code lyxCode()const;
76 inline bool canDisplay();
77 // should this inset be handled like a normal charater
78 bool isChar() const { return true; }
80 /// all the accent types
126 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
127 /// Check if we know the modifier and can display it ok on screen.
128 void checkContents();
131 /// can display as proper char
134 ACCENT_TYPES modtype;
136 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
138 /// add something to ascent - accent at the top
140 /// add something to descent - underlined char
142 /// international char
147 bool InsetLatexAccent::canDisplay()