]> git.lyx.org Git - lyx.git/blob - src/insets/insetoptarg.C
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetoptarg.C
1 /**
2  * \file insetoptarg.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Martin Vermeer
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13
14 #include "debug.h"
15
16 #include "insetoptarg.h"
17 #include "support/LOstream.h"
18 #include "frontends/Alert.h"
19 #include "support/lstrings.h" // frontStrip, strip
20 #include "lyxtext.h"
21 #include "buffer.h"
22 #include "gettext.h"
23 #include "BufferView.h"
24 #include "support/lstrings.h"
25
26 using std::ostream;
27 using std::vector;
28 using std::pair;
29
30 InsetOptArg::InsetOptArg(BufferParams const & ins)
31         : InsetCollapsable(ins, true)
32 {
33         LyXFont font(LyXFont::ALL_SANE);
34         font.setColor(LColor::collapsable);
35         setLabelFont(font);
36         setLabel(_("opt"));
37 }
38
39
40 InsetOptArg::InsetOptArg(InsetOptArg const & in, bool same_id)
41         : InsetCollapsable(in, same_id)
42 {
43         LyXFont font(LyXFont::ALL_SANE);
44         font.setColor(LColor::collapsable);
45         setLabelFont(font);
46         setLabel(_("opt"));
47 }
48
49
50 Inset * InsetOptArg::clone(Buffer const &, bool same_id) const
51 {
52         return new InsetOptArg(*this, same_id);
53 }
54
55
56 string const InsetOptArg::editMessage() const
57 {
58         return _("Opened Optional Argument Inset");
59 }
60
61
62 void InsetOptArg::write(Buffer const * buf, ostream & os) const
63 {
64         os << "OptArg" << "\n";
65         InsetCollapsable::write(buf, os);
66 }
67
68
69 int InsetOptArg::latex(Buffer const *, ostream &,
70                        LatexRunParams const &) const
71 {
72         return 0;
73 }
74
75
76 int InsetOptArg::latexOptional(Buffer const * buf, ostream & os,
77                                LatexRunParams const & runparams) const
78 {
79         os << '[';
80         int const i = inset.latex(buf, os, runparams);
81         os << ']';
82         return i + 2;
83 }