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