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 int ascent(BufferView *, LyXFont const &) const;
39 int descent(BufferView *, LyXFont const &) const;
41 int width(BufferView *, LyXFont const &) const;
43 void draw(BufferView *, LyXFont const &, int, float &) const;
45 int lbearing(LyXFont const & font) const;
47 int rbearing(LyXFont const & font) const;
49 bool displayISO8859_9(BufferView *, LyXFont const & font,
50 int baseline, float & x) const;
52 void write(Buffer const *, std::ostream &) const;
54 void read(Buffer const *, LyXLex & lex);
56 int latex(Buffer const *, std::ostream &,
57 bool fragile, bool free_spc) const;
59 int ascii(Buffer const *, std::ostream &, int linelen) const;
61 int linuxdoc(Buffer const *, std::ostream &) const;
63 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
65 bool directWrite() const;
67 virtual Inset * clone(Buffer const &, bool same_id = false) const;
69 Inset::Code lyxCode()const;
71 inline bool canDisplay();
72 // should this inset be handled like a normal charater
73 bool isChar() const { return true; }
75 /// all the accent types
121 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
122 /// Check if we know the modifier and can display it ok on screen.
123 void checkContents();
126 /// can display as proper char
129 ACCENT_TYPES modtype;
131 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
133 /// add something to ascent - accent at the top
135 /// add something to descent - underlined char
137 /// international char
142 bool InsetLatexAccent::canDisplay()