]> git.lyx.org Git - lyx.git/blob - src/insets/insetspecialchar.h
get rid of same_id from function signatures
[lyx.git] / src / insets / insetspecialchar.h
1 // -*- C++ -*-
2 /**
3  * \file insetspecialchar.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger Alstrup Nielsen
8  * \author Jean-Marc Lasgouttes
9  * \author Lars Gullik Bjønnes
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef INSET_SPECIALCHAR_H
15 #define INSET_SPECIALCHAR_H
16
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         };
40
41         ///
42         InsetSpecialChar() {}
43         ///
44         explicit
45         InsetSpecialChar(Kind k);
46         ///
47         Kind kind() const;
48         ///
49         void dimension(BufferView *, LyXFont const &, Dimension &) const;
50         ///
51         void draw(BufferView *, LyXFont const &, int, float &) const;
52         ///
53         void write(Buffer const *, std::ostream &) const;
54         /// Will not be used when lyxf3
55         void read(Buffer const *, LyXLex & lex);
56         ///
57         int latex(Buffer const *, std::ostream &,
58                   LatexRunParams const &) const;
59         ///
60         int ascii(Buffer const *, std::ostream &, int linelen) const;
61         ///
62         int linuxdoc(Buffer const *, std::ostream &) const;
63         ///
64         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
65         ///
66         virtual Inset * clone(Buffer const &) const;
67         ///
68         //virtual Inset * clone(Buffer const &, bool same_id) const;
69         ///
70         Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; }
71         /// We don't need \begin_inset and \end_inset
72         bool directWrite() const { return true; }
73         ///
74         void validate(LaTeXFeatures &) const;
75
76         // should this inset be handled like a normal charater
77         bool isChar() const;
78         /// is this equivalent to a letter?
79         bool isLetter() const;
80         /// is this equivalent to a space (which is BTW different from
81         // a line separator)?
82         bool isSpace() const;
83         // should we break lines after this inset?
84         bool isLineSeparator() const;
85 private:
86         /// And which kind is this?
87         Kind kind_;
88 };
89
90 #endif