]> git.lyx.org Git - lyx.git/blob - src/insets/insetlatexaccent.h
Remove all unnecessary #includes from header files.
[lyx.git] / src / insets / insetlatexaccent.h
1 // -*- C++ -*-
2 /**
3  * \file insetlatexaccent.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_LATEX_ACCENT_H
13 #define INSET_LATEX_ACCENT_H
14
15 #include "inset.h"
16 #include "support/std_string.h"
17
18 class Dimension;
19
20
21 /** Insertion of accents
22
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.
28   */
29 class InsetLatexAccent : public InsetOld {
30 public:
31         ///
32         InsetLatexAccent();
33         ///
34         explicit
35         InsetLatexAccent(string const & string);
36         ///
37         void metrics(MetricsInfo &, Dimension &) const;
38         ///
39         void draw(PainterInfo & pi, int x, int y) const;
40         ///
41         int lbearing(LyXFont const & font) const;
42         ///
43         int rbearing(LyXFont const & font) const;
44         ///
45         bool displayISO8859_9(PainterInfo & pi, int x, int y) const;
46         ///
47         void write(Buffer const &, std::ostream &) const;
48         ///
49         void read(Buffer const &, LyXLex & lex);
50         ///
51         int latex(Buffer const &, std::ostream &,
52                   LatexRunParams const &) const;
53         ///
54         int ascii(Buffer const &, std::ostream &, int linelen) const;
55         ///
56         int linuxdoc(Buffer const &, std::ostream &) const;
57         ///
58         int docbook(Buffer const &, std::ostream &, bool mixcont) const;
59         ///
60         bool directWrite() const;
61         ///
62         virtual std::auto_ptr<InsetBase> clone() const;
63         ///
64         InsetOld::Code lyxCode()const;
65         ///
66         inline bool canDisplay();
67         // should this inset be handled like a normal charater
68         bool isChar() const { return true; }
69
70         /// all the accent types
71         enum ACCENT_TYPES{
72                 ///
73                 ACUTE, // 0
74                 ///
75                 GRAVE,
76                 ///
77                 MACRON,
78                 ///
79                 TILDE,
80                 ///
81                 UNDERBAR,
82                 ///
83                 CEDILLA, // 5
84                 ///
85                 UNDERDOT,
86                 ///
87                 CIRCLE,
88                 ///
89                 TIE,
90                 ///
91                 BREVE,
92                 ///
93                 CARON, // 10
94                 ///
95                 SPECIAL_CARON,
96                 ///
97                 HUNGARIAN_UMLAUT,
98                 ///
99                 UMLAUT,
100                 ///
101                 DOT,
102                 ///
103                 CIRCUMFLEX, // 15
104                 ///
105                 OGONEK,
106                 ///
107                 DOT_LESS_I,
108                 ///
109                 DOT_LESS_J, // 18
110                 ///
111                 lSLASH,
112                 ///
113                 LSLASH
114         };
115 private:
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();
119         ///
120         string contents;
121         /// can display as proper char
122         bool  candisp;
123         /// modifier type
124         ACCENT_TYPES  modtype;
125
126         /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
127         bool  remdot;
128         /// add something to ascent - accent at the top
129         bool  plusasc;
130         /// add something to descent - underlined char
131         bool  plusdesc;
132         /// international char
133         mutable char  ic;
134 };
135
136
137 bool InsetLatexAccent::canDisplay()
138 {
139         return candisp;
140 }
141
142 #endif