]> git.lyx.org Git - lyx.git/blob - src/insets/insetlatexaccent.h
fixes because of SUN CC warnings, bmtable now compiled with C compilator, countChar...
[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         int Lbearing(LyXFont const & font) const;
46         ///
47         int Rbearing(LyXFont const & font) const;
48         ///
49         bool DisplayISO8859_9(LyXFont font, LyXScreen & scr,
50                               int baseline, float & x);
51         ///
52         void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
53         ///
54         void Write(ostream &);
55         ///
56         void Read(LyXLex & lex);
57         ///
58         int Latex(ostream &, signed char fragile);
59         ///
60         int Latex(string & file, signed char fragile);
61         ///
62         int Linuxdoc(string & file);
63         ///
64         int DocBook(string & file);
65         ///
66         bool Deletable() const;
67         ///
68         bool DirectWrite() const;
69         ///
70         Inset * Clone() const;
71         ///
72         Inset::Code LyxCode()const;
73         ///
74         inline bool CanDisplay();
75         /// all the accent types
76         enum ACCENT_TYPES{
77                 ///
78                 ACUTE, // 0
79                 ///
80                 GRAVE,
81                 ///
82                 MACRON,
83                 ///
84                 TILDE,
85                 ///
86                 UNDERBAR,
87                 ///
88                 CEDILLA, // 5
89                 ///
90                 UNDERDOT,
91                 ///
92                 CIRCLE,
93                 ///
94                 TIE,
95                 ///
96                 BREVE,
97                 ///
98                 CARON, // 10
99                 ///
100                 SPECIAL_CARON,
101                 ///
102                 HUNGARIAN_UMLAUT,
103                 ///
104                 UMLAUT,
105                 ///
106                 DOT,
107                 ///
108                 CIRCUMFLEX, // 15
109                 ///
110                 OGONEK,
111                 ///
112                 DOT_LESS_I,
113                 ///
114                 DOT_LESS_J, // 18
115                 ///
116                 lSLASH,
117                 ///
118                 LSLASH
119         };
120 private:
121         friend ostream & operator<<(ostream &, ACCENT_TYPES);
122         /// Check if we know the modifier and can display it ok on screen.
123         void checkContents();
124         ///
125         string contents;
126         /// can display as proper char
127         bool  candisp;
128         /// modifier type
129         ACCENT_TYPES  modtype;
130         
131         /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH
132         bool  remdot;
133         /// add something to ascent - accent at the top
134         bool  plusasc;
135         /// add something to descent - underlined char
136         bool  plusdesc;
137         /// international char
138         char  ic;    
139 };
140
141 bool InsetLatexAccent::CanDisplay()
142 {
143         return candisp;
144 }
145
146 #endif