3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Martin Vermeer
8 * Full author contact details are available in file CREDITS.
13 #include "insetoptarg.h"
18 #include "paragraph.h"
25 using std::ostringstream;
28 InsetOptArg::InsetOptArg(BufferParams const & ins)
29 : InsetCollapsable(ins)
31 LyXFont font(LyXFont::ALL_SANE);
32 font.setColor(LColor::collapsable);
38 InsetOptArg::InsetOptArg(InsetOptArg const & in)
39 : InsetCollapsable(in)
41 LyXFont font(LyXFont::ALL_SANE);
42 font.setColor(LColor::collapsable);
48 auto_ptr<InsetBase> InsetOptArg::doClone() const
50 return auto_ptr<InsetBase>(new InsetOptArg(*this));
54 string const InsetOptArg::editMessage() const
56 return _("Opened Optional Argument Inset");
60 void InsetOptArg::write(Buffer const & buf, ostream & os) const
62 os << "OptArg" << "\n";
63 InsetCollapsable::write(buf, os);
67 int InsetOptArg::latex(Buffer const &, ostream &,
68 OutputParams const &) const
73 int InsetOptArg::linuxdoc(Buffer const &, ostream &,
74 OutputParams const &) const
79 int InsetOptArg::docbook(Buffer const &, ostream &,
80 OutputParams const &) const
86 int InsetOptArg::plaintext(Buffer const &, ostream &,
87 OutputParams const &) const
93 int InsetOptArg::latexOptional(Buffer const & buf, ostream & os,
94 OutputParams const & runparams) const
97 int ret = InsetText::latex(buf, ss, runparams);
98 string str = ss.str();
99 if (str.find(']') != string::npos)
100 str = '{' + str + '}';
101 os << '[' << str << ']';