#include "dispatchresult.h"
#include "funcrequest.h"
-#include "latexrunparams.h"
#include "LaTeXFeatures.h"
#include "gettext.h"
+#include "outputparams.h"
#include "support/lstrings.h"
InsetUrl::InsetUrl(InsetCommandParams const & p)
- : InsetCommand(p)
+ : InsetCommand(p, "url")
{}
-// InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
-// : InsetCommand(p, false)
-// {}
-
-
-InsetUrl::~InsetUrl()
-{
- InsetCommandMailer("url", *this).hideDialog();
-}
-
-
-DispatchResult
-InsetUrl::priv_dispatch(FuncRequest const & cmd,
- idx_type & idx, pos_type & pos)
-{
- switch (cmd.action) {
- case LFUN_MOUSE_PRESS:
- InsetCommandMailer("url", *this).showDialog(cmd.view());
- return DispatchResult(true, true);
- default:
- return InsetCommand::priv_dispatch(cmd, idx, pos);
- }
-}
-
-
string const InsetUrl::getScreenLabel(Buffer const &) const
{
string temp;
int InsetUrl::latex(Buffer const &, ostream & os,
- LatexRunParams const & runparams) const
+ OutputParams const & runparams) const
{
if (!getOptions().empty())
os << getOptions() + ' ';
}
-int InsetUrl::ascii(Buffer const &, ostream & os,
- LatexRunParams const &) const
+int InsetUrl::plaintext(Buffer const &, ostream & os,
+ OutputParams const &) const
{
if (getOptions().empty())
os << '[' << getContents() << ']';
int InsetUrl::linuxdoc(Buffer const &, ostream & os,
- LatexRunParams const &) const
+ OutputParams const &) const
{
os << '<' << getCmdName()
<< " url=\"" << getContents() << "\""
int InsetUrl::docbook(Buffer const &, ostream & os,
- LatexRunParams const &) const
+ OutputParams const &) const
{
os << "<ulink url=\"" << subst(getContents(),"&","&")
<< "\">" << getOptions() << "</ulink>";
}
+int InsetUrl::textString(Buffer const & buf, ostream & os,
+ OutputParams const & op) const
+{
+ return plaintext(buf, os, op);
+}
+
+
void InsetUrl::validate(LaTeXFeatures & features) const
{
features.require("url");