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
17 #include "dimension.h"
19 /** Insertion of accents
21 Proper handling of accented characters.
22 This is class is supposed to handle all LaTeX accents, it
23 is also possible that the class will change a bit so that
24 it also can handle other special characters (e.g. Hstroke)
25 Initiated by Ivan Schreter, later modified by Lgb.
27 class InsetLatexAccent : public Inset {
33 InsetLatexAccent(string const & string);
35 void metrics(MetricsInfo &, Dimension &) const;
37 void draw(PainterInfo & pi, int x, int y) const;
39 int lbearing(LyXFont const & font) const;
41 int rbearing(LyXFont const & font) const;
43 bool displayISO8859_9(PainterInfo & pi, int x, int y) const;
45 void write(Buffer const *, std::ostream &) const;
47 void read(Buffer const *, LyXLex & lex);
49 int latex(Buffer const *, std::ostream &,
50 LatexRunParams const &) const;
52 int ascii(Buffer const *, std::ostream &, int linelen) const;
54 int linuxdoc(Buffer const *, std::ostream &) const;
56 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
58 bool directWrite() const;
60 virtual InsetBase * clone() const;
62 Inset::Code lyxCode()const;
64 inline bool canDisplay();
65 // should this inset be handled like a normal charater
66 bool isChar() const { return true; }
68 /// all the accent types
114 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
115 /// Check if we know the modifier and can display it ok on screen.
116 void checkContents();
119 /// can display as proper char
122 ACCENT_TYPES modtype;
124 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
126 /// add something to ascent - accent at the top
128 /// add something to descent - underlined char
130 /// international char
135 bool InsetLatexAccent::canDisplay()