]> git.lyx.org Git - lyx.git/blob - src/insets/InsetVSpace.h
more border tweaks
[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         /// How much?
32         VSpace const & space() const { return space_; }
33         ///
34         InsetCode lyxCode() const { return VSPACE_CODE; }
35         ///
36         void edit(Cursor & cur, bool front,
37                 EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
38         ///
39         EDITABLE editable() const { return IS_EDITABLE; }
40         ///
41         virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
42 private:
43         ///
44         void metrics(MetricsInfo & mi, Dimension & dim) const;
45         ///
46         void draw(PainterInfo & pi, int x, int y) const;
47         ///
48         int latex(odocstream &, OutputParams const &) const;
49         ///
50         int plaintext(odocstream &, OutputParams const &) const;
51         ///
52         int docbook(odocstream &, OutputParams const &) const;
53         ///
54         void read(Lexer & lex);
55         ///
56         void write(std::ostream & os) const;
57         ///
58         DisplayType display() const { return AlignCenter; }
59         ///
60         void doDispatch(Cursor & cur, FuncRequest & cmd);
61         ///
62         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
63         ///
64         Inset * clone() const { return new InsetVSpace(*this); }
65         ///
66         docstring const label() const;
67
68         ///
69         VSpace space_;
70 };
71
72
73 class InsetVSpaceMailer : public MailInset {
74 public:
75         ///
76         InsetVSpaceMailer(InsetVSpace & inset);
77         ///
78         virtual Inset & inset() const { return inset_; }
79         ///
80         virtual std::string const & name() const { return name_; }
81         ///
82         virtual std::string const inset2string(Buffer const &) const;
83         ///
84         static void string2params(std::string const &, VSpace &);
85         ///
86         static std::string const params2string(VSpace const &);
87 private:
88         ///
89         static std::string const name_;
90         ///
91         InsetVSpace & inset_;
92 };
93
94
95 } // namespace lyx
96
97 #endif