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/types.h"
24 /** Insertion of accents
26 Proper handling of accented characters.
27 This is class is supposed to handle all LaTeX accents, it
28 is also possible that the class will change a bit so that
29 it also can handle other special characters (e.g. Hstroke)
30 Initiated by Ivan Schreter, later modified by Lgb.
32 class InsetLatexAccent : public InsetOld {
37 explicit InsetLatexAccent(std::string const & str);
39 void metrics(MetricsInfo &, Dimension &) const;
41 void draw(PainterInfo & pi, int x, int y) 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 &, odocstream &,
50 OutputParams const &) const;
52 int plaintext(Buffer const &, odocstream &,
53 OutputParams const &) const;
55 int docbook(Buffer const &, odocstream &,
56 OutputParams const &) const;
57 /// the string that is passed to the TOC
58 virtual int textString(Buffer const &, odocstream &,
59 OutputParams const &) const;
61 bool directWrite() const;
63 InsetBase::Code lyxCode()const;
65 inline bool canDisplay();
66 // should this inset be handled like a normal charater
67 bool isChar() const { return true; }
69 /// is this equivalent to a letter?
70 virtual bool isLetter() const { return candisp; }
72 /// all the accent types
118 friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
120 virtual std::auto_ptr<InsetBase> doClone() const;
122 /// Check if we know the modifier and can display it ok on screen.
123 void checkContents();
125 void drawAccent(PainterInfo const & pi, int x, int y, char_type accent) const;
127 std::string contents;
128 /// can display as proper char
131 ACCENT_TYPES modtype;
133 /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
135 /// add something to ascent - accent at the top
137 /// add something to descent - underlined char
139 /// international char
144 bool InsetLatexAccent::canDisplay()