]> git.lyx.org Git - lyx.git/blob - src/insets/InsetWrap.h
Strip et al. for citation search
[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
17 #include "support/Length.h"
18
19
20 namespace lyx {
21
22
23 class InsetWrapParams {
24 public:
25         ///
26         void write(std::ostream &) const;
27         ///
28         void read(Lexer &);
29
30         ///
31         std::string type;
32         ///
33         int lines = 0;
34         ///
35         std::string placement = "o";
36         ///
37         Length overhang = Length(0, Length::PCW);
38         ///
39         Length width = Length(50, Length::PCW);
40 };
41
42
43 /** The wrap inset
44  */
45 class InsetWrap : public InsetCaptionable {
46 public:
47         ///
48         InsetWrap(Buffer *, std::string const &);
49         ///
50         ~InsetWrap();
51         ///
52         InsetWrapParams const & params() const { return params_; }
53         ///
54         static void string2params(std::string const &, InsetWrapParams &);
55         ///
56         static std::string params2string(InsetWrapParams const &);
57 private:
58         ///
59         void setCaptionType(std::string const & type) override;
60         ///
61         void write(std::ostream & os) const override;
62         ///
63         void read(Lexer & lex) override;
64         ///
65         void validate(LaTeXFeatures & features) const override;
66         ///
67         InsetCode lyxCode() const override { return WRAP_CODE; }
68         ///
69         docstring toolTip(BufferView const & bv, int x, int y) const override;
70         ///
71         void latex(otexstream &, OutputParams const &) const override;
72         ///
73         int plaintext(odocstringstream & ods, OutputParams const & op,
74                       size_t max_length = INT_MAX) const override;
75         ///
76         void docbook(XMLStream &, OutputParams const &) const override;
77         ///
78         docstring xhtml(XMLStream &, OutputParams const &) const override;
79         ///
80         bool insetAllowed(InsetCode) const override;
81         ///
82         bool showInsetDialog(BufferView *) const override;
83         ///
84         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
85         /// Update the label
86         void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
87         ///
88         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
89         ///
90         docstring layoutName() const override;
91         ///
92         Inset * clone() const override { return new InsetWrap(*this); }
93         /// Is the content of this inset part of the immediate (visible) text sequence?
94         bool isPartOfTextSequence() const override { return false; }
95
96         ///
97         InsetWrapParams params_;
98 };
99
100 } // namespace lyx
101
102 #endif