]> git.lyx.org Git - lyx.git/blob - src/insets/insetlatexaccent.h
get rid of same_id from function signatures
[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
16 #include "inset.h"
17 #include "LString.h"
18
19 class LyXLex;
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 Inset {
30 public:
31         ///
32         InsetLatexAccent();
33         ///
34         explicit
35         InsetLatexAccent(string const & string);
36         ///
37         void dimension(BufferView *, LyXFont const &, Dimension &) const;
38         ///
39         void draw(BufferView *, LyXFont const &, int, float &) const;
40         ///
41         int lbearing(LyXFont const & font) const;
42         ///
43         int rbearing(LyXFont const & font) const;
44         ///
45         bool displayISO8859_9(BufferView *, LyXFont const & font,
46                               int baseline, float & x) const;
47         ///
48         void write(Buffer const *, std::ostream &) const;
49         ///
50         void read(Buffer const *, LyXLex & lex);
51         ///
52         int latex(Buffer const *, std::ostream &,
53                   LatexRunParams const &) const;
54         ///
55         int ascii(Buffer const *, std::ostream &, int linelen) const;
56         ///
57         int linuxdoc(Buffer const *, std::ostream &) const;
58         ///
59         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
60         ///
61         bool directWrite() const;
62         ///
63         virtual Inset * clone(Buffer const &) const;
64         ///
65         //virtual Inset * clone(Buffer const &, bool same_id) const;
66         ///
67         Inset::Code lyxCode()const;
68         ///
69         inline bool canDisplay();
70         // should this inset be handled like a normal charater
71         bool isChar() const { return true; }
72
73         /// all the accent types
74         enum ACCENT_TYPES{
75                 ///
76                 ACUTE, // 0
77                 ///
78                 GRAVE,
79                 ///
80                 MACRON,
81                 ///
82                 TILDE,
83                 ///
84                 UNDERBAR,
85                 ///
86                 CEDILLA, // 5
87                 ///
88                 UNDERDOT,
89                 ///
90                 CIRCLE,
91                 ///
92                 TIE,
93                 ///
94                 BREVE,
95                 ///
96                 CARON, // 10
97                 ///
98                 SPECIAL_CARON,
99                 ///
100                 HUNGARIAN_UMLAUT,
101                 ///
102                 UMLAUT,
103                 ///
104                 DOT,
105                 ///
106                 CIRCUMFLEX, // 15
107                 ///
108                 OGONEK,
109                 ///
110                 DOT_LESS_I,
111                 ///
112                 DOT_LESS_J, // 18
113                 ///
114                 lSLASH,
115                 ///
116                 LSLASH
117         };
118 private:
119         friend std::ostream & operator<<(std::ostream &, ACCENT_TYPES);
120         /// Check if we know the modifier and can display it ok on screen.
121         void checkContents();
122         ///
123         string contents;
124         /// can display as proper char
125         bool  candisp;
126         /// modifier type
127         ACCENT_TYPES  modtype;
128
129         /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
130         bool  remdot;
131         /// add something to ascent - accent at the top
132         bool  plusasc;
133         /// add something to descent - underlined char
134         bool  plusdesc;
135         /// international char
136         mutable char  ic;
137 };
138
139
140 bool InsetLatexAccent::canDisplay()
141 {
142         return candisp;
143 }
144
145 #endif