]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
410b66ed16d7478d05d35dbbef6046bc847acbfa
[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 #if 0
38                 /// Newline
39                 NEWLINE,
40 #endif
41                 /// Protected Separator
42                 PROTECTED_SEPARATOR
43         };
44
45         ///
46         InsetSpecialChar() {}
47         ///
48         InsetSpecialChar(Kind k);
49         ///
50         int ascent(Painter &, LyXFont const &) const;
51         ///
52         int descent(Painter &, LyXFont const &) const;
53         ///
54         int width(Painter &, LyXFont const &) const;
55         ///
56         void draw(Painter &, LyXFont const &, int baseline, float & x) const;
57         ///
58         void Write(ostream &) const;
59         /// Will not be used when lyxf3
60         void Read(LyXLex & lex);
61         /// 
62         int Latex(ostream &, signed char fragile) const;
63 #ifndef USE_OSTREAM_ONLY
64         ///
65         int Latex(string & file, signed char fragile) const;
66 #endif
67         ///
68         int Linuxdoc(string & file) const;
69         ///
70         int DocBook(string & file) const;
71         ///
72         Inset * Clone() const;
73         ///  
74         Inset::Code LyxCode() const
75         {
76                 return Inset::SPECIALCHAR_CODE;
77         }
78         /// We don't need \begin_inset and \end_inset
79         bool DirectWrite() const 
80         {
81                 return true;
82         };
83         ///
84         void Validate(LaTeXFeatures &) const;
85 private:
86         /// And which kind is this?
87         Kind kind;
88 };
89
90 #endif