8 #include "BufferView.h"
9 #include "LaTeXFeatures.h"
10 #include "frontends/LyXView.h"
12 #include "frontends/Dialogs.h"
13 #include "support/lstrings.h"
19 InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
24 void InsetUrl::edit(BufferView * bv, int, int, unsigned int)
26 bv->owner()->getDialogs()->showUrl(this);
30 void InsetUrl::edit(BufferView * bv, bool)
36 string const InsetUrl::getScreenLabel(Buffer const *) const
39 if (getCmdName() == "url")
42 temp = _("HtmlUrl: ");
44 if (!getOptions().empty())
47 temp += getContents();
53 int InsetUrl::latex(Buffer const *, ostream & os,
54 bool fragile, bool /*free_spc*/) const
56 if (!getOptions().empty())
57 os << getOptions() + ' ';
60 os << "\\url{" << getContents() << '}';
65 int InsetUrl::ascii(Buffer const *, ostream & os, int) const
67 if (getOptions().empty())
68 os << "[" << getContents() << "]";
70 os << "[" << getContents() << "||" << getOptions() << "]";
75 int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
77 os << "<" << getCmdName()
78 << " url=\"" << getContents() << "\""
79 << " name=\"" << getOptions() << "\">";
85 int InsetUrl::docbook(Buffer const *, ostream & os) const
87 os << "<ulink url=\"" << subst(getContents(),"&","&")
88 << "\">" << getOptions() << "</ulink>";
93 void InsetUrl::validate(LaTeXFeatures & features) const
95 features.require("url");