]> git.lyx.org Git - lyx.git/blob - src/insets/insetlatexaccent.h
the fstream/iostream changes and some small other things
[lyx.git] / src / insets / insetlatexaccent.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright (C) 1995 Matthias Ettrich
8  *
9  * ====================================================== */
10
11 #ifndef INSET_LATEX_ACCENT_H
12 #define INSET_LATEX_ACCENT_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "lyxinset.h"
19 #include "LString.h"
20 #include "lyxlex.h"
21
22 /** Insertion of accents
23   
24   Proper handling of accented characters.
25   This is class is supposed to handle all LaTeX accents, it
26   is also possible that the class will change a bit so that
27   it also can handle other special characters (e.g. Hstroke)
28   Initiated by Ivan Schreter, later modified by Lgb.
29   */
30 class InsetLatexAccent : public Inset {
31 public:
32         ///
33         InsetLatexAccent(); 
34         ///
35         InsetLatexAccent(string const & string);
36         ///
37         InsetLatexAccent(InsetLatexAccent const &);
38         ///
39         int Ascent(LyXFont const & font) const;
40         ///
41         int Descent(LyXFont const & font) const;
42         ///
43         int Width(LyXFont const & font) const;
44         ///
45         bool DisplayISO8859_9(LyXFont font, LyXScreen & scr,
46                               int baseline, float & x);
47         ///
48         void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
49         ///
50         void Write(ostream &);
51         ///
52         void Read(LyXLex & lex);
53         ///
54         int Latex(ostream &, signed char fragile);
55         ///
56         int Latex(string & file, signed char fragile);
57         ///
58         int Linuxdoc(string & file);
59         ///
60         int DocBook(string & file);
61         ///
62         bool Deletable() const;
63         ///
64         bool DirectWrite() const;
65         ///
66         Inset * Clone() const;
67         ///
68         Inset::Code LyxCode()const;
69         ///
70         inline bool CanDisplay();
71 private:
72         /// all the accent types
73         enum ACCENT_TYPES{
74                 ///
75                 ACUTE, // 0
76                 ///
77                 GRAVE,
78                 ///
79                 MACRON,
80                 ///
81                 TILDE,
82                 ///
83                 UNDERBAR,
84                 ///
85                 CEDILLA, // 5
86                 ///
87                 UNDERDOT,
88                 ///
89                 CIRCLE,
90                 ///
91                 TIE,
92                 ///
93                 BREVE,
94                 ///
95                 CARON, // 10
96                 ///
97                 SPECIAL_CARON,
98                 ///
99                 HUNGARIAN_UMLAUT,
100                 ///
101                 UMLAUT,
102                 ///
103                 DOT,
104                 ///
105                 CIRCUMFLEX, // 15
106                 ///
107                 OGONEK,
108                 ///
109                 DOT_LESS_I,
110                 ///
111                 DOT_LESS_J, // 18
112                 ///
113                 lSLASH,
114                 ///
115                 LSLASH
116         };
117
118         friend ostream & operator<<(ostream &, ACCENT_TYPES);
119         /// Check if we know the modifier and can display it ok on screen.
120         void checkContents();
121         ///
122         string contents;
123         /// can display as proper char
124         bool  candisp;
125         /// modifier type
126         ACCENT_TYPES  modtype;
127         
128         /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
129         bool  remdot;
130         /// add something to ascent - accent at the top
131         bool  plusasc;
132         /// add something to descent - underlined char
133         bool  plusdesc;
134         /// international char
135         char  ic;    
136 };
137
138 bool InsetLatexAccent::CanDisplay()
139 {
140         return candisp;
141 }
142
143 #endif