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(Painter &, LyXFont const &) const;
40 int descent(Painter &, LyXFont const &) const;
42 int width(Painter &, LyXFont const &) const;
44 void draw(Painter &, LyXFont const &, int baseline, float & x) const;
46 int Lbearing(LyXFont const & font) const;
48 int Rbearing(LyXFont const & font) const;
50 bool DisplayISO8859_9(Painter &, LyXFont const & font,
51 int baseline, float & x) const;
53 void Write(std::ostream &) const;
55 void Read(LyXLex & lex);
57 int Latex(std::ostream &, signed char fragile, bool free_spc) const;
59 int Linuxdoc(std::ostream &) const;
61 int DocBook(std::ostream &) const;
63 bool Deletable() const;
65 bool DirectWrite() const;
67 Inset * Clone() const;
69 Inset::Code LyxCode()const;
71 inline bool CanDisplay();
72 /// all the accent types
118 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
119 /// Check if we know the modifier and can display it ok on screen.
120 void checkContents();
123 /// can display as proper char
126 ACCENT_TYPES modtype;
128 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
130 /// add something to ascent - accent at the top
132 /// add something to descent - underlined char
134 /// international char
138 bool InsetLatexAccent::CanDisplay()