#include "LaTeXFeatures.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
+using std::ostream;
+
InsetUrl::InsetUrl(string const & cmd)
: fd_form_url(0)
}
-extern "C" void C_InsetUrl_CloseUrlCB(FL_OBJECT * ob, long data)
+extern "C"
+void C_InsetUrl_CloseUrlCB(FL_OBJECT * ob, long data)
{
InsetUrl::CloseUrlCB(ob, data);
}
+char const * InsetUrl::EditMessage() const
+{
+ return _("Opened Url");
+}
+
+
void InsetUrl::Edit(BufferView * bv, int, int, unsigned int)
{
static int ow = -1, oh;
temp += _("HtmlUrl: ");
else
temp += _("Url: ");
- temp += getContents();
if(!getOptions().empty()) {
- temp += "||";
temp += getOptions();
+ } else {
+ temp += getContents();
}
return temp;
}
-int InsetUrl::Latex(ostream & os, signed char fragile) const
+int InsetUrl::Latex(Buffer const *, ostream & os,
+ bool fragile, bool /*free_spc*/) const
{
-#ifdef USE_OSTREAM_ONLY
if (!getOptions().empty())
os << getOptions() + ' ';
if (fragile)
os << "\\protect";
os << "\\url{" << getContents() << '}';
- return 0;
-#else
- string latex_output;
- int res = Latex(latex_output, fragile);
- os << latex_output;
-
- return res;
-#endif
-}
-
-
-#ifndef USE_OSTREAM_ONLY
-int InsetUrl::Latex(string & file, signed char fragile) const
-{
- if (!getOptions().empty())
- file += getOptions() + ' ';
- if (fragile)
- file += "\\protect";
-
- file += "\\url{" + getContents() + '}';
-
return 0;
}
-int InsetUrl::Linuxdoc(string & file) const
+int InsetUrl::Ascii(Buffer const *, ostream & os) const
{
- file += "<"+ getCmdName() +
- " url=\"" + getContents()+"\"" +
- " name=\"" + getOptions() +"\">";
-
- return 0;
-}
-
-
-int InsetUrl::DocBook(string & file) const
-{
- file += "<ulink url=\"" + getContents() + "\">" +
- getOptions() +"</ulink>";
-
+ if (getOptions().empty())
+ os << "[" << getContents() << "]";
+ else
+ os << "[" << getContents() << "||" << getOptions() << "]";
return 0;
}
-#else
-int InsetUrl::Linuxdoc(ostream & os) const
+int InsetUrl::Linuxdoc(Buffer const *, ostream & os) const
{
os << "<" << getCmdName()
<< " url=\"" << getContents() << "\""
}
-int InsetUrl::DocBook(ostream & os) const
+int InsetUrl::DocBook(Buffer const *, ostream & os) const
{
os << "<ulink url=\"" << getContents() << "\">"
<< getOptions() << "</ulink>";
return 0;
}
-#endif
void InsetUrl::Validate(LaTeXFeatures & features) const