]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
fix the outstanding painter drawing problems, now tablelines, mathframe, specialchars...
[lyx.git] / src / insets / insetspecialchar.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright (C) 1997 Asger Alstrup
8  *
9  * ====================================================== */
10
11 #ifndef INSET_SPECIALCHAR_H
12 #define INSET_SPECIALCHAR_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "lyxinset.h"
19 #include "LString.h"
20
21 struct LaTeXFeatures;
22
23 ///  Used to insert special chars
24 class InsetSpecialChar : public Inset {
25 public:
26
27         /// The different kinds of special chars we support
28         enum Kind {
29                 /// Optional hyphenation point (\-)
30                 HYPHENATION,
31                 /// ... (\ldots)
32                 LDOTS,
33                 /// End of sentence punctuation (\@)
34                 END_OF_SENTENCE,
35                 /// Menu separator
36                 MENU_SEPARATOR
37         };
38
39         ///
40         InsetSpecialChar() {}
41         ///
42         InsetSpecialChar(Kind k);
43 #ifdef USE_PAINTER
44         ///
45         int ascent(Painter &, LyXFont const &) const;
46         ///
47         int descent(Painter &, LyXFont const &) const;
48         ///
49         int width(Painter &, LyXFont const &) const;
50         ///
51         void draw(Painter &, LyXFont const &, int baseline, float & x) const;
52 #else
53         ///
54         int Ascent(LyXFont const & font) const;
55         ///
56         int Descent(LyXFont const & font) const;
57         ///
58         int Width(LyXFont const & font) const;
59         ///
60         void Draw(LyXFont, LyXScreen & scr, int baseline, float & x);
61 #endif
62         ///
63         void Write(ostream &);
64         /// Will not be used when lyxf3
65         void Read(LyXLex & lex);
66         /// 
67         int Latex(ostream &, signed char fragile);
68         ///
69         int Latex(string & file, signed char fragile);
70         ///
71         int Linuxdoc(string & file);
72         ///
73         int DocBook(string & file);
74         ///
75         Inset * Clone() const;
76         ///  
77         Inset::Code LyxCode() const
78         {
79                 return Inset::NO_CODE;
80         }
81         /// We don't need \begin_inset and \end_inset
82         bool DirectWrite() const 
83         {
84                 return true;
85         };
86         ///
87         void Validate(LaTeXFeatures &) const;
88 private:
89         /// And which kind is this?
90         Kind kind;
91 };
92
93 #endif