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