]> git.lyx.org Git - lyx.git/blob - src/insets/InsetSpace.h
'using namespace lyx::support' instead of 'using support::xxx'
[lyx.git] / src / insets / InsetSpace.h
1 // -*- C++ -*-
2 /**
3  * \file InsetSpace.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  * \author Jürgen Spitzmüller
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef INSET_SPACE_H
16 #define INSET_SPACE_H
17
18
19 #include "Inset.h"
20
21
22 namespace lyx {
23
24 class LaTeXFeatures;
25
26 ///  Used to insert different kinds of spaces
27 class InsetSpace : public Inset {
28 public:
29
30         /// The different kinds of spaces we support
31         enum Kind {
32                 /// Normal space ('\ ')
33                 NORMAL,
34                 /// Protected (no break) space ('~')
35                 PROTECTED,
36                 /// Thin space ('\,')
37                 THIN,
38                 /// \quad (1em)
39                 QUAD,
40                 /// \qquad (2em)
41                 QQUAD,
42                 /// \enspace (0.5em unbreakable)
43                 ENSPACE,
44                 /// \enspace (0.5em breakable)
45                 ENSKIP,
46                 /// Negative thin space ('\negthinspace')
47                 NEGTHIN
48         };
49
50         ///
51         InsetSpace();
52
53         ///
54         explicit
55         InsetSpace(Kind k);
56         ///
57         Kind kind() const;
58         ///
59         void metrics(MetricsInfo &, Dimension &) const;
60         ///
61         void draw(PainterInfo & pi, int x, int y) const;
62         ///
63         void write(Buffer const &, std::ostream &) const;
64         /// Will not be used when lyxf3
65         void read(Buffer const &, Lexer & lex);
66         ///
67         int latex(Buffer const &, odocstream &,
68                   OutputParams const &) const;
69         ///
70         int plaintext(Buffer const &, odocstream &,
71                       OutputParams const &) const;
72         ///
73         int docbook(Buffer const &, odocstream &,
74                     OutputParams const &) const;
75         /// the string that is passed to the TOC
76         virtual int textString(Buffer const &, odocstream &,
77                 OutputParams const &) const;
78         ///
79         InsetCode lyxCode() const { return SPACE_CODE; }
80         /// We don't need \begin_inset and \end_inset
81         bool directWrite() const { return true; }
82
83         // should this inset be handled like a normal charater
84         bool isChar() const;
85         /// is this equivalent to a letter?
86         bool isLetter() const;
87         /// is this equivalent to a space (which is BTW different from
88         // a line separator)?
89         bool isSpace() const;
90 private:
91         virtual Inset * clone() const;
92
93         /// And which kind is this?
94         Kind kind_;
95 };
96
97
98 } // namespace lyx
99
100 #endif // INSET_SPACE_H