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