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