]> git.lyx.org Git - lyx.git/blob - src/insets/InsetVSpace.h
0d90e65fc35866e1325127b9088647bf2609a694
[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 InsetOld {
24 public:
25         ///
26         InsetVSpace() {}
27         ///
28         InsetVSpace(VSpace const &);
29         ///
30         ~InsetVSpace();
31         ///
32         bool metrics(MetricsInfo & mi, Dimension & dim) const;
33         ///
34         void draw(PainterInfo & pi, int x, int y) const;
35         ///
36         int latex(Buffer const &, odocstream &,
37                   OutputParams const &) const;
38         ///
39         int plaintext(Buffer const &, odocstream &,
40                       OutputParams const &) const;
41         ///
42         int docbook(Buffer const &, odocstream &,
43                     OutputParams const &) const;
44         ///
45         void read(Buffer const &, LyXLex & lex);
46         ///
47         void write(Buffer const & buf, std::ostream & os) const;
48         ///
49         bool display() const { return true; }
50         /// How much?
51         VSpace const & space() const { return space_; }
52
53 protected:
54         ///
55         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
56
57 private:
58         virtual std::auto_ptr<InsetBase> doClone() const;
59         ///
60         docstring const label() const;
61
62         ///
63         VSpace space_;
64 };
65
66
67 class InsetVSpaceMailer : public MailInset {
68 public:
69         ///
70         InsetVSpaceMailer(InsetVSpace & inset);
71         ///
72         virtual InsetBase & inset() const { return inset_; }
73         ///
74         virtual std::string const & name() const { return name_; }
75         ///
76         virtual std::string const inset2string(Buffer const &) const;
77         ///
78         static void string2params(std::string const &, VSpace &);
79         ///
80         static std::string const params2string(VSpace const &);
81 private:
82         ///
83         static std::string const name_;
84         ///
85         InsetVSpace & inset_;
86 };
87
88
89 } // namespace lyx
90
91 #endif