]> git.lyx.org Git - lyx.git/blob - src/insets/InsetVSpace.h
916b440fa5418e35ffdc80082660be0f592834c8
[lyx.git] / src / insets / InsetVSpace.h
1 // -*- C++ -*-
2 /**
3  * \file InsetVSpace.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_VSPACE_H
13 #define INSET_VSPACE_H
14
15
16 #include "Inset.h"
17 #include "VSpace.h"
18 #include "MailInset.h"
19
20
21 namespace lyx {
22
23 class InsetVSpace : public Inset {
24 public:
25         ///
26         InsetVSpace() {}
27         ///
28         InsetVSpace(VSpace const &);
29         ///
30         ~InsetVSpace();
31         ///
32         void metrics(MetricsInfo & mi, Dimension & dim) const;
33         ///
34         Dimension const dimension(BufferView const &) const { return dim_; };
35         ///
36         void draw(PainterInfo & pi, int x, int y) const;
37         ///
38         int latex(Buffer const &, odocstream &,
39                   OutputParams const &) const;
40         ///
41         int plaintext(Buffer const &, odocstream &,
42                       OutputParams const &) const;
43         ///
44         int docbook(Buffer const &, odocstream &,
45                     OutputParams const &) const;
46         ///
47         void read(Buffer const &, Lexer & lex);
48         ///
49         void write(Buffer const & buf, std::ostream & os) const;
50         ///
51         DisplayType display() const { return AlignCenter; }
52         /// How much?
53         VSpace const & space() const { return space_; }
54
55 protected:
56         ///
57         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
58
59 private:
60         virtual Inset * clone() const;
61         ///
62         docstring const label() const;
63
64         ///
65         VSpace space_;
66         ///
67         mutable Dimension dim_;
68 };
69
70
71 class InsetVSpaceMailer : public MailInset {
72 public:
73         ///
74         InsetVSpaceMailer(InsetVSpace & inset);
75         ///
76         virtual Inset & inset() const { return inset_; }
77         ///
78         virtual std::string const & name() const { return name_; }
79         ///
80         virtual std::string const inset2string(Buffer const &) const;
81         ///
82         static void string2params(std::string const &, VSpace &);
83         ///
84         static std::string const params2string(VSpace const &);
85 private:
86         ///
87         static std::string const name_;
88         ///
89         InsetVSpace & inset_;
90 };
91
92
93 } // namespace lyx
94
95 #endif