*
* \author José Matos
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "inseturl.h"
+
#include "funcrequest.h"
-#include "BufferView.h"
-#include "LaTeXFeatures.h"
#include "latexrunparams.h"
-#include "frontends/LyXView.h"
-#include "debug.h"
-#include "frontends/Dialogs.h"
-#include "support/lstrings.h"
+#include "LaTeXFeatures.h"
#include "gettext.h"
+#include "support/lstrings.h"
+
+#include "support/std_ostream.h"
+
+using lyx::support::subst;
+
+using std::string;
using std::ostream;
-InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
+InsetUrl::InsetUrl(InsetCommandParams const & p)
: InsetCommand(p)
{}
+// InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
+// : InsetCommand(p, false)
+// {}
+
+
InsetUrl::~InsetUrl()
{
InsetCommandMailer("url", *this).hideDialog();
}
-dispatch_result InsetUrl::localDispatch(FuncRequest const & cmd)
+dispatch_result
+InsetUrl::priv_dispatch(FuncRequest const & cmd,
+ idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
case LFUN_INSET_EDIT:
InsetCommandMailer("url", *this).showDialog(cmd.view());
return DISPATCHED;
default:
- return InsetCommand::localDispatch(cmd);
+ return InsetCommand::priv_dispatch(cmd, idx, pos);
}
}
-string const InsetUrl::getScreenLabel(Buffer const *) const
+string const InsetUrl::getScreenLabel(Buffer const &) const
{
string temp;
if (getCmdName() == "url")
}
-int InsetUrl::latex(Buffer const *, ostream & os,
+int InsetUrl::latex(Buffer const &, ostream & os,
LatexRunParams const & runparams) const
{
if (!getOptions().empty())
os << getOptions() + ' ';
- if (runparams.fragile)
+ if (runparams.moving_arg)
os << "\\protect";
os << "\\url{" << getContents() << '}';
return 0;
}
-int InsetUrl::ascii(Buffer const *, ostream & os, int) const
+int InsetUrl::ascii(Buffer const &, ostream & os, int) const
{
if (getOptions().empty())
os << '[' << getContents() << ']';
}
-int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
+int InsetUrl::linuxdoc(Buffer const &, ostream & os) const
{
os << '<' << getCmdName()
<< " url=\"" << getContents() << "\""
}
-int InsetUrl::docbook(Buffer const *, ostream & os, bool) const
+int InsetUrl::docbook(Buffer const &, ostream & os, bool) const
{
os << "<ulink url=\"" << subst(getContents(),"&","&")
<< "\">" << getOptions() << "</ulink>";