]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseturl.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / inseturl.C
index 619e8b5dbb958c13af5c6e46c2088a91d6fe8e25..0f052738d8a104ec28abe54120f696a70d771b33 100644 (file)
 #include <config.h>
 
 #include "inseturl.h"
+
+#include "dispatchresult.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 "gettext.h"
+#include "outputparams.h"
+
+#include "support/lstrings.h"
 
-using namespace lyx::support;
+#include "support/std_ostream.h"
 
+using lyx::support::subst;
+
+using std::string;
 using std::ostream;
 
 
 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();
-}
-
-
-dispatch_result InsetUrl::localDispatch(FuncRequest const & cmd)
-{
-       switch (cmd.action) {
-               case LFUN_INSET_EDIT:
-                       InsetCommandMailer("url", *this).showDialog(cmd.view());
-                       return DISPATCHED;
-               default:
-                       return InsetCommand::localDispatch(cmd);
-       }
-}
-
-
-string const InsetUrl::getScreenLabel(Buffer const *) const
+string const InsetUrl::getScreenLabel(Buffer const &) const
 {
        string temp;
        if (getCmdName() == "url")
@@ -78,8 +57,8 @@ string const InsetUrl::getScreenLabel(Buffer const *) const
 }
 
 
-int InsetUrl::latex(Buffer const *, ostream & os,
-                   LatexRunParams const & runparams) const
+int InsetUrl::latex(Buffer const &, ostream & os,
+                   OutputParams const & runparams) const
 {
        if (!getOptions().empty())
                os << getOptions() + ' ';
@@ -90,7 +69,8 @@ int InsetUrl::latex(Buffer const *, ostream & os,
 }
 
 
-int InsetUrl::ascii(Buffer const *, ostream & os, int) const
+int InsetUrl::plaintext(Buffer const &, ostream & os,
+                   OutputParams const &) const
 {
        if (getOptions().empty())
                os << '[' << getContents() << ']';
@@ -100,7 +80,8 @@ int InsetUrl::ascii(Buffer const *, ostream & os, int) const
 }
 
 
-int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
+int InsetUrl::linuxdoc(Buffer const &, ostream & os,
+                      OutputParams const &) const
 {
        os << '<' << getCmdName()
           << " url=\""  << getContents() << "\""
@@ -110,7 +91,8 @@ int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
 }
 
 
-int InsetUrl::docbook(Buffer const *, ostream & os, bool) const
+int InsetUrl::docbook(Buffer const &, ostream & os,
+                     OutputParams const &) const
 {
        os << "<ulink url=\"" << subst(getContents(),"&","&amp;")
           << "\">" << getOptions() << "</ulink>";