]> git.lyx.org Git - lyx.git/blob - src/insets/insetvspace.h
1a805d54825dc2cf6ce4f46d4303a3ace5e3050c
[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 class InsetVSpace : public InsetOld {
21 public:
22         ///
23         InsetVSpace() {}
24         ///
25         InsetVSpace(VSpace const &);
26         ///
27         ~InsetVSpace();
28         ///
29         std::auto_ptr<InsetBase> clone() const;
30         ///
31         void metrics(MetricsInfo & mi, Dimension & dim) const;
32         ///
33         void draw(PainterInfo & pi, int x, int y) const;
34         ///
35         int latex(Buffer const &, std::ostream &,
36                   OutputParams const &) const;
37         ///
38         int plaintext(Buffer const &, std::ostream &,
39                       OutputParams const &) const;
40         ///
41         int linuxdoc(Buffer const &, std::ostream &,
42                      OutputParams const &) const;
43         ///
44         int docbook(Buffer const &, std::ostream &,
45                     OutputParams const &) const;
46         ///
47         void read(Buffer const &, LyXLex & lex);
48         ///
49         void write(Buffer const & buf, std::ostream & os) const;
50         ///
51         bool display() const { return true; }
52         /// How much?
53         VSpace const & space() const { return space_; }
54
55 protected:
56         ///
57         virtual
58         DispatchResult
59         priv_dispatch(LCursor & cur, FuncRequest const & cmd);
60
61 private:
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 #endif