]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcommand.h
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / insetcommand.h
index 32129d039b0d7300e96acdca6ea8fdc786651154..1548d7c84d2eaa1d96be80e4365be517ad6bbed5 100644 (file)
 #ifndef INSET_LATEXCOMMAND_H
 #define INSET_LATEXCOMMAND_H
 
-
 #include "inset.h"
 #include "insetcommandparams.h"
 #include "render_button.h"
 #include "mailinset.h"
+#include "cursor.h"
+
 
 // Created by Alejandro 970222
 /** Used to insert a LaTeX command automatically
@@ -30,8 +31,9 @@
 class InsetCommand : public InsetOld {
 public:
        ///
-       explicit
-       InsetCommand(InsetCommandParams const &);
+       InsetCommand(InsetCommandParams const &, std::string const & mailer_name);
+       ///
+       ~InsetCommand();
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
@@ -46,30 +48,35 @@ public:
        void scanCommand(std::string const & c) { p_.scanCommand(c); };
        ///
        virtual int latex(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &, int linelen) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
-       virtual int linuxdoc(Buffer const &, std::ostream &) const;
+       virtual int linuxdoc(Buffer const &, std::ostream &,
+                            OutputParams const &) const;
        ///
-       virtual int docbook(Buffer const &, std::ostream &, bool) const;
+       virtual int docbook(Buffer const &, std::ostream &,
+                           OutputParams const & runparams) const;
        ///
        InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
 
        ///
        InsetCommandParams const & params() const { return p_; }
        ///
-       virtual dispatch_result localDispatch(FuncRequest const & cmd);
-       ///
        std::string const & getContents() const { return p_.getContents(); }
        ///
        void setContents(std::string const & c) { p_.setContents(c); }
        ///
        std::string const & getOptions() const { return p_.getOptions(); }
        ///
+       std::string const & getSecOptions() const { return p_.getSecOptions(); }
+       ///
        RenderButton & button() const { return button_; }
 
 protected:
+       ///
+       void priv_dispatch(LCursor & cur, FuncRequest & cmd);
        ///
        std::string const getCommand() const { return p_.getCommand(); }
        ///
@@ -79,6 +86,8 @@ protected:
        ///
        void setOptions(std::string const & o) { p_.setOptions(o); }
        ///
+       void setSecOptions(std::string const & s) { p_.setSecOptions(s); }
+       ///
        void setParams(InsetCommandParams const &);
        /// This should provide the text for the button
        virtual std::string const getScreenLabel(Buffer const &) const = 0;
@@ -86,6 +95,7 @@ protected:
 private:
        ///
        InsetCommandParams p_;
+       std::string mailer_name_;
        mutable bool set_label_;
        mutable RenderButton button_;
 };
@@ -102,10 +112,11 @@ public:
        ///
        virtual std::string const inset2string(Buffer const &) const;
        ///
-       static void string2params(std::string const &, InsetCommandParams &);
+       static void string2params(std::string const &, std::string const & name,
+                                 InsetCommandParams &);
        ///
        static std::string const params2string(std::string const & name,
-                                         InsetCommandParams const &);
+                                              InsetCommandParams const &);
 private:
        ///
        std::string const name_;