]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseturl.C
clear()->erase() ; lots of using directives for cxx
[lyx.git] / src / insets / inseturl.C
index fe01fa9078a0f3d542c6295e93620481b01f1a1d..ae2c16a9fe1028ce8dfef62db6b4a6dfe2470875 100644 (file)
@@ -14,8 +14,7 @@
 #include "LaTeXFeatures.h"
 #include "lyx_gui_misc.h" // CancelCloseBoxCB
 
-extern void UpdateInset(BufferView *, Inset * inset, bool mark_dirty = true);
-
+using std::ostream;
 
 InsetUrl::InsetUrl(string const & cmd)
        : fd_form_url(0)
@@ -94,7 +93,7 @@ void InsetUrl::CloseUrlCB(FL_OBJECT * ob, long)
                        inset->flag = InsetUrl::URL;
                else
                        inset->flag = InsetUrl::HTML_URL;
-               UpdateInset(bv, inset);
+               bv->updateInset(inset, true);
        }
        
        if (inset->fd_form_url) {
@@ -111,7 +110,13 @@ extern "C" void C_InsetUrl_CloseUrlCB(FL_OBJECT * ob, long data)
 }
 
 
-void InsetUrl::Edit(BufferView * bv, int, int)
+char const * InsetUrl::EditMessage() const 
+{
+       return _("Opened Url");
+}
+
+
+void InsetUrl::Edit(BufferView * bv, int, int, unsigned int)
 {
        static int ow = -1, oh;
 
@@ -168,44 +173,42 @@ string InsetUrl::getScreenLabel() const
 }
 
 
-int InsetUrl::Latex(ostream & os, signed char fragile) const
-{
-       string latex_output;
-       int res = Latex(latex_output, fragile);
-       os << latex_output;
-
-       return res;
-}
-
-
-int InsetUrl::Latex(string & file, signed char fragile) const
+int InsetUrl::Latex(ostream & os,
+                   bool fragile, bool /*free_spc*/) const
 {
        if (!getOptions().empty())
-               file += getOptions() + ' ';
+               os << getOptions() + ' ';
        if (fragile)
-               file += "\\protect";
+               os << "\\protect";
+       os << "\\url{" << getContents() << '}';
+       return 0;
+}
 
-       file += "\\url{" + getContents() + '}';
 
+int InsetUrl::Ascii(ostream & os) const
+{
+       if (getOptions().empty())
+               os << "[" << getContents() << "]";
+       else
+               os << "[" << getContents() << "||" <<  getOptions() << "]";
        return 0;
 }
 
 
-int InsetUrl::Linuxdoc(string & file) const
+int InsetUrl::Linuxdoc(ostream & os) const
 {
-       file +=  "<"+ getCmdName() +
-                " url=\""  + getContents()+"\"" +
-                " name=\"" + getOptions() +"\">";
+       os << "<" << getCmdName()
+          << " url=\""  << getContents() << "\""
+          << " name=\"" << getOptions() << "\">";
 
        return 0;
 }
 
 
-int InsetUrl::DocBook(string & file) const
+int InsetUrl::DocBook(ostream & os) const
 {
-       file +=  "<ulink url=\""  + getContents() + "\">" +
-                getOptions() +"</ulink>";
-
+       os << "<ulink url=\"" << getContents() << "\">"
+          << getOptions() << "</ulink>";
        return 0;
 }