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 {
35 InsetLatexAccent(string const & string);
37 int ascent(Painter &, LyXFont const &) const;
39 int descent(Painter &, LyXFont const &) const;
41 int width(Painter &, LyXFont const &) const;
43 void draw(Painter &, LyXFont const &, int baseline, float & x) const;
45 int Lbearing(LyXFont const & font) const;
47 int Rbearing(LyXFont const & font) const;
49 bool DisplayISO8859_9(Painter &, LyXFont const & font,
50 int baseline, float & x) const;
52 void Write(ostream &) const;
54 void Read(LyXLex & lex);
56 int Latex(ostream &, signed char fragile) const;
57 #ifndef USE_OSTREAM_ONLY
59 int Latex(string & file, signed char fragile) const;
61 int Linuxdoc(string & file) const;
63 int DocBook(string & file) const;
66 int Linuxdoc(ostream &) const;
68 int DocBook(ostream &) const;
71 bool Deletable() const;
73 bool DirectWrite() const;
75 Inset * Clone() const;
77 Inset::Code LyxCode()const;
79 inline bool CanDisplay();
80 /// all the accent types
126 friend ostream & operator<<(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
146 bool InsetLatexAccent::CanDisplay()