]> git.lyx.org Git - lyx.git/blob - src/insets/InsetWrap.h
Revert 3ceb5034
[lyx.git] / src / insets / InsetWrap.h
1 // -*- C++ -*-
2 /**
3  * \file InsetWrap.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Dekel Tsur
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSETWRAP_H
13 #define INSETWRAP_H
14
15 #include "InsetCaptionable.h"
16 #include "Length.h"
17
18
19 namespace lyx {
20
21
22 class InsetWrapParams {
23 public:
24         ///
25         void write(std::ostream &) const;
26         ///
27         void read(Lexer &);
28
29         ///
30         std::string type;
31         ///
32         int lines;
33         ///
34         std::string placement;
35         ///
36         Length overhang;
37         ///
38         Length width;
39 };
40
41
42 /** The wrap inset
43  */
44 class InsetWrap : public InsetCaptionable {
45 public:
46         ///
47         InsetWrap(Buffer *, std::string const &);
48         ///
49         ~InsetWrap();
50         ///
51         InsetWrapParams const & params() const { return params_; }
52         ///
53         static void string2params(std::string const &, InsetWrapParams &);
54         ///
55         static std::string params2string(InsetWrapParams const &);
56 private:
57         ///
58         void setCaptionType(std::string const & type);
59         ///
60         void write(std::ostream & os) const;
61         ///
62         void read(Lexer & lex);
63         ///
64         void validate(LaTeXFeatures & features) const;
65         ///
66         InsetCode lyxCode() const { return WRAP_CODE; }
67         ///
68         docstring toolTip(BufferView const & bv, int x, int y) const;
69         ///
70         void latex(otexstream &, OutputParams const &) const;
71         ///
72         int plaintext(odocstringstream & ods, OutputParams const & op,
73                       size_t max_length = INT_MAX) const;
74         ///
75         int docbook(odocstream &, OutputParams const &) const;
76         ///
77         docstring xhtml(XHTMLStream &, OutputParams const &) const;
78         ///
79         bool insetAllowed(InsetCode) const;
80         ///
81         bool showInsetDialog(BufferView *) const;
82         ///
83         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
84         /// Update the label
85         void updateBuffer(ParIterator const &, UpdateType);
86         ///
87         void doDispatch(Cursor & cur, FuncRequest & cmd);
88         ///
89         docstring layoutName() const;
90         ///
91         Inset * clone() const { return new InsetWrap(*this); }
92         /// Is the content of this inset part of the immediate (visible) text sequence?
93         bool isPartOfTextSequence() const { return false; }
94
95         ///
96         InsetWrapParams params_;
97 };
98
99 } // namespace lyx
100
101 #endif