2002-08-24 20:25:17 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetOptArg.cpp
|
2002-09-25 14:26:13 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-23 09:05:32 +00:00
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Martin Vermeer
|
2002-09-25 14:26:13 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-08-24 20:25:17 +00:00
|
|
|
*/
|
2002-08-23 09:05:32 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetOptArg.h"
|
2002-08-23 09:05:32 +00:00
|
|
|
|
2007-11-29 07:04:28 +00:00
|
|
|
#include "support/debug.h"
|
2007-11-01 22:17:22 +00:00
|
|
|
#include "support/docstream.h"
|
2008-02-18 07:14:42 +00:00
|
|
|
#include "support/gettext.h"
|
2007-11-01 22:17:22 +00:00
|
|
|
|
2007-12-12 19:28:07 +00:00
|
|
|
using namespace std;
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
2006-09-09 18:52:00 +00:00
|
|
|
|
2002-08-23 09:05:32 +00:00
|
|
|
|
2008-03-04 22:28:18 +00:00
|
|
|
InsetOptArg::InsetOptArg(Buffer const & buf)
|
|
|
|
: InsetCollapsable(buf)
|
2007-11-15 15:40:01 +00:00
|
|
|
{}
|
2002-08-23 09:05:32 +00:00
|
|
|
|
2002-08-24 20:25:17 +00:00
|
|
|
|
2008-02-27 20:43:16 +00:00
|
|
|
docstring InsetOptArg::editMessage() const
|
2002-08-23 09:05:32 +00:00
|
|
|
{
|
2006-09-09 18:52:00 +00:00
|
|
|
return _("Opened Optional Argument Inset");
|
2002-08-23 09:05:32 +00:00
|
|
|
}
|
|
|
|
|
2002-08-24 20:25:17 +00:00
|
|
|
|
2008-02-27 20:43:16 +00:00
|
|
|
void InsetOptArg::write(ostream & os) const
|
2002-08-23 09:05:32 +00:00
|
|
|
{
|
|
|
|
os << "OptArg" << "\n";
|
2008-02-27 20:43:16 +00:00
|
|
|
InsetCollapsable::write(os);
|
2002-08-23 09:05:32 +00:00
|
|
|
}
|
|
|
|
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2008-02-27 20:43:16 +00:00
|
|
|
int InsetOptArg::latex(odocstream &, OutputParams const &) const
|
2002-08-23 09:05:32 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-02-15 23:44:33 +00:00
|
|
|
|
2008-02-27 20:43:16 +00:00
|
|
|
int InsetOptArg::plaintext(odocstream &, OutputParams const &) const
|
2005-02-28 13:14:48 +00:00
|
|
|
{
|
2007-02-18 18:55:11 +00:00
|
|
|
return 0; // do not output optional arguments
|
2005-02-28 13:14:48 +00:00
|
|
|
}
|
|
|
|
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2008-02-27 20:43:16 +00:00
|
|
|
int InsetOptArg::docbook(odocstream &, OutputParams const &) const
|
2005-05-11 09:47:54 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-27 20:43:16 +00:00
|
|
|
int InsetOptArg::latexOptional(odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
OutputParams const & runparams) const
|
2002-08-23 09:05:32 +00:00
|
|
|
{
|
2006-10-21 00:16:43 +00:00
|
|
|
odocstringstream ss;
|
2008-02-27 20:43:16 +00:00
|
|
|
int ret = InsetText::latex(ss, runparams);
|
2006-10-19 16:51:30 +00:00
|
|
|
docstring str = ss.str();
|
|
|
|
if (str.find(']') != docstring::npos)
|
2004-08-13 23:30:26 +00:00
|
|
|
str = '{' + str + '}';
|
|
|
|
os << '[' << str << ']';
|
2004-11-19 16:17:52 +00:00
|
|
|
return ret;
|
2002-08-23 09:05:32 +00:00
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|