2 /* This file is part of*
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
9 * ====================================================== */
11 #ifndef INSET_LATEX_ACCENT_H
12 #define INSET_LATEX_ACCENT_H
22 /** Insertion of accents
24 Proper handling of accented characters.
25 This is class is supposed to handle all LaTeX accents, it
26 is also possible that the class will change a bit so that
27 it also can handle other special characters (e.g. Hstroke)
28 Initiated by Ivan Schreter, later modified by Lgb.
30 class InsetLatexAccent : public Inset {
36 InsetLatexAccent(string const & string);
38 int ascent(BufferView *, LyXFont const &) const;
40 int descent(BufferView *, LyXFont const &) const;
42 int width(BufferView *, LyXFont const &) const;
44 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
46 int lbearing(LyXFont const & font) const;
48 int rbearing(LyXFont const & font) const;
50 bool displayISO8859_9(BufferView *, LyXFont const & font,
51 int baseline, float & x) const;
53 void write(Buffer const *, std::ostream &) const;
55 void read(Buffer const *, LyXLex & lex);
57 int latex(Buffer const *, std::ostream &,
58 bool fragile, bool free_spc) const;
60 int ascii(Buffer const *, std::ostream &, int linelen) const;
62 int linuxdoc(Buffer const *, std::ostream &) const;
64 int docbook(Buffer const *, std::ostream &) const;
66 bool deletable() const;
68 bool directWrite() const;
70 virtual Inset * clone(Buffer const &, bool same_id = false) const;
72 Inset::Code lyxCode()const;
74 inline bool canDisplay();
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()