]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
some using changes small changes in lyxfont and some other things, read the Changelog
[lyx.git] / src / insets / insetspecialchar.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 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 using std::ostream;
22
23 struct LaTeXFeatures;
24
25 ///  Used to insert special chars
26 class InsetSpecialChar : public Inset {
27 public:
28
29         /// The different kinds of special chars we support
30         enum Kind {
31                 /// Optional hyphenation point (\-)
32                 HYPHENATION,
33                 /// ... (\ldots)
34                 LDOTS,
35                 /// End of sentence punctuation (\@)
36                 END_OF_SENTENCE,
37                 /// Menu separator
38                 MENU_SEPARATOR,
39 #if 0
40                 /// Newline
41                 NEWLINE,
42 #endif
43                 /// Protected Separator
44                 PROTECTED_SEPARATOR
45         };
46
47         ///
48         InsetSpecialChar() {}
49         ///
50         InsetSpecialChar(Kind k);
51         ///
52         int ascent(Painter &, LyXFont const &) const;
53         ///
54         int descent(Painter &, LyXFont const &) const;
55         ///
56         int width(Painter &, LyXFont const &) const;
57         ///
58         void draw(Painter &, LyXFont const &, int baseline, float & x) const;
59         ///
60         void Write(ostream &) const;
61         /// Will not be used when lyxf3
62         void Read(LyXLex & lex);
63         /// 
64         int Latex(ostream &, signed char fragile, bool free_spc) const;
65         ///
66         int Linuxdoc(ostream &) const;
67         ///
68         int DocBook(ostream &) const;
69         ///
70         Inset * Clone() const;
71         ///  
72         Inset::Code LyxCode() const
73         {
74                 return Inset::SPECIALCHAR_CODE;
75         }
76         /// We don't need \begin_inset and \end_inset
77         bool DirectWrite() const 
78         {
79                 return true;
80         };
81         ///
82         void Validate(LaTeXFeatures &) const;
83 private:
84         /// And which kind is this?
85         Kind kind;
86 };
87
88 #endif