]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
rename hyphenation-break to ligature-break
[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 "inset.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                 /// Ligature break point (\textcompwordmark)
32                 LIGATURE_BREAK,
33                 /// ... (\ldots)
34                 LDOTS,
35                 /// End of sentence punctuation (\@)
36                 END_OF_SENTENCE,
37                 /// Menu separator
38                 MENU_SEPARATOR,
39                 /// Protected Separator
40                 PROTECTED_SEPARATOR
41         };
42
43         ///
44         InsetSpecialChar() {}
45         ///
46         explicit
47         InsetSpecialChar(Kind k);
48         ///
49         int ascent(BufferView *, LyXFont const &) const;
50         ///
51         int descent(BufferView *, LyXFont const &) const;
52         ///
53         int width(BufferView *, LyXFont const &) const;
54         ///
55         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
56         ///
57         void write(Buffer const *, std::ostream &) const;
58         /// Will not be used when lyxf3
59         void read(Buffer const *, LyXLex & lex);
60         /// 
61         int latex(Buffer const *, std::ostream &,
62                   bool fragile, bool free_spc) const;
63         ///
64         int ascii(Buffer const *, std::ostream &, int linelen) const;
65         ///
66         int linuxdoc(Buffer const *, std::ostream &) const;
67         ///
68         int docBook(Buffer const *, std::ostream &) const;
69         ///
70         virtual Inset * clone(Buffer const &, bool same_id = false) 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