]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseturl.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / inseturl.C
index 0b1aa1e038f8dbcdc4efa5b6d12478773f3fe5b4..4802f14eedd1f979fe2031c3df6ad4663f6603f9 100644 (file)
@@ -5,49 +5,35 @@
  *
  * \author José Matos
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #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"
 
-using std::ostream;
+#include "support/lstrings.h"
 
+#include "support/std_ostream.h"
 
-InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
-               : InsetCommand(p)
-{}
+using lyx::support::subst;
 
-
-InsetUrl::~InsetUrl()
-{
-       InsetCommandMailer("url", *this).hideDialog();
-}
+using std::string;
+using std::ostream;
 
 
-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);
-       }
-}
+InsetUrl::InsetUrl(InsetCommandParams const & p)
+       : InsetCommand(p, "url")
+{}
 
 
-string const InsetUrl::getScreenLabel(Buffer const *) const
+string const InsetUrl::getScreenLabel(Buffer const &) const
 {
        string temp;
        if (getCmdName() == "url")
@@ -71,19 +57,20 @@ 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() + ' ';
-       if (runparams.fragile)
+       if (runparams.moving_arg)
                os << "\\protect";
        os << "\\url{" << getContents() << '}';
        return 0;
 }
 
 
-int InsetUrl::ascii(Buffer const *, ostream & os, int) const
+int InsetUrl::plaintext(Buffer const &, ostream & os,
+                   OutputParams const &) const
 {
        if (getOptions().empty())
                os << '[' << getContents() << ']';
@@ -93,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() << "\""
@@ -103,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>";
@@ -111,6 +100,13 @@ int InsetUrl::docbook(Buffer const *, ostream & os, bool) const
 }
 
 
+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");